mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +00:00
LoopVectorize: Preserve NSW, NUW and IsExact flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167174 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -849,8 +849,19 @@ SingleBlockLoopVectorizer::vectorizeLoop(LoopVectorizationLegality *Legal) {
|
||||
BinaryOperator *BinOp = dyn_cast<BinaryOperator>(Inst);
|
||||
Value *A = getVectorValue(Inst->getOperand(0));
|
||||
Value *B = getVectorValue(Inst->getOperand(1));
|
||||
|
||||
// Use this vector value for all users of the original instruction.
|
||||
WidenMap[Inst] = Builder.CreateBinOp(BinOp->getOpcode(), A, B);
|
||||
Value *V = Builder.CreateBinOp(BinOp->getOpcode(), A, B);
|
||||
WidenMap[Inst] = V;
|
||||
|
||||
// Update the NSW, NUW and Exact flags.
|
||||
BinaryOperator *VecOp = cast<BinaryOperator>(V);
|
||||
if (isa<OverflowingBinaryOperator>(BinOp)) {
|
||||
VecOp->setHasNoSignedWrap(BinOp->hasNoSignedWrap());
|
||||
VecOp->setHasNoUnsignedWrap(BinOp->hasNoUnsignedWrap());
|
||||
}
|
||||
if (isa<PossiblyExactOperator>(VecOp))
|
||||
VecOp->setIsExact(BinOp->isExact());
|
||||
break;
|
||||
}
|
||||
case Instruction::Select: {
|
||||
|
Reference in New Issue
Block a user