mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 01:11:44 +00:00
use convenience function for copying IR flags; NFCI
llvm-svn: 253996
This commit is contained in:
parent
57937fbcb6
commit
f8b768cb06
@ -981,12 +981,7 @@ Instruction *WidenIV::cloneBitwiseIVUser(NarrowIVDefUse DU) {
|
||||
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::cloneArithmeticIVUser(NarrowIVDefUse DU,
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user