@@ -86,9 +86,9 @@ class AMDGPULibCalls {
86
86
bool sincosUseNative (CallInst *aCI, const FuncInfo &FInfo);
87
87
88
88
// evaluate calls if calls' arguments are constants.
89
- bool evaluateScalarMathFunc (FuncInfo &FInfo, double & Res0,
89
+ bool evaluateScalarMathFunc (const FuncInfo &FInfo, double & Res0,
90
90
double & Res1, Constant *copr0, Constant *copr1, Constant *copr2);
91
- bool evaluateCall (CallInst *aCI, FuncInfo &FInfo);
91
+ bool evaluateCall (CallInst *aCI, const FuncInfo &FInfo);
92
92
93
93
// exp
94
94
bool fold_exp (CallInst *CI, IRBuilder<> &B, const FuncInfo &FInfo);
@@ -115,7 +115,8 @@ class AMDGPULibCalls {
115
115
bool fold_sincos (CallInst * CI, IRBuilder<> &B, AliasAnalysis * AA);
116
116
117
117
// __read_pipe/__write_pipe
118
- bool fold_read_write_pipe (CallInst *CI, IRBuilder<> &B, FuncInfo &FInfo);
118
+ bool fold_read_write_pipe (CallInst *CI, IRBuilder<> &B,
119
+ const FuncInfo &FInfo);
119
120
120
121
// llvm.amdgcn.wavefrontsize
121
122
bool fold_wavefrontsize (CallInst *CI, IRBuilder<> &B);
@@ -557,7 +558,7 @@ bool AMDGPULibCalls::useNative(CallInst *aCI) {
557
558
// for such cases where N is the size in bytes of the type (N = 1, 2, 4, 8, ...,
558
559
// 128). The same for __read_pipe_4, write_pipe_2, and write_pipe_4.
559
560
bool AMDGPULibCalls::fold_read_write_pipe (CallInst *CI, IRBuilder<> &B,
560
- FuncInfo &FInfo) {
561
+ const FuncInfo &FInfo) {
561
562
auto *Callee = CI->getCalledFunction ();
562
563
if (!Callee->isDeclaration ())
563
564
return false ;
@@ -1409,7 +1410,7 @@ AllocaInst* AMDGPULibCalls::insertAlloca(CallInst *UI, IRBuilder<> &B,
1409
1410
return Alloc;
1410
1411
}
1411
1412
1412
- bool AMDGPULibCalls::evaluateScalarMathFunc (FuncInfo &FInfo,
1413
+ bool AMDGPULibCalls::evaluateScalarMathFunc (const FuncInfo &FInfo,
1413
1414
double & Res0, double & Res1,
1414
1415
Constant *copr0, Constant *copr1,
1415
1416
Constant *copr2) {
@@ -1604,7 +1605,7 @@ bool AMDGPULibCalls::evaluateScalarMathFunc(FuncInfo &FInfo,
1604
1605
return false ;
1605
1606
}
1606
1607
1607
- bool AMDGPULibCalls::evaluateCall (CallInst *aCI, FuncInfo &FInfo) {
1608
+ bool AMDGPULibCalls::evaluateCall (CallInst *aCI, const FuncInfo &FInfo) {
1608
1609
int numArgs = (int )aCI->arg_size ();
1609
1610
if (numArgs > 3 )
1610
1611
return false ;
0 commit comments