[llvm] [ArgPromotion] Remove redundant logic from recursive argpromotion code (PR #98657)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 11:05:46 PDT 2024
================
@@ -640,16 +640,18 @@ static bool findArgParts(Argument *Arg, const DataLayout &DL, AAResults &AAR,
}
auto *CB = dyn_cast<CallBase>(V);
- Value *PtrArg = cast<Value>(U);
- if (CB && PtrArg && CB->getCalledFunction() == CB->getFunction()) {
+ Value *PtrArg = U->get();
+ if (CB && CB->getCalledFunction() == CB->getFunction() &&
+ CB->getCalledFunction()->getReturnType() ==
+ CB->getFunction()->getReturnType()) {
----------------
nikic wrote:
Ah sorry, I forgot that getCalledFunction already checks the function type. Ignore my comment about that.
https://github.com/llvm/llvm-project/pull/98657
More information about the llvm-commits
mailing list