[llvm] 94121c6 - [InstCombine] Regenerate phi-preserve-ir-flags.ll test checks to fix issue reported on D77354

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 8 10:14:56 PDT 2020


Author: Simon Pilgrim
Date: 2020-04-08T18:13:24+01:00
New Revision: 94121c60d622e3af682970b2af3420415e14ba63

URL: https://github.com/llvm/llvm-project/commit/94121c60d622e3af682970b2af3420415e14ba63
DIFF: https://github.com/llvm/llvm-project/commit/94121c60d622e3af682970b2af3420415e14ba63.diff

LOG: [InstCombine] Regenerate phi-preserve-ir-flags.ll test checks to fix issue reported on D77354

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll b/llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll
index 6e3ae8087cb8..77a7ce5685dd 100644
--- a/llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll
+++ b/llvm/test/Transforms/InstCombine/phi-preserve-ir-flags.ll
@@ -1,9 +1,21 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -instcombine -S -o - | FileCheck %s
 
 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
 
-; CHECK-LABEL: define float @func1(
 define float @func1(float %a, float %b, float %c, i1 %cond) {
+; CHECK-LABEL: @func1(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br i1 [[COND:%.*]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
+; CHECK:       cond.true:
+; CHECK-NEXT:    br label [[COND_END:%.*]]
+; CHECK:       cond.false:
+; CHECK-NEXT:    br label [[COND_END]]
+; CHECK:       cond.end:
+; CHECK-NEXT:    [[B_PN:%.*]] = phi float [ [[B:%.*]], [[COND_TRUE]] ], [ [[C:%.*]], [[COND_FALSE]] ]
+; CHECK-NEXT:    [[E:%.*]] = fsub fast float [[A:%.*]], [[B_PN]]
+; CHECK-NEXT:    ret float [[E]]
+;
 entry:
   br i1 %cond, label %cond.true, label %cond.false
 
@@ -16,16 +28,24 @@ cond.false:
   br label %cond.end
 
 ; The fast-math flags should always be transfered if possible.
-; CHECK-LABEL: cond.end
-; CHECK  [[PHI:%[^ ]*]] = phi float [ %b, %cond.true ], [ %c, %cond.false ]
-; CHECK  fsub fast float %a, [[PHI]]
 cond.end:
   %e = phi float [ %sub0, %cond.true ], [ %sub1, %cond.false ]
   ret float %e
 }
 
-; CHECK-LABEL: define float @func2(
 define float @func2(float %a, float %b, float %c, i1 %cond) {
+; CHECK-LABEL: @func2(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br i1 [[COND:%.*]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
+; CHECK:       cond.true:
+; CHECK-NEXT:    br label [[COND_END:%.*]]
+; CHECK:       cond.false:
+; CHECK-NEXT:    br label [[COND_END]]
+; CHECK:       cond.end:
+; CHECK-NEXT:    [[B_PN:%.*]] = phi float [ [[B:%.*]], [[COND_TRUE]] ], [ [[C:%.*]], [[COND_FALSE]] ]
+; CHECK-NEXT:    [[E:%.*]] = fsub float [[A:%.*]], [[B_PN]]
+; CHECK-NEXT:    ret float [[E]]
+;
 entry:
   br i1 %cond, label %cond.true, label %cond.false
 
@@ -38,16 +58,24 @@ cond.false:
   br label %cond.end
 
 ; The fast-math flags should always be transfered if possible.
-; CHECK-LABEL: cond.end
-; CHECK  [[PHI:%[^ ]*]] = phi float [ %b, %cond.true ], [ %c, %cond.false ]
-; CHECK  fsub float %a, [[PHI]]
 cond.end:
   %e = phi float [ %sub0, %cond.true ], [ %sub1, %cond.false ]
   ret float %e
 }
 
-; CHECK-LABEL: define float @func3(
 define float @func3(float %a, float %b, float %c, i1 %cond) {
+; CHECK-LABEL: @func3(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br i1 [[COND:%.*]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
+; CHECK:       cond.true:
+; CHECK-NEXT:    br label [[COND_END:%.*]]
+; CHECK:       cond.false:
+; CHECK-NEXT:    br label [[COND_END]]
+; CHECK:       cond.end:
+; CHECK-NEXT:    [[E_IN:%.*]] = phi float [ [[A:%.*]], [[COND_TRUE]] ], [ [[B:%.*]], [[COND_FALSE]] ]
+; CHECK-NEXT:    [[E:%.*]] = fadd fast float [[E_IN]], -2.000000e+00
+; CHECK-NEXT:    ret float [[E]]
+;
 entry:
   br i1 %cond, label %cond.true, label %cond.false
 
@@ -59,16 +87,24 @@ cond.false:
   %sub1 = fsub fast float %b, 2.0
   br label %cond.end
 
-; CHECK-LABEL: cond.end
-; CHECK  [[PHI:%[^ ]*]] = phi float [ %a, %cond.true ], [ %b, %cond.false ]
-; CHECK  fadd fast float %a, [[PHI]]
 cond.end:
   %e = phi float [ %sub0, %cond.true ], [ %sub1, %cond.false ]
   ret float %e
 }
 
-; CHECK-LABEL: define float @func4(
 define float @func4(float %a, float %b, float %c, i1 %cond) {
+; CHECK-LABEL: @func4(
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br i1 [[COND:%.*]], label [[COND_TRUE:%.*]], label [[COND_FALSE:%.*]]
+; CHECK:       cond.true:
+; CHECK-NEXT:    br label [[COND_END:%.*]]
+; CHECK:       cond.false:
+; CHECK-NEXT:    br label [[COND_END]]
+; CHECK:       cond.end:
+; CHECK-NEXT:    [[E_IN:%.*]] = phi float [ [[A:%.*]], [[COND_TRUE]] ], [ [[B:%.*]], [[COND_FALSE]] ]
+; CHECK-NEXT:    [[E:%.*]] = fadd float [[E_IN]], -2.000000e+00
+; CHECK-NEXT:    ret float [[E]]
+;
 entry:
   br i1 %cond, label %cond.true, label %cond.false
 
@@ -80,9 +116,6 @@ cond.false:
   %sub1 = fsub float %b, 2.0
   br label %cond.end
 
-; CHECK-LABEL: cond.end
-; CHECK  [[PHI:%[^ ]*]] = phi float [ %a, %cond.true ], [ %b, %cond.false ]
-; CHECK  fadd float %a, [[PHI]]
 cond.end:
   %e = phi float [ %sub0, %cond.true ], [ %sub1, %cond.false ]
   ret float %e


        


More information about the llvm-commits mailing list