[PATCH] D17585: Fix failure of InstCombine to propagate fast math flags when scalarizing vector arithmetic.

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 09:49:05 PST 2016


arsenm added inline comments.

================
Comment at: lib/Transforms/InstCombine/InstCombineVectorOps.cpp:108-110
@@ -107,4 +107,5 @@
           *B0);
-      Value *newPHIUser = InsertNewInstWith(
-          BinaryOperator::Create(B0->getOpcode(), scalarPHI, Op), *B0);
+      BinaryOperator *newPHIUser = cast<BinaryOperator>(InsertNewInstWith(
+          BinaryOperator::Create(B0->getOpcode(), scalarPHI, Op), *B0));
+      newPHIUser->copyIRFlags(B0);
       scalarPHI->addIncoming(newPHIUser, inBB);
----------------
Should a BinaryOperator::CreateWithFlags be added? It already has CreateNSW etc.


Repository:
  rL LLVM

http://reviews.llvm.org/D17585





More information about the llvm-commits mailing list