[llvm] [ArgPromotion] Remove redundant logic from recursive argpromotion code (PR #98657)
Vedant Paranjape via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 12 10:17:56 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()) {
----------------
vedantparanjape-amd wrote:
I am confused, wasn't I meant to add the check to see if the function call type doesn't match the function def?
https://github.com/llvm/llvm-project/pull/98657
More information about the llvm-commits
mailing list