forked from OSchip/llvm-project
[SimplifyCFG] DeleteDeadBlock() already knows how to preserve DomTree
... so just ensure that we pass DomTreeUpdater it into it. Fixes DomTree preservation for a large number of tests, all of which are marked as such so that they do not regress.
This commit is contained in:
parent
c755e41c33
commit
164e0847a5
|
@ -6316,7 +6316,7 @@ bool SimplifyCFGOpt::simplifyOnce(BasicBlock *BB) {
|
|||
if ((pred_empty(BB) && BB != &BB->getParent()->getEntryBlock()) ||
|
||||
BB->getSinglePredecessor() == BB) {
|
||||
LLVM_DEBUG(dbgs() << "Removing BB: \n" << *BB);
|
||||
DeleteDeadBlock(BB);
|
||||
DeleteDeadBlock(BB, DTU);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -gvn-sink -simplifycfg -hoist-common-insts=true -simplifycfg-sink-common=false -S | FileCheck %s
|
||||
; RUN: opt < %s -gvn-sink -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -simplifycfg-sink-common=false -S | FileCheck %s
|
||||
|
||||
declare i8 @ext(i1)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -gvn-sink -simplifycfg -hoist-common-insts=true -simplifycfg-sink-common=false -S | FileCheck %s
|
||||
; RUN: opt < %s -gvn-sink -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -simplifycfg-sink-common=false -S | FileCheck %s
|
||||
|
||||
define zeroext i1 @test1(i1 zeroext %flag, i32 %blksA, i32 %blksB, i32 %nblks) {
|
||||
entry:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -indvars -loop-deletion -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -indvars -loop-deletion -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; Testcase distilled from 256.bzip2
|
||||
define i32 @test1() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -indvars -loop-deletion -simplifycfg | opt -analyze -loops -enable-new-pm=0 | FileCheck %s
|
||||
; RUN: opt < %s -indvars -loop-deletion -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | opt -analyze -loops -enable-new-pm=0 | FileCheck %s
|
||||
; PR1179
|
||||
|
||||
; CHECK-NOT: Loop Containing
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -jump-threading -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
|
||||
; RUN: opt -jump-threading -simplifycfg -S < %s | FileCheck %s
|
||||
declare void @ham()
|
||||
|
||||
define void @hoge() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -S -indvars -loop-deletion -simplifycfg | FileCheck %s
|
||||
; RUN: opt < %s -S -indvars -loop-deletion -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
|
||||
; PR5794
|
||||
|
||||
; Indvars and loop deletion should be able to eliminate all looping
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -S -force-vector-width=2 -force-vector-interleave=1 -loop-vectorize -verify-loop-info -simplifycfg < %s | FileCheck %s
|
||||
; RUN: opt -S -force-vector-width=2 -force-vector-interleave=1 -loop-vectorize -verify-loop-info -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
|
||||
; RUN: opt -S -force-vector-width=1 -force-vector-interleave=2 -loop-vectorize -verify-loop-info < %s | FileCheck %s --check-prefix=UNROLL-NO-VF
|
||||
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
|
@ -192,7 +192,7 @@ if.then: ; preds = %check, %for.body
|
|||
br label %if.end
|
||||
|
||||
if.end: ; preds = %if.then, %check
|
||||
%ysd.0 = phi i32 [ %rsd, %if.then ], [ %psd, %check ]
|
||||
%ysd.0 = phi i32 [ %rsd, %if.then ], [ %psd, %check ]
|
||||
store i32 %ysd.0, i32* %isd, align 4
|
||||
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
|
||||
%exitcond = icmp eq i64 %indvars.iv.next, 128
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -simplifycfg -S < %s | FileCheck %s --check-prefix=SIMPLIFYCFG
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s --check-prefix=SIMPLIFYCFG
|
||||
; RUN: opt -instcombine -S < %s | FileCheck %s --check-prefix=INSTCOMBINEONLY
|
||||
; RUN: opt -instcombine -simplifycfg -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGONLY
|
||||
; RUN: opt -instcombine -simplifycfg -instcombine -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGINSTCOMBINE
|
||||
; RUN: opt -instcombine -simplifycfg -phi-node-folding-threshold=3 -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGONLY
|
||||
; RUN: opt -instcombine -simplifycfg -instcombine -phi-node-folding-threshold=3 -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGINSTCOMBINE
|
||||
; RUN: opt -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGONLY
|
||||
; RUN: opt -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instcombine -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGINSTCOMBINE
|
||||
; RUN: opt -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -phi-node-folding-threshold=3 -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGONLY
|
||||
; RUN: opt -instcombine -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -instcombine -phi-node-folding-threshold=3 -S < %s | FileCheck %s --check-prefix=INSTCOMBINESIMPLIFYCFGINSTCOMBINE
|
||||
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -disable-output
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output
|
||||
; PR584
|
||||
@g_38098584 = external global i32 ; <i32*> [#uses=1]
|
||||
@g_60187400 = external global i32 ; <i32*> [#uses=1]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg | llvm-dis
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | llvm-dis
|
||||
; END.
|
||||
|
||||
; ModuleID = '2006-12-08-Ptr-ICmp-Branch.ll'
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg | llvm-dis
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | llvm-dis
|
||||
define i32 @test() {
|
||||
entry:
|
||||
br label %T
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S -hoist-common-insts=true | not grep icmp
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -hoist-common-insts=true | not grep icmp
|
||||
; ModuleID = '/tmp/x.bc'
|
||||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
|
||||
target triple = "i686-pc-linux-gnu"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -disable-output
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output
|
||||
; PR3016
|
||||
; Dead use caused invariant violation.
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -mtriple=thumbv8m.main %s -simplifycfg -S | FileCheck %s --check-prefix=CHECK --check-prefix=THUMB
|
||||
; RUN: opt -mtriple=thumbv8a %s -simplifycfg -S | FileCheck %s --check-prefix=CHECK --check-prefix=THUMB
|
||||
; RUN: opt -mtriple=armv8a %s -simplifycfg -S | FileCheck %s --check-prefix=CHECK --check-prefix=ARM
|
||||
; RUN: opt -mtriple=thumbv8m.main %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s --check-prefix=CHECK --check-prefix=THUMB
|
||||
; RUN: opt -mtriple=thumbv8a %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s --check-prefix=CHECK --check-prefix=THUMB
|
||||
; RUN: opt -mtriple=armv8a %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s --check-prefix=CHECK --check-prefix=ARM
|
||||
|
||||
define i32 @foo(i32 %a, i32 %b, i32 %c, i32 %d, i32* %input) {
|
||||
; CHECK-LABEL: @foo(
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -mtriple=thumbv8m.main < %s -simplifycfg -S -two-entry-phi-node-folding-threshold=4 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-4,CHECK-V8M-TWO-FOLD-4
|
||||
; RUN: opt -mtriple=armv8a < %s -simplifycfg -S -two-entry-phi-node-folding-threshold=4 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-4,CHECK-V8A-TWO-FOLD-4
|
||||
; RUN: opt -mtriple=thumbv8m.main < %s -simplifycfg -S -two-entry-phi-node-folding-threshold=5 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-5,CHECK-V8M-TWO-FOLD-5
|
||||
; RUN: opt -mtriple=armv8a < %s -simplifycfg -S -two-entry-phi-node-folding-threshold=5 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-5,CHECK-V8A-TWO-FOLD-5
|
||||
; RUN: opt -mtriple=thumbv8m.main < %s -simplifycfg -S -two-entry-phi-node-folding-threshold=6 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-6,CHECK-V8M-TWO-FOLD-6
|
||||
; RUN: opt -mtriple=armv8a < %s -simplifycfg -S -two-entry-phi-node-folding-threshold=6 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-6,CHECK-V8A-TWO-FOLD-6
|
||||
; RUN: opt -mtriple=thumbv8m.main < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -two-entry-phi-node-folding-threshold=4 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-4,CHECK-V8M-TWO-FOLD-4
|
||||
; RUN: opt -mtriple=armv8a < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -two-entry-phi-node-folding-threshold=4 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-4,CHECK-V8A-TWO-FOLD-4
|
||||
; RUN: opt -mtriple=thumbv8m.main < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -two-entry-phi-node-folding-threshold=5 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-5,CHECK-V8M-TWO-FOLD-5
|
||||
; RUN: opt -mtriple=armv8a < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -two-entry-phi-node-folding-threshold=5 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-5,CHECK-V8A-TWO-FOLD-5
|
||||
; RUN: opt -mtriple=thumbv8m.main < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -two-entry-phi-node-folding-threshold=6 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-6,CHECK-V8M-TWO-FOLD-6
|
||||
; RUN: opt -mtriple=armv8a < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -two-entry-phi-node-folding-threshold=6 | FileCheck %s --check-prefixes=CHECK-TWO-FOLD-6,CHECK-V8A-TWO-FOLD-6
|
||||
|
||||
define i32 @test_i32(i1 %a, i1 %b, i32 %i, i32 %j, i32 %k) {
|
||||
; CHECK-TWO-FOLD-4-LABEL: @test_i32(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
;RUN: opt -S -simplifycfg -mtriple=arm < %s | FileCheck %s
|
||||
;RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=arm < %s | FileCheck %s
|
||||
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
|
||||
|
||||
define arm_aapcscc i32 @select_trunc_i64(i32 %a, i32 %b) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -S -simplifycfg -mtriple=thumbv8.1m.main -mattr=+mve < %s | FileCheck %s --check-prefix=CHECK-MVE
|
||||
; RUN: opt -S -simplifycfg -mtriple=thumbv8m.main < %s | FileCheck %s --check-prefix=CHECK-V8M-MAIN
|
||||
; RUN: opt -S -simplifycfg -mtriple=thumbv8m.base < %s | FileCheck %s --check-prefix=CHECK-V8M-BASE
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=thumbv8.1m.main -mattr=+mve < %s | FileCheck %s --check-prefix=CHECK-MVE
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=thumbv8m.main < %s | FileCheck %s --check-prefix=CHECK-V8M-MAIN
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=thumbv8m.base < %s | FileCheck %s --check-prefix=CHECK-V8M-BASE
|
||||
|
||||
declare float @llvm.sqrt.f32(float) nounwind readonly
|
||||
declare float @llvm.fma.f32(float, float, float) nounwind readonly
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | \
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | \
|
||||
; RUN: not grep "br label"
|
||||
|
||||
define void @test(i1 %C) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
@G = extern_weak global i32
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | \
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | \
|
||||
; RUN: not grep "icmp eq"
|
||||
|
||||
; Check that simplifycfg deletes a dead 'seteq' instruction when it
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -passes=simplifycfg -hoist-common-insts=true -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s
|
||||
|
||||
define void @foo(i1 %C, i32* %P) {
|
||||
; CHECK-LABEL: @foo(
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
define void @f() {
|
||||
entry:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -simplifycfg -disable-output < %s
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output < %s
|
||||
|
||||
@foo = external constant i32
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
; NOTE: Assertions have been autogenerated by update_test_checks.py
|
||||
; Test merging of blocks that only have PHI nodes in them
|
||||
;
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
;
|
||||
|
||||
define i32 @test(i1 %a, i1 %b) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; Use a select to make this a single BB.
|
||||
; Also, make sure the profile metadata is propagated to the select (PR26636).
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
;RUN: opt -S -simplifycfg -mtriple=riscv32 < %s | FileCheck %s
|
||||
;RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=riscv32 < %s | FileCheck %s
|
||||
|
||||
; Test case taken from test/Transforms/SimplifyCFG/ARM/select-trunc-i64.ll.
|
||||
; A correct implementation of isTruncateFree allows this test case to be
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
; a PHI node and a return. Make sure the simplify cfg can straighten out this
|
||||
; important case. This is basically the most trivial form of tail-duplication.
|
||||
|
||||
; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | \
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | \
|
||||
; RUN: not grep "br label"
|
||||
|
||||
define i32 @test(i1 %B, i32 %A, i32 %B.upgrd.1) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -simplifycfg -switch-to-lookup -S %s | FileCheck %s
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-to-lookup -S %s | FileCheck %s
|
||||
; RUN: opt -passes='simplify-cfg<switch-to-lookup>' -S %s | FileCheck %s
|
||||
; rdar://15268442
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -S -simplifycfg < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
|
||||
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -phi-node-folding-threshold=2 -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -phi-node-folding-threshold=2 -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-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -S -simplifycfg -hoist-common-insts=true | FileCheck %s
|
||||
; RUN: opt < %s -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true | FileCheck %s
|
||||
|
||||
; SimplifyCFG can hoist any common code in the 'then' and 'else' blocks to
|
||||
; the 'if' basic block.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; This is the naive implementation of x86 BZHI/BEXTR instruction:
|
||||
; it takes input and bit count, and extracts low nbits up to bit width.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -S -simplifycfg -mtriple=x86_64-unknown-unknown -mattr=+bmi < %s | FileCheck %s --check-prefix=ALL --check-prefix=BMI
|
||||
; RUN: opt -S -simplifycfg -mtriple=x86_64-unknown-unknown -mattr=+lzcnt < %s | FileCheck %s --check-prefix=ALL --check-prefix=LZCNT
|
||||
; RUN: opt -S -simplifycfg -mtriple=x86_64-unknown-unknown < %s | FileCheck %s --check-prefix=ALL --check-prefix=GENERIC
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=x86_64-unknown-unknown -mattr=+bmi < %s | FileCheck %s --check-prefix=ALL --check-prefix=BMI
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=x86_64-unknown-unknown -mattr=+lzcnt < %s | FileCheck %s --check-prefix=ALL --check-prefix=LZCNT
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -mtriple=x86_64-unknown-unknown < %s | FileCheck %s --check-prefix=ALL --check-prefix=GENERIC
|
||||
|
||||
|
||||
define i64 @test1(i64 %A) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -S -simplifycfg -switch-to-lookup < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-to-lookup < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
|
||||
; RUN: opt -S -passes='simplify-cfg<switch-to-lookup>' < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
|
||||
|
||||
; rdar://17887153
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -S -simplifycfg -switch-to-lookup < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-to-lookup < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
|
||||
; RUN: opt -S -passes='simplify-cfg<switch-to-lookup>' < %s -mtriple=x86_64-apple-darwin12.0.0 | FileCheck %s
|
||||
|
||||
; rdar://17735071
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -simplifycfg -S %s | FileCheck --match-full-lines %s
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S %s | FileCheck --match-full-lines %s
|
||||
|
||||
; The branch in %cont has !annotation metadata. Make sure generated AND
|
||||
; has !annotation metadata.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
; Test CFG simplify removal of branch instructions.
|
||||
;
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
; RUN: opt < %s -passes=simplify-cfg -S | FileCheck %s
|
||||
|
||||
define void @test1() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -S -simplifycfg | FileCheck %s
|
||||
; RUN: opt < %s -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
|
||||
|
||||
; In 'simplifycfg', during the flattening of a 'br', the instructions for the
|
||||
; 'true' and 'false' parts, are moved out from their respective basic blocks.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -simplifycfg -S < %s | FileCheck %s
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
|
||||
|
||||
%0 = type { i32*, i32* }
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
; RUN: opt %s -simplifycfg -S | FileCheck %s --check-prefix=NORMAL
|
||||
; RUN: opt %s -simplifycfg -S -bonus-inst-threshold=2 | FileCheck %s --check-prefix=AGGRESSIVE
|
||||
; RUN: opt %s -simplifycfg -S -bonus-inst-threshold=4 | FileCheck %s --check-prefix=WAYAGGRESSIVE
|
||||
; RUN: opt %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s --check-prefix=NORMAL
|
||||
; RUN: opt %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -bonus-inst-threshold=2 | FileCheck %s --check-prefix=AGGRESSIVE
|
||||
; RUN: opt %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -bonus-inst-threshold=4 | FileCheck %s --check-prefix=WAYAGGRESSIVE
|
||||
; RUN: opt %s -passes=simplify-cfg -S | FileCheck %s --check-prefix=NORMAL
|
||||
; RUN: opt %s -passes='simplify-cfg<bonus-inst-threshold=2>' -S | FileCheck %s --check-prefix=AGGRESSIVE
|
||||
; RUN: opt %s -passes='simplify-cfg<bonus-inst-threshold=4>' -S | FileCheck %s --check-prefix=WAYAGGRESSIVE
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
define float @clamp(float %a, float %b, float %c) {
|
||||
; CHECK-LABEL: @clamp
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
;CHECK: @foo
|
||||
;CHECK: and i32 %c1, %k
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -S -simplifycfg < %s | FileCheck %s --match-full-lines
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s --match-full-lines
|
||||
|
||||
; Make sure we reset the debug location when folding instructions.
|
||||
; CHECK: [[VAL:%.*]] = and i32 %c2, %k
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S -hoist-common-insts=true | not grep br
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -hoist-common-insts=true | not grep br
|
||||
|
||||
declare void @bar(i32)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -simplifycfg -hoist-common-insts=true -S < %s | FileCheck %s
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S < %s | FileCheck %s
|
||||
; Verify that we don't crash due an invalid !dbg location on the hoisted llvm.dbg.value
|
||||
|
||||
define i64 @caller(i64* %ptr, i64 %flag) !dbg !10 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -hoist-common-insts=true -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true -S | FileCheck %s
|
||||
|
||||
define void @foo(i1 %c, i8* %p) {
|
||||
; CHECK: if:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -sink-common-insts -S | FileCheck %s
|
||||
; 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
|
||||
|
||||
define i1 @test1(i1 zeroext %flag, i8* %y) #0 {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
; RUN: opt < %s -passes=simplifycfg -S | FileCheck %s
|
||||
|
||||
define i32 @foo(i32 %x) optforfuzzing {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -S -simplifycfg -hoist-common-insts=true < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -hoist-common-insts=true < %s | FileCheck %s
|
||||
|
||||
declare void @personality()
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -simplifycfg -S -o - < %s | FileCheck %s
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -o - < %s | FileCheck %s
|
||||
|
||||
declare void @helper(i32)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -switch-to-lookup -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -switch-to-lookup -S | FileCheck %s
|
||||
; RUN: opt < %s -passes='simplify-cfg<switch-to-lookup>' -S | FileCheck %s
|
||||
|
||||
target datalayout = "e-n32"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; Reduced from arm_abs_q31() from CMSIS DSP suite.
|
||||
; https://reviews.llvm.org/D65148#1629010
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; This looks like a normal sign extension, but it's not.
|
||||
; This comes up in JPEG decoding. This check is really unpredictable,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -S -simplifycfg < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -speculate-one-expensive-inst=false < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -speculate-one-expensive-inst=false < %s | FileCheck %s
|
||||
|
||||
declare float @llvm.sqrt.f32(float) nounwind readonly
|
||||
declare float @llvm.fma.f32(float, float, float) nounwind readonly
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -simplifycfg -S < %s | FileCheck %s
|
||||
; RUN: opt -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S < %s | FileCheck %s
|
||||
|
||||
; This load is safe to speculate, as it's from a safe offset
|
||||
; within an alloca.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt -S -simplifycfg < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
|
||||
|
||||
define i32 @test1(i32 %x) nounwind {
|
||||
; CHECK-LABEL: @test1(
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck -enable-var-scope %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck -enable-var-scope %s
|
||||
|
||||
; Test basic folding to a conditional branch.
|
||||
define i32 @foo(i64 %x, i64 %y) nounwind {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -disable-output
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output
|
||||
|
||||
define void @NewExtractNames() {
|
||||
entry:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt -S -simplifycfg < %s | FileCheck %s
|
||||
; RUN: opt -S -simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
|
||||
|
||||
define zeroext i1 @test1(i32 %x) nounwind readnone ssp noredzone {
|
||||
entry:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; int foo1_with_default(int a) {
|
||||
; switch(a) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; Test that a switch going to a switch on the same value can be merged.
|
||||
; All three switches in this example can be merged into one big one.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
|
||||
; Test that we can thread a simple known condition through switch statements.
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -simplifycfg -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -phi-node-folding-threshold=2 -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -phi-node-folding-threshold=3 -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -phi-node-folding-threshold=2 -S | FileCheck %s
|
||||
; RUN: opt < %s -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -phi-node-folding-threshold=3 -S | FileCheck %s
|
||||
|
||||
; This is checking that the multiplication does overflow, with a leftover
|
||||
; guard against division-by-zero that was needed before InstCombine
|
||||
|
|
Loading…
Reference in New Issue