diff options
Diffstat (limited to 'llvm/test/Bitcode')
-rw-r--r-- | llvm/test/Bitcode/DILocation-implicit-code.ll | 31 | ||||
-rw-r--r-- | llvm/test/Bitcode/drop-debug-info.3.5.ll | 4 | ||||
-rw-r--r-- | llvm/test/Bitcode/thinlto-deadstrip-flag.ll | 20 | ||||
-rw-r--r-- | llvm/test/Bitcode/thinlto-index-flags.ll | 39 | ||||
-rw-r--r-- | llvm/test/Bitcode/upgrade-branch-protection.ll | 15 | ||||
-rw-r--r-- | llvm/test/Bitcode/upgrade-tbaa.ll | 4 |
6 files changed, 62 insertions, 51 deletions
diff --git a/llvm/test/Bitcode/DILocation-implicit-code.ll b/llvm/test/Bitcode/DILocation-implicit-code.ll index 159cb8a..1090bff 100644 --- a/llvm/test/Bitcode/DILocation-implicit-code.ll +++ b/llvm/test/Bitcode/DILocation-implicit-code.ll @@ -13,7 +13,7 @@ $_ZN1A3fooEi = comdat any @_ZTIi = external dso_local constant i8* ; Function Attrs: noinline optnone uwtable -define dso_local void @_Z5test1v() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !7 { +define dso_local void @_Z5test1v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !7 { entry: %retval = alloca %struct.A, align 1 %a = alloca %struct.A, align 1 @@ -40,13 +40,13 @@ lpad: ; preds = %entry catch.dispatch: ; preds = %lpad %sel = load i32, i32* %ehselector.slot, align 4, !dbg !13 - %3 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #4, !dbg !13 + %3 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)), !dbg !13 %matches = icmp eq i32 %sel, %3, !dbg !13 br i1 %matches, label %catch, label %eh.resume, !dbg !13 catch: ; preds = %catch.dispatch %exn = load i8*, i8** %exn.slot, align 8, !dbg !13 - %4 = call i8* @__cxa_begin_catch(i8* %exn) #4, !dbg !13 + %4 = call i8* @__cxa_begin_catch(i8* %exn), !dbg !13 %5 = bitcast i8* %4 to i32*, !dbg !13 %6 = load i32, i32* %5, align 4, !dbg !13 store i32 %6, i32* %e, align 4, !dbg !13 @@ -55,7 +55,7 @@ catch: ; preds = %catch.dispatch to label %invoke.cont2 unwind label %lpad1, !dbg !15 invoke.cont2: ; preds = %catch - call void @__cxa_end_catch() #4, !dbg !16 + call void @__cxa_end_catch(), !dbg !16 br label %return lpad1: ; preds = %catch @@ -65,7 +65,7 @@ lpad1: ; preds = %catch store i8* %9, i8** %exn.slot, align 8, !dbg !12 %10 = extractvalue { i8*, i32 } %8, 1, !dbg !12 store i32 %10, i32* %ehselector.slot, align 4, !dbg !12 - call void @__cxa_end_catch() #4, !dbg !16 + call void @__cxa_end_catch(), !dbg !16 br label %eh.resume, !dbg !16 try.cont: ; No predecessors! @@ -84,7 +84,7 @@ eh.resume: ; preds = %lpad1, %catch.dispa } ; Function Attrs: noinline nounwind optnone uwtable -define linkonce_odr dso_local void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr #1 comdat align 2 !dbg !17 { +define linkonce_odr dso_local void @_ZN1AC2Ev(%struct.A* %this) unnamed_addr comdat align 2 !dbg !17 { entry: %this.addr = alloca %struct.A*, align 8 store %struct.A* %this, %struct.A** %this.addr, align 8 @@ -93,7 +93,7 @@ entry: } ; Function Attrs: noinline optnone uwtable -define linkonce_odr dso_local void @_ZN1A3fooEi(%struct.A* %this, i32 %i) #0 comdat align 2 !dbg !19 { +define linkonce_odr dso_local void @_ZN1A3fooEi(%struct.A* %this, i32 %i) comdat align 2 !dbg !19 { entry: %retval = alloca %struct.A, align 1 %this.addr = alloca %struct.A*, align 8 @@ -106,10 +106,10 @@ entry: br i1 %cmp, label %if.then, label %if.end, !dbg !20 if.then: ; preds = %entry - %exception = call i8* @__cxa_allocate_exception(i64 4) #4, !dbg !22 + %exception = call i8* @__cxa_allocate_exception(i64 4), !dbg !22 %1 = bitcast i8* %exception to i32*, !dbg !22 store i32 1, i32* %1, align 16, !dbg !22 - call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #5, !dbg !22 + call void @__cxa_throw(i8* %exception, i8* bitcast (i8** @_ZTIi to i8*), i8* null), !dbg !22 unreachable, !dbg !22 if.end: ; preds = %entry @@ -119,17 +119,17 @@ if.end: ; preds = %entry declare dso_local i32 @__gxx_personality_v0(...) ; Function Attrs: nounwind readnone -declare i32 @llvm.eh.typeid.for(i8*) #2 +declare i32 @llvm.eh.typeid.for(i8*) declare dso_local i8* @__cxa_begin_catch(i8*) declare dso_local void @__cxa_end_catch() ; Function Attrs: noreturn nounwind -declare void @llvm.trap() #3 +declare void @llvm.trap() ; Function Attrs: noinline optnone uwtable -define dso_local void @_Z5test2v() #0 !dbg !24 { +define dso_local void @_Z5test2v() !dbg !24 { entry: %a = alloca %struct.A, align 1 %b = alloca %struct.A, align 1 @@ -143,13 +143,6 @@ declare dso_local i8* @__cxa_allocate_exception(i64) declare dso_local void @__cxa_throw(i8*, i8*, i8*) -attributes #0 = { noinline optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #1 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } -attributes #2 = { nounwind readnone } -attributes #3 = { noreturn nounwind } -attributes #4 = { nounwind } -attributes #5 = { noreturn } - !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!3, !4, !5} !llvm.ident = !{!6} diff --git a/llvm/test/Bitcode/drop-debug-info.3.5.ll b/llvm/test/Bitcode/drop-debug-info.3.5.ll index 35d3958..16102a0 100644 --- a/llvm/test/Bitcode/drop-debug-info.3.5.ll +++ b/llvm/test/Bitcode/drop-debug-info.3.5.ll @@ -12,15 +12,13 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-apple-macosx10.10.0" ; Function Attrs: nounwind ssp uwtable -define i32 @main() #0 { +define i32 @main() { entry: %retval = alloca i32, align 4 store i32 0, i32* %retval ret i32 0, !dbg !12 } -attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } - !llvm.dbg.cu = !{!0} !llvm.module.flags = !{!9, !10} !llvm.ident = !{!11} diff --git a/llvm/test/Bitcode/thinlto-deadstrip-flag.ll b/llvm/test/Bitcode/thinlto-deadstrip-flag.ll deleted file mode 100644 index 00c0131..0000000 --- a/llvm/test/Bitcode/thinlto-deadstrip-flag.ll +++ /dev/null @@ -1,20 +0,0 @@ -; REQUIRES: x86-registered-target -; RUN: opt -module-summary %s -o %t.o - -; Ensure dead stripping performed flag is set on distributed index -; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \ -; RUN: -r %t.o,glob,plx -; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=WITHDEAD -; WITHDEAD: <FLAGS op0=97/> - -; Ensure dead stripping performed flag is not set on distributed index -; when option used to disable dead stripping computation. -; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \ -; RUN: -r %t.o,glob,plx -compute-dead=false -; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=NODEAD -; NODEAD: <FLAGS op0=96/> - -target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" - -@glob = global i32 0 diff --git a/llvm/test/Bitcode/thinlto-index-flags.ll b/llvm/test/Bitcode/thinlto-index-flags.ll new file mode 100644 index 0000000..e957ce6 --- /dev/null +++ b/llvm/test/Bitcode/thinlto-index-flags.ll @@ -0,0 +1,39 @@ +; REQUIRES: x86-registered-target +; RUN: opt -module-summary %s -o %t.o + +;; By default, the indexing step should perform and set the appropriate index +;; flags for dead stripping, attribute propagation, DSO local propagation, +;; and internalization/promotion. +; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \ +; RUN: -r %t.o,glob,plx +; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=ALL +;; The flag value should be 0x461 aka 1121: +;; 0x1: Dead stripping +;; 0x20: Attribute propagation +;; 0x40: DSO local propagation +;; 0x400: Internalization/promotion +; ALL: <FLAGS op0=1121/> + +;; Ensure dead stripping performed flag is not set on distributed index +;; when option used to disable dead stripping computation. +; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \ +; RUN: -r %t.o,glob,plx -compute-dead=false +; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=NODEAD +;; Flag should be 0x460 aka 1120. +; NODEAD: <FLAGS op0=1120/> + +;; Disabling attribute propagation should disable that as well as DSO local +;; propagation. +; RUN: llvm-lto2 run %t.o -o %t.out -thinlto-distributed-indexes \ +; RUN: -r %t.o,glob,plx -propagate-attrs=false +; RUN: llvm-bcanalyzer -dump %t.o.thinlto.bc | FileCheck %s --check-prefix=NOPROP +;; Flag should be 0x401 aka 1025. +; NOPROP: <FLAGS op0=1025/> + +;; Note there isn't currently a way to disable internalization+promotion, which +;; are performed together. + +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +@glob = global i32 0 diff --git a/llvm/test/Bitcode/upgrade-branch-protection.ll b/llvm/test/Bitcode/upgrade-branch-protection.ll index 1b33e39..6f60ba5 100644 --- a/llvm/test/Bitcode/upgrade-branch-protection.ll +++ b/llvm/test/Bitcode/upgrade-branch-protection.ll @@ -1,8 +1,11 @@ -;; Test that module flags "branch-target-enforcement" and "sign-return-address" can be upgraded to -;; are upgraded from Error to Min. +;; Test that module flags "branch-target-enforcement" and "sign-return-address" +;; can be upgraded to are upgraded from Error to Min and the value is changed 2 +;; as the module is converted to the semantic. ; RUN: llvm-as %s -o - | llvm-dis - | FileCheck %s +target triple = "aarch64-unknown-linux-gnu" + !llvm.module.flags = !{!0, !1, !2, !3} !0 = !{i32 1, !"branch-target-enforcement", i32 1} @@ -10,7 +13,7 @@ !2 = !{i32 1, !"sign-return-address-all", i32 1} !3 = !{i32 1, !"sign-return-address-with-bkey", i32 1} -;CHECK: !0 = !{i32 8, !"branch-target-enforcement", i32 1} -;CHECK: !1 = !{i32 8, !"sign-return-address", i32 1} -;CHECK: !2 = !{i32 8, !"sign-return-address-all", i32 1} -;CHECK: !3 = !{i32 8, !"sign-return-address-with-bkey", i32 1}
\ No newline at end of file +;CHECK: !0 = !{i32 8, !"branch-target-enforcement", i32 2} +;CHECK: !1 = !{i32 8, !"sign-return-address", i32 2} +;CHECK: !2 = !{i32 8, !"sign-return-address-all", i32 2} +;CHECK: !3 = !{i32 8, !"sign-return-address-with-bkey", i32 2} diff --git a/llvm/test/Bitcode/upgrade-tbaa.ll b/llvm/test/Bitcode/upgrade-tbaa.ll index 7a70d99..893ba69 100644 --- a/llvm/test/Bitcode/upgrade-tbaa.ll +++ b/llvm/test/Bitcode/upgrade-tbaa.ll @@ -2,7 +2,7 @@ ; RUN: verify-uselistorder < %s ; Function Attrs: nounwind -define void @_Z4testPiPf(i32* nocapture %pI, float* nocapture %pF) #0 { +define void @_Z4testPiPf(i32* nocapture %pI, float* nocapture %pF) { entry: store i32 0, i32* %pI, align 4, !tbaa !{!"int", !0} ; CHECK: store i32 0, ptr %pI, align 4, !tbaa [[TAG_INT:!.*]] @@ -11,8 +11,6 @@ entry: ret void } -attributes #0 = { nounwind "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } - !0 = !{!"omnipotent char", !1} !1 = !{!"Simple C/C++ TBAA"} !2 = !{!"float", !0} |