[llvm] a750332 - AMDGPULibCalls - constify some FuncInfo& arguments. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 22 04:11:14 PDT 2021
Author: Simon Pilgrim
Date: 2021-10-22T12:10:58+01:00
New Revision: a750332d77019c4a2071ac9aed2cb2d9226c68e9
URL: https://github.com/llvm/llvm-project/commit/a750332d77019c4a2071ac9aed2cb2d9226c68e9
DIFF: https://github.com/llvm/llvm-project/commit/a750332d77019c4a2071ac9aed2cb2d9226c68e9.diff
LOG: AMDGPULibCalls - constify some FuncInfo& arguments. NFCI.
Added:
Modified:
llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
index 8860ff538f1d..9cc24be39940 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp
@@ -86,9 +86,9 @@ class AMDGPULibCalls {
bool sincosUseNative(CallInst *aCI, const FuncInfo &FInfo);
// evaluate calls if calls' arguments are constants.
- bool evaluateScalarMathFunc(FuncInfo &FInfo, double& Res0,
+ bool evaluateScalarMathFunc(const FuncInfo &FInfo, double& Res0,
double& Res1, Constant *copr0, Constant *copr1, Constant *copr2);
- bool evaluateCall(CallInst *aCI, FuncInfo &FInfo);
+ bool evaluateCall(CallInst *aCI, const FuncInfo &FInfo);
// exp
bool fold_exp(CallInst *CI, IRBuilder<> &B, const FuncInfo &FInfo);
@@ -115,7 +115,8 @@ class AMDGPULibCalls {
bool fold_sincos(CallInst * CI, IRBuilder<> &B, AliasAnalysis * AA);
// __read_pipe/__write_pipe
- bool fold_read_write_pipe(CallInst *CI, IRBuilder<> &B, FuncInfo &FInfo);
+ bool fold_read_write_pipe(CallInst *CI, IRBuilder<> &B,
+ const FuncInfo &FInfo);
// llvm.amdgcn.wavefrontsize
bool fold_wavefrontsize(CallInst *CI, IRBuilder<> &B);
@@ -557,7 +558,7 @@ bool AMDGPULibCalls::useNative(CallInst *aCI) {
// for such cases where N is the size in bytes of the type (N = 1, 2, 4, 8, ...,
// 128). The same for __read_pipe_4, write_pipe_2, and write_pipe_4.
bool AMDGPULibCalls::fold_read_write_pipe(CallInst *CI, IRBuilder<> &B,
- FuncInfo &FInfo) {
+ const FuncInfo &FInfo) {
auto *Callee = CI->getCalledFunction();
if (!Callee->isDeclaration())
return false;
@@ -1409,7 +1410,7 @@ AllocaInst* AMDGPULibCalls::insertAlloca(CallInst *UI, IRBuilder<> &B,
return Alloc;
}
-bool AMDGPULibCalls::evaluateScalarMathFunc(FuncInfo &FInfo,
+bool AMDGPULibCalls::evaluateScalarMathFunc(const FuncInfo &FInfo,
double& Res0, double& Res1,
Constant *copr0, Constant *copr1,
Constant *copr2) {
@@ -1604,7 +1605,7 @@ bool AMDGPULibCalls::evaluateScalarMathFunc(FuncInfo &FInfo,
return false;
}
-bool AMDGPULibCalls::evaluateCall(CallInst *aCI, FuncInfo &FInfo) {
+bool AMDGPULibCalls::evaluateCall(CallInst *aCI, const FuncInfo &FInfo) {
int numArgs = (int)aCI->arg_size();
if (numArgs > 3)
return false;
More information about the llvm-commits
mailing list