[PATCH] D12096: [InstCombineAddSub opportunities]: More opportunities to factorize FAdd/FSub when unsafeAlgebra is present for Inst

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 20 14:19:55 PDT 2015


majnemer added a comment.

Please format your change with clang-format.


================
Comment at: lib/Transforms/InstCombine/InstCombineAddSub.cpp:596-597
@@ +595,4 @@
+        Flags &= I->getFastMathFlags();
+        Instruction *NewI = dyn_cast<Instruction>(NewV);
+        assert(NewI && "We are expecting to have an instruction here ?? ");
+        NewI->setFastMathFlags(Flags);
----------------
Just use `cast<Instruction>`, it will assert for you.


http://reviews.llvm.org/D12096





More information about the llvm-commits mailing list