+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
-; CHECK-NOT: invoke
-; CHECK-NOT: landingpad
declare void @bar()
define i32 @foo() personality ptr @__gxx_personality_v0 {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: call void @bar()
+; CHECK-NEXT: ret i32 0
+;
entry:
invoke void @bar()
- to label %return unwind label %lpad
+ to label %return unwind label %lpad
return:
ret i32 0
lpad:
%lp = landingpad { ptr, i32 }
- cleanup
+ cleanup
resume { ptr, i32 } %lp
}
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
define void @test1(i1 %C, ptr %BP) {
attributes #0 = { null_pointer_is_valid }
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
+; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
+; CHECK: attributes #[[ATTR2:[0-9]+]] = { null_pointer_is_valid }
+;.
-; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -disable-output < %s
-; END.
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
+; RUN: opt -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s -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-unknown-linux-gnu"
declare void @bar(i32)
define void @foo() personality ptr @__gxx_personality_v0 {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: call void @bar(i32 undef)
+; CHECK-NEXT: ret void
+;
entry:
- invoke void @bar(i32 undef)
- to label %r unwind label %u
+ invoke void @bar(i32 undef)
+ to label %r unwind label %u
r: ; preds = %entry
- ret void
+ ret void
u: ; preds = %entry
- %val = landingpad { ptr, i32 }
- cleanup
- resume { ptr, i32 } %val
+ %val = landingpad { ptr, i32 }
+ cleanup
+ resume { ptr, i32 } %val
}
declare i32 @__gxx_personality_v0(...)
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
;; Test case for bug 25299, contributed by David Majnemer.
target triple = "x86_64-unknown-linux-gnu"
define void @f(i1 %B) personality i1 undef {
+; CHECK-LABEL: @f(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: call void @g()
+; CHECK-NEXT: br label [[CONTINUE:%.*]]
+; CHECK: continue:
+; CHECK-NEXT: call void @g()
+; CHECK-NEXT: br label [[CONTINUE]]
+;
entry:
-;CHECK: entry
-;CHECK-NEXT: call void @g()
invoke void @g()
- to label %continue unwind label %unwind
+ to label %continue unwind label %unwind
unwind: ; preds = %entry
%tmp101 = landingpad { ptr, i32 }
- cleanup
+ cleanup
br i1 %B, label %resume, label %then
then: ; preds = %cleanup1
resume: ; preds = %cleanup2, %then, %cleanup1, %unwind
%tmp104 = phi { ptr, i32 } [ %tmp101, %then ], [ %tmp106, %cleanup2 ], [ %tmp101, %unwind ]
-;CHECK-NOT: resume { ptr, i32 } %tmp104
resume { ptr, i32 } %tmp104
continue: ; preds = %entry, %continue
-;CHECK: continue: ; preds = %entry, %continue
-;CHECK-NEXT: call void @g()
invoke void @g()
- to label %continue unwind label %cleanup2
+ to label %continue unwind label %cleanup2
cleanup2: ; preds = %continue
%tmp106 = landingpad { ptr, i32 }
- cleanup
+ cleanup
br label %resume
}
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S -hoist-common-insts=true | FileCheck %s
; ModuleID = 'cppeh-simplify.cpp'
declare void @llvm.lifetime.start.p0(i64, ptr nocapture)
declare void @llvm.lifetime.end.p0(i64, ptr nocapture)
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
+;.
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
declare void @f()
exit:
ret void
}
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nounwind }
+;.
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
declare void @bar()
; instructions to call instructions if the handler just rethrows the exception.
define i32 @test1() personality ptr @__gxx_personality_v0 {
; CHECK-LABEL: @test1(
-; CHECK-NEXT: call void @bar(), !prof !0
+; CHECK-NEXT: call void @bar(), !prof [[PROF0:![0-9]+]]
; CHECK-NEXT: ret i32 0
;
invoke void @bar( )
}
declare i32 @__gxx_personality_v0(...)
+;.
+; CHECK: [[PROF0]] = !{!"branch_weights", i32 371}
+;.
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
declare void @llvm.lifetime.start.p0(i64, ptr)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i11)
resume { ptr, i32 } %i10
}
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
+;.
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt < %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
-; CHECK-LABEL: define void @foo
define void @foo() personality ptr @__gxx_personality_v0 {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[A:%.*]] = alloca i8, align 1
+; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 1, ptr nonnull [[A]]) #[[ATTR1:[0-9]+]]
+; CHECK-NEXT: call void @bar()
+; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 1, ptr nonnull [[A]]) #[[ATTR1]]
+; CHECK-NEXT: ret void
+;
entry:
-; CHECK: alloca i8
-; CHECK: call void @llvm.lifetime.start.p0
-; CHECK: call void @bar()
-; CHECK: call void @llvm.lifetime.end.p0
-; CHECK: ret void
%a = alloca i8
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) nounwind
invoke void @bar() to label %invoke.cont unwind label %lpad
ret void
lpad:
-; CHECK-NOT: landingpad
%b = landingpad { ptr, i32 }
- cleanup
+ cleanup
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) nounwind
resume { ptr, i32 } %b
}
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) nounwind
declare i32 @__gxx_personality_v0(...)
+;.
+; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
+; CHECK: attributes #[[ATTR1]] = { nounwind }
+;.
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals
; RUN: opt -S -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 < %s | FileCheck %s
declare void @Personality()