-; This test checks to make sure that 'br X, Dest, Dest' is folded into
+; This test checks to make sure that 'br X, Dest, Dest' is folded into
; 'br Dest'
; RUN: opt < %s -simplifycfg -S | FileCheck %s
-; This test checks to make sure that 'br X, Dest, Dest' is folded into
+; This test checks to make sure that 'br X, Dest, Dest' is folded into
; 'br Dest'. This can only happen after the 'Z' block is eliminated. This is
-; due to the fact that the SimplifyCFG function does not use
+; due to the fact that the SimplifyCFG function does not use
; the ConstantFoldTerminator function.
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; RUN: not grep "^BB.tomerge" %t
; RUN: grep "^BB.nomerge" %t | count 4
-; ModuleID = '<stdin>'
+; ModuleID = '<stdin>'
declare i1 @foo()
declare i1 @bar(i32)
; not completely trivial
%cond2 = call i1 @foo( ) ; <i1> [#uses=1]
br i1 %cond2, label %Succ, label %Exit
-
+
Exit: ; preds = %Pre-Exit
ret void
}
entry:
br label %T
T:
- %C = phi i1 [false, %entry]
+ %C = phi i1 [false, %entry]
br i1 %C, label %X, label %Y
X:
ret i32 2
-; -simplifycfg is not folding blocks if there is a PHI node involved. This
+; -simplifycfg is not folding blocks if there is a PHI node involved. This
; should be fixed eventually
; RUN: opt < %s -simplifycfg -S | FileCheck %s
; Test merging of blocks that only have PHI nodes in them. This tests the case
-; where the mergedinto block doesn't have any PHI nodes, and is in fact
+; where the mergedinto block doesn't have any PHI nodes, and is in fact
; dominated by the block-to-be-eliminated
;
; RUN: opt < %s -simplifycfg -S | not grep N:
; 'if conversion'.
; RUN: opt < %s -simplifycfg -S > %t.xform
-; RUN: not grep phi %t.xform
+; RUN: not grep phi %t.xform
; RUN: grep ret %t.xform
declare void @use(i1)
; RUN: not grep select
;; The PHI node in this example should not be turned into a select, as we are
-;; not able to ifcvt the entire block. As such, converting to a select just
+;; not able to ifcvt the entire block. As such, converting to a select just
;; introduces inefficiency without saving copies.
define i32 @bar(i1 %C) {
; This case arises when two objects with empty destructors are cleaned up.
;
-; void f1() {
+; void f1() {
; S a;
; S b;
-; g();
+; g();
; }
;
; In this case, both cleanup pads can be eliminated and the invoke can be
; outside of a try-block and an object with a non-empty destructor must be
; cleaned up within the try-block.
;
-; void f2() {
+; void f2() {
; S a;
; try {
; S2 b;
; outside of a try-block and an object with an empty destructor must be cleaned
; within the try-block.
;
-; void f3() {
+; void f3() {
; S2 a;
; try {
; S b;
; This case arises when an object with an empty destructor may require cleanup
; from either inside or outside of a try-block.
;
-; void f4() {
+; void f4() {
; S a;
; g();
; try {
; CHECK: entry:
; CHECK: call void @g
; Note: The cleanuppad simplification will insert an unconditional branch here
-; but it will be eliminated, placing the following invoke in the entry BB.
+; but it will be eliminated, placing the following invoke in the entry BB.
; CHECK: invoke void @g()
; CHECK: to label %try.cont unwind label %catch.dispatch
; CHECK: catch.dispatch:
; CHECK-NOT: ehcleanup:
; CHECK-NOT: cleanuppad
; CHECK: catch.dispatch:
-; CHECK: %x = phi i32 [ 2, %invoke.cont ], [ 1, %entry ], [ %x, %catch.cont ]
+; CHECK: %x = phi i32 [ 2, %invoke.cont ], [ 1, %entry ], [ %x, %catch.cont ]
; CHECK: }
define void @f8() personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) {
entry:
; void loop(int width) {
; if(width < 1)
; return;
-; for(int i = 0; i < width - 1; ++i) {
+; for(int i = 0; i < width - 1;+i) {
; f0();
; f1();
; }
declare i64 @dummy1()
declare i64 @dummy2()
-; This testcase checks to see if simplifycfg pass can convert two invoke
+; This testcase checks to see if simplifycfg pass can convert two invoke
; instructions to call instructions if they share a common trivial unwind
; block.
define i64 @test3(i1 %cond) personality i32 (...)* @__gxx_personality_v0 {
br1:
%call1 = invoke i64 @dummy1()
to label %invoke.cont unwind label %lpad1
-
-br2:
+
+br2:
%call2 = invoke i64 @dummy2()
to label %invoke.cont unwind label %lpad2
-
+
invoke.cont:
%c = phi i64 [%call1, %br1], [%call2, %br2]
- ret i64 %c
-
-
+ ret i64 %c
+
+
lpad1:
%0 = landingpad { i8*, i32 }
cleanup
- br label %rethrow
+ br label %rethrow
rethrow:
%lp = phi { i8*, i32 } [%0, %lpad1], [%1, %lpad2]
resume { i8*, i32 } %lp
-
+
lpad2:
%1 = landingpad { i8*, i32 }
cleanup
; RUN: opt < %s -O1 -S | FileCheck %s
-; The attribute nomerge prevents the 3 bar() calls from being sunk/hoisted into
+; The attribute nomerge prevents the 3 bar() calls from being sunk/hoisted into
; one inside a function. Check that there are still 3 tail calls.
; Test case for preventing sinking
; RUN: opt %s -simplifycfg -S | FileCheck %s
; ConstantFoldTerminator function can convert SwitchInst with one case (and default) to
-; a conditional BranchInst. This test checks the converted BranchInst preserve the
+; a conditional BranchInst. This test checks the converted BranchInst preserve the
; make.implicit metadata.
declare i32 @consume(i32*)
entry:
%x.int = ptrtoint i32* %x to i64
-
+
; CHECK: br i1 %cond, label %is_null, label %default, !make.implicit !0
switch i64 %x.int, label %default [
i64 0, label %is_null
], !make.implicit !0
-
+
default:
%0 = call i32 @consume(i32* %x)
ret i32 %0
bb: ; preds = %entry
%1 = load volatile i32, i32* null
unreachable
-
+
br label %return
return: ; preds = %entry
ret void
ret void
unreachable.unwind:
cleanuppad within none []
- unreachable
+ unreachable
}
; CHECK-LABEL: define void @test2()