diff options
author | Kazu Hirata <kazu@google.com> | 2022-07-23 12:29:05 -0700 |
---|---|---|
committer | Kazu Hirata <kazu@google.com> | 2022-07-23 12:29:05 -0700 |
commit | ae998555ba7a8c9488bda57320f4b093d2656e78 (patch) | |
tree | 69f35c96cf00c203504f45ce8f6aa39512436275 | |
parent | Convert for_each to range-based for loops (NFC) (diff) | |
download | llvm-project-ae998555ba7a8c9488bda57320f4b093d2656e78.tar.gz llvm-project-ae998555ba7a8c9488bda57320f4b093d2656e78.tar.bz2 llvm-project-ae998555ba7a8c9488bda57320f4b093d2656e78.zip |
[AMDGPU] Remove a redundant variable (NFC)
ArrayRef has operator[], so we don't need to access the contents via
data().
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp index 763b0f769c69..7e49a6117ebd 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPULibCalls.cpp @@ -694,7 +694,6 @@ bool AMDGPULibCalls::TDOFold(CallInst *CI, const FuncInfo &FInfo) { return false; int const sz = (int)tr.size(); - const TableEntry * const ftbl = tr.data(); Value *opr0 = CI->getArgOperand(0); if (getVecSize(FInfo) > 1) { @@ -706,8 +705,8 @@ bool AMDGPULibCalls::TDOFold(CallInst *CI, const FuncInfo &FInfo) { assert(eltval && "Non-FP arguments in math function!"); bool found = false; for (int i=0; i < sz; ++i) { - if (eltval->isExactlyValue(ftbl[i].input)) { - DVal.push_back(ftbl[i].result); + if (eltval->isExactlyValue(tr[i].input)) { + DVal.push_back(tr[i].result); found = true; break; } @@ -738,8 +737,8 @@ bool AMDGPULibCalls::TDOFold(CallInst *CI, const FuncInfo &FInfo) { // Scalar version if (ConstantFP *CF = dyn_cast<ConstantFP>(opr0)) { for (int i = 0; i < sz; ++i) { - if (CF->isExactlyValue(ftbl[i].input)) { - Value *nval = ConstantFP::get(CF->getType(), ftbl[i].result); + if (CF->isExactlyValue(tr[i].input)) { + Value *nval = ConstantFP::get(CF->getType(), tr[i].result); LLVM_DEBUG(errs() << "AMDIC: " << *CI << " ---> " << *nval << "\n"); replaceCall(nval); return true; |