[PATCH] D41578: [SCEV] Do not cache S -> V if S is not equivalent of V
Sanjoy Das via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 26 13:37:05 PST 2017
sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.
lgtm!
================
Comment at: lib/Analysis/ScalarEvolution.cpp:3773
+ if (isa<OverflowingBinaryOperator>(I))
+ if (auto *BS = dyn_cast<SCEVNAryExpr>(S)) {
+ if (I->hasNoSignedWrap() && !BS->hasNoSignedWrap())
----------------
Why `BS`?
================
Comment at: lib/Analysis/ScalarEvolution.cpp:3776
+ return true;
+ if (I->hasNoUnsignedWrap() && !BS->hasNoUnsignedWrap())
+ return true;
----------------
I think you also need to check for `I` having the exact bit set.
https://reviews.llvm.org/D41578
More information about the llvm-commits
mailing list