From f8b768cb0643fa9620f9b3782e5083f7082eb4b8 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Tue, 24 Nov 2015 17:16:33 +0000 Subject: [PATCH] use convenience function for copying IR flags; NFCI llvm-svn: 253996 --- lib/Transforms/Scalar/IndVarSimplify.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index 3dd3cfd4187..4ea92df9924 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -981,12 +981,7 @@ Instruction *WidenIV::cloneBitwiseIVUser(NarrowIVDefUse DU) { NarrowBO->getName()); IRBuilder<> Builder(NarrowUse); Builder.Insert(WideBO); - if (const auto *OBO = dyn_cast(NarrowBO)) { - if (OBO->hasNoUnsignedWrap()) - WideBO->setHasNoUnsignedWrap(); - if (OBO->hasNoSignedWrap()) - WideBO->setHasNoSignedWrap(); - } + WideBO->copyIRFlags(NarrowBO); return WideBO; } @@ -1078,12 +1073,7 @@ Instruction *WidenIV::cloneArithmeticIVUser(NarrowIVDefUse DU, IRBuilder<> Builder(NarrowUse); Builder.Insert(WideBO); - if (const auto *OBO = dyn_cast(NarrowBO)) { - if (OBO->hasNoUnsignedWrap()) - WideBO->setHasNoUnsignedWrap(); - if (OBO->hasNoSignedWrap()) - WideBO->setHasNoSignedWrap(); - } + WideBO->copyIRFlags(NarrowBO); return WideBO; }