Skip to content

Commit a750332

Browse files
committed
AMDGPULibCalls - constify some FuncInfo& arguments. NFCI.
1 parent 2eaef53 commit a750332

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ class AMDGPULibCalls {
8686
bool sincosUseNative(CallInst *aCI, const FuncInfo &FInfo);
8787

8888
// evaluate calls if calls' arguments are constants.
89-
bool evaluateScalarMathFunc(FuncInfo &FInfo, double& Res0,
89+
bool evaluateScalarMathFunc(const FuncInfo &FInfo, double& Res0,
9090
double& Res1, Constant *copr0, Constant *copr1, Constant *copr2);
91-
bool evaluateCall(CallInst *aCI, FuncInfo &FInfo);
91+
bool evaluateCall(CallInst *aCI, const FuncInfo &FInfo);
9292

9393
// exp
9494
bool fold_exp(CallInst *CI, IRBuilder<> &B, const FuncInfo &FInfo);
@@ -115,7 +115,8 @@ class AMDGPULibCalls {
115115
bool fold_sincos(CallInst * CI, IRBuilder<> &B, AliasAnalysis * AA);
116116

117117
// __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);
119120

120121
// llvm.amdgcn.wavefrontsize
121122
bool fold_wavefrontsize(CallInst *CI, IRBuilder<> &B);
@@ -557,7 +558,7 @@ bool AMDGPULibCalls::useNative(CallInst *aCI) {
557558
// for such cases where N is the size in bytes of the type (N = 1, 2, 4, 8, ...,
558559
// 128). The same for __read_pipe_4, write_pipe_2, and write_pipe_4.
559560
bool AMDGPULibCalls::fold_read_write_pipe(CallInst *CI, IRBuilder<> &B,
560-
FuncInfo &FInfo) {
561+
const FuncInfo &FInfo) {
561562
auto *Callee = CI->getCalledFunction();
562563
if (!Callee->isDeclaration())
563564
return false;
@@ -1409,7 +1410,7 @@ AllocaInst* AMDGPULibCalls::insertAlloca(CallInst *UI, IRBuilder<> &B,
14091410
return Alloc;
14101411
}
14111412

1412-
bool AMDGPULibCalls::evaluateScalarMathFunc(FuncInfo &FInfo,
1413+
bool AMDGPULibCalls::evaluateScalarMathFunc(const FuncInfo &FInfo,
14131414
double& Res0, double& Res1,
14141415
Constant *copr0, Constant *copr1,
14151416
Constant *copr2) {
@@ -1604,7 +1605,7 @@ bool AMDGPULibCalls::evaluateScalarMathFunc(FuncInfo &FInfo,
16041605
return false;
16051606
}
16061607

1607-
bool AMDGPULibCalls::evaluateCall(CallInst *aCI, FuncInfo &FInfo) {
1608+
bool AMDGPULibCalls::evaluateCall(CallInst *aCI, const FuncInfo &FInfo) {
16081609
int numArgs = (int)aCI->arg_size();
16091610
if (numArgs > 3)
16101611
return false;

0 commit comments

Comments
 (0)