Skip to content

Commit

Permalink
Remove use of stripAndAccumulateConstantOffsets
Browse files Browse the repository at this point in the history
  • Loading branch information
vedantparanjape-amd committed Jul 11, 2024
1 parent 881c4cd commit 5a053f9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,19 +642,7 @@ 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()) {
Type *PtrTy = PtrArg->getType();
APInt Offset(DL.getIndexTypeSizeInBits(PtrTy), 0);
PtrArg = PtrArg->stripAndAccumulateConstantOffsets(
DL, Offset,
/* AllowNonInbounds= */ true);
if (PtrArg != Arg)
return false;

if (Offset.getSignificantBits() >= 64)
return false;

int64_t Off = Offset.getSExtValue();
if (Off) {
if (PtrArg != Arg) {
LLVM_DEBUG(dbgs() << "ArgPromotion of " << *Arg << " failed: "
<< "pointer offset is not equal to zero\n");
return false;
Expand Down

0 comments on commit 5a053f9

Please sign in to comment.