diff options
author | Craig Topper <craig.topper@gmail.com> | 2020-04-27 20:15:59 -0700 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2020-04-27 22:17:03 -0700 |
commit | a58b62b4a2b96c31b49338b262b609db746449e8 (patch) | |
tree | b8549e279ee3b6dd34c461038f3e9f0e19fc7f33 /llvm/lib/Transforms/Utils/CallPromotionUtils.cpp | |
parent | 756ba3548cbeef6c18866914fa935ade8b3edf1c (diff) | |
download | llvm-a58b62b4a2b96c31b49338b262b609db746449e8.zip llvm-a58b62b4a2b96c31b49338b262b609db746449e8.tar.gz llvm-a58b62b4a2b96c31b49338b262b609db746449e8.tar.bz2 |
[IR] Replace all uses of CallBase::getCalledValue() with getCalledOperand().
This method has been commented as deprecated for a while. Remove
it and replace all uses with the equivalent getCalledOperand().
I also made a few cleanups in here. For example, to removes use
of getElementType on a pointer when we could just use getFunctionType
from the call.
Differential Revision: https://reviews.llvm.org/D78882
Diffstat (limited to 'llvm/lib/Transforms/Utils/CallPromotionUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CallPromotionUtils.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp b/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp index d087717..150c355 100644 --- a/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp +++ b/llvm/lib/Transforms/Utils/CallPromotionUtils.cpp @@ -264,9 +264,9 @@ static CallBase &versionCallSite(CallBase &CB, Value *Callee, // Create the compare. The called value and callee must have the same type to // be compared. - if (CB.getCalledValue()->getType() != Callee->getType()) - Callee = Builder.CreateBitCast(Callee, CB.getCalledValue()->getType()); - auto *Cond = Builder.CreateICmpEQ(CB.getCalledValue(), Callee); + if (CB.getCalledOperand()->getType() != Callee->getType()) + Callee = Builder.CreateBitCast(Callee, CB.getCalledOperand()->getType()); + auto *Cond = Builder.CreateICmpEQ(CB.getCalledOperand(), Callee); // Create an if-then-else structure. The original instruction is moved into // the "else" block, and a clone of the original instruction is placed in the @@ -462,7 +462,7 @@ bool llvm::tryPromoteCall(CallBase &CB) { assert(!CB.getCalledFunction()); Module *M = CB.getCaller()->getParent(); const DataLayout &DL = M->getDataLayout(); - Value *Callee = CB.getCalledValue(); + Value *Callee = CB.getCalledOperand(); LoadInst *VTableEntryLoad = dyn_cast<LoadInst>(Callee); if (!VTableEntryLoad) |