[llvm] a95a5dc - [NFC][SimplifyCFG] Move sink-common-code.ll into X86

Roman Lebedev via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 28 04:11:16 PDT 2021


Author: Roman Lebedev
Date: 2021-04-28T14:10:25+03:00
New Revision: a95a5dc5ab991e0dc2ead269b78b83bc534543f4

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

LOG: [NFC][SimplifyCFG] Move sink-common-code.ll into X86

There are post-commit notest for e4c61d5 that suggest
the test is failing on certain bots. It looks like
the code there isn't being moved, which suggests
cost-model involvement, which suggests that we need to
hardcode the target triple.

Hopefully this helps?

Added: 
    llvm/test/Transforms/SimplifyCFG/X86/sink-common-code.ll

Modified: 
    

Removed: 
    llvm/test/Transforms/SimplifyCFG/sink-common-code.ll


################################################################################
diff  --git a/llvm/test/Transforms/SimplifyCFG/sink-common-code.ll b/llvm/test/Transforms/SimplifyCFG/X86/sink-common-code.ll
similarity index 98%
rename from llvm/test/Transforms/SimplifyCFG/sink-common-code.ll
rename to llvm/test/Transforms/SimplifyCFG/X86/sink-common-code.ll
index 45399d649e071..d771bdea52d7a 100644
--- a/llvm/test/Transforms/SimplifyCFG/sink-common-code.ll
+++ b/llvm/test/Transforms/SimplifyCFG/X86/sink-common-code.ll
@@ -2,6 +2,9 @@
 ; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -sink-common-insts -S | FileCheck %s
 ; RUN: opt < %s -passes='simplify-cfg<sink-common-insts>' -S | FileCheck %s
 
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-pc-linux-gnu"
+
 define zeroext i1 @test1(i1 zeroext %flag, i32 %blksA, i32 %blksB, i32 %nblks) {
 ; CHECK-LABEL: @test1(
 ; CHECK-NEXT:  entry:
@@ -1026,11 +1029,17 @@ if.end:
 define float @allow_intrinsic_remove_constant(i1 zeroext %flag, float %w, float %x, float %y) {
 ; CHECK-LABEL: @allow_intrinsic_remove_constant(
 ; CHECK-NEXT:  entry:
+; CHECK-NEXT:    br i1 [[FLAG:%.*]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
+; CHECK:       if.then:
 ; CHECK-NEXT:    [[DUMMY:%.*]] = fadd float [[W:%.*]], 4.000000e+00
 ; CHECK-NEXT:    [[SV1:%.*]] = call float @llvm.fma.f32(float [[DUMMY]], float 2.000000e+00, float 1.000000e+00)
+; CHECK-NEXT:    br label [[IF_END:%.*]]
+; CHECK:       if.else:
 ; CHECK-NEXT:    [[DUMMY1:%.*]] = fadd float [[W]], 8.000000e+00
 ; CHECK-NEXT:    [[SV2:%.*]] = call float @llvm.fma.f32(float 2.000000e+00, float [[DUMMY1]], float 1.000000e+00)
-; CHECK-NEXT:    [[P:%.*]] = select i1 [[FLAG:%.*]], float [[SV1]], float [[SV2]]
+; CHECK-NEXT:    br label [[IF_END]]
+; CHECK:       if.end:
+; CHECK-NEXT:    [[P:%.*]] = phi float [ [[SV1]], [[IF_THEN]] ], [ [[SV2]], [[IF_ELSE]] ]
 ; CHECK-NEXT:    ret float [[P]]
 ;
 entry:


        


More information about the llvm-commits mailing list