[llvm] r253996 - use convenience function for copying IR flags; NFCI
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 24 09:16:33 PST 2015
Author: spatel
Date: Tue Nov 24 11:16:33 2015
New Revision: 253996
URL: http://llvm.org/viewvc/llvm-project?rev=253996&view=rev
Log:
use convenience function for copying IR flags; NFCI
Modified:
llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp?rev=253996&r1=253995&r2=253996&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/IndVarSimplify.cpp Tue Nov 24 11:16:33 2015
@@ -981,12 +981,7 @@ Instruction *WidenIV::cloneBitwiseIVUser
NarrowBO->getName());
IRBuilder<> Builder(NarrowUse);
Builder.Insert(WideBO);
- if (const auto *OBO = dyn_cast<OverflowingBinaryOperator>(NarrowBO)) {
- if (OBO->hasNoUnsignedWrap())
- WideBO->setHasNoUnsignedWrap();
- if (OBO->hasNoSignedWrap())
- WideBO->setHasNoSignedWrap();
- }
+ WideBO->copyIRFlags(NarrowBO);
return WideBO;
}
@@ -1078,12 +1073,7 @@ Instruction *WidenIV::cloneArithmeticIVU
IRBuilder<> Builder(NarrowUse);
Builder.Insert(WideBO);
- if (const auto *OBO = dyn_cast<OverflowingBinaryOperator>(NarrowBO)) {
- if (OBO->hasNoUnsignedWrap())
- WideBO->setHasNoUnsignedWrap();
- if (OBO->hasNoSignedWrap())
- WideBO->setHasNoSignedWrap();
- }
+ WideBO->copyIRFlags(NarrowBO);
return WideBO;
}
More information about the llvm-commits
mailing list