[PATCH] D21775: [InstCombine] Simplify and correct folding fcmps with the same children

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 11:21:33 PDT 2016


spatel added inline comments.

================
Comment at: test/Transforms/InstCombine/and-fcmp.ll:17-18
@@ -16,4 +16,4 @@
 ; CHECK-LABEL: @t2(
-; CHECK-NEXT:    [[A:%.*]] = fcmp olt float %x, %y
-; CHECK-NEXT:    ret i1 [[A]]
+; CHECK-NEXT:    [[TMP1:%.*]] = fcmp olt float %x, %y
+; CHECK-NEXT:    ret i1 [[TMP1]]
 ;
----------------
As you noted, these renaming changes in the scripted output are caused because the script uses the variable names in the IR to create FileCheck variable names.

The reason the IR names change with your patch is because the old code would reuse existing instructions, for example:
  if (Op0CC == FCmpInst::FCMP_TRUE)
    return RHS;

...but the new code always creates a new instruction. So the old checks show that the instruction has the same variable name as the original test case, but the new checks show a new temp name (%1).

For the sake of cleanliness (and I think Eric was suggesting the same thing), can you remove these diffs? This could be done by either checking in the NFC changes before this patch or removing these hunks from this patch.



http://reviews.llvm.org/D21775





More information about the llvm-commits mailing list