[llvm] AlignmentFromAssumptions should not track the load result users (PR #73370)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 29 11:15:56 PST 2023
================
@@ -226,6 +223,8 @@ bool AlignmentFromAssumptionsPass::processAssumption(CallInst *ACall,
LI->setAlignment(NewAlignment);
++NumLoadAlignChanged;
}
+ // The user of a Load uses data - not a pointer!
+ AddUsers = false;
----------------
alex-t wrote:
BTW everything except GEPs makes no sense since the code of the getNewAlignment function calls
`const SCEV *DiffSCEV = SE->getMinusSCEV(PtrSCEV, AASCEV);`
which in order uses the `getPointerBase(LHS) != getPointerBase(RHS)` to compare the pointer bases.
The getBasePointer function only tracks down through the ADD operation, not PHI or "select" or "bitcast"
https://github.com/llvm/llvm-project/pull/73370
More information about the llvm-commits
mailing list