summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2016-03-01 19:35:52 +0000
committerOwen Anderson <resistor@mac.com>2016-03-01 19:35:52 +0000
commit7ea02fc7879ccfa9aba47c0dec7d57e8fbeb3b9e (patch)
treeb70ac649bf2480bdf65e8c49174eed1bd09fae7c /llvm/lib/Transforms/InstCombine
parentb3a7935d549c1d73729a4666ec6133e80658ce34 (diff)
downloadbcm5719-llvm-7ea02fc7879ccfa9aba47c0dec7d57e8fbeb3b9e.tar.gz
bcm5719-llvm-7ea02fc7879ccfa9aba47c0dec7d57e8fbeb3b9e.zip
Fix an issue where fast math flags were dropped during scalarization.
Most portions of InstCombine properly propagate fast math flags, but apparently the vector scalarization section was overlooked. llvm-svn: 262376
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
index 258d7b5762d..d92806f08de 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
@@ -106,7 +106,8 @@ Instruction *InstCombiner::scalarizePHI(ExtractElementInst &EI, PHINode *PN) {
B0->getOperand(opId)->getName() + ".Elt"),
*B0);
Value *newPHIUser = InsertNewInstWith(
- BinaryOperator::Create(B0->getOpcode(), scalarPHI, Op), *B0);
+ BinaryOperator::CreateWithCopiedFlags(B0->getOpcode(),
+ scalarPHI, Op, B0), *B0);
scalarPHI->addIncoming(newPHIUser, inBB);
} else {
// Scalarize PHI input:
@@ -193,7 +194,8 @@ Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) {
Value *newEI1 =
Builder->CreateExtractElement(BO->getOperand(1), EI.getOperand(1),
EI.getName()+".rhs");
- return BinaryOperator::Create(BO->getOpcode(), newEI0, newEI1);
+ return BinaryOperator::CreateWithCopiedFlags(BO->getOpcode(),
+ newEI0, newEI1, BO);
}
} else if (InsertElementInst *IE = dyn_cast<InsertElementInst>(I)) {
// Extracting the inserted element?
OpenPOWER on IntegriCloud