[PATCH] D12343: use "unpredictable" metadata in SelectionDAG when splitting compares

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 16:10:21 PDT 2015


arsenm added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:1601-1602
@@ -1600,3 +1600,4 @@
   if (const BinaryOperator *BOp = dyn_cast<BinaryOperator>(CondVal)) {
-    if (!DAG.getTargetLoweringInfo().isJumpExpensive() &&
+    if (!I.getMetadata(LLVMContext::MD_unpredictable) &&
+        !DAG.getTargetLoweringInfo().isJumpExpensive() &&
         BOp->hasOneUse() && (BOp->getOpcode() == Instruction::And ||
----------------
arsenm wrote:
> bikeshed: Check the isJumpExpensive first
and after the hasOneUse. The metadata is the weirdest case reason to not this, so it makes sense to be the last thing checked


http://reviews.llvm.org/D12343





More information about the llvm-commits mailing list