File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -782,8 +782,8 @@ Value *ConstantOffsetExtractor::removeConstOffset(unsigned ChainIndex) {
782782
783783// / A helper function to check if reassociating through an entry in the user
784784// / chain would invalidate the GEP's nuw flag.
785- static bool allowsPreservingNUW (User *U) {
786- if (BinaryOperator *BO = dyn_cast<BinaryOperator>(U)) {
785+ static bool allowsPreservingNUW (const User *U) {
786+ if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(U)) {
787787 // Binary operations need to be effectively add nuw.
788788 auto Opcode = BO->getOpcode ();
789789 if (Opcode == BinaryOperator::Or) {
@@ -798,7 +798,7 @@ static bool allowsPreservingNUW(User *U) {
798798 // Among the possible CastInsts, only trunc without nuw is a problem: If it
799799 // is distributed through an add nuw, wrapping may occur:
800800 // "add nuw trunc(a), trunc(b)" is more poisonous than "trunc(add nuw a, b)"
801- if (TruncInst *TI = dyn_cast<TruncInst>(U))
801+ if (const TruncInst *TI = dyn_cast<TruncInst>(U))
802802 return TI->hasNoUnsignedWrap ();
803803 return isa<CastInst>(U) || isa<ConstantInt>(U);
804804}
You can’t perform that action at this time.
0 commit comments