File tree 1 file changed +3
-3
lines changed
llvm/lib/Transforms/Scalar
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) {
782
782
783
783
// / A helper function to check if reassociating through an entry in the user
784
784
// / 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)) {
787
787
// Binary operations need to be effectively add nuw.
788
788
auto Opcode = BO->getOpcode ();
789
789
if (Opcode == BinaryOperator::Or) {
@@ -798,7 +798,7 @@ static bool allowsPreservingNUW(User *U) {
798
798
// Among the possible CastInsts, only trunc without nuw is a problem: If it
799
799
// is distributed through an add nuw, wrapping may occur:
800
800
// "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))
802
802
return TI->hasNoUnsignedWrap ();
803
803
return isa<CastInst>(U) || isa<ConstantInt>(U);
804
804
}
You can’t perform that action at this time.
0 commit comments