diff options
Diffstat (limited to 'llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll')
| -rw-r--r-- | llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll | 92 |
1 files changed, 89 insertions, 3 deletions
diff --git a/llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll b/llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll index 45fea64bbf75..e52dda708161 100644 --- a/llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll @@ -6,6 +6,16 @@ ; RUN: opt -module-summary %s -o %t.bc ; RUN: llvm-bcanalyzer -dump %t.bc | FileCheck %s -check-prefixes=BC +; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-paramaccess.ll -o %t2.bc + +; RUN: llvm-lto -thinlto -o %t %t.bc %t2.bc + +; RUN: llvm-dis -o - %t.thinlto.bc | FileCheck %s --check-prefix=DCO +; Round trip it through llvm-as +; RUN: llvm-dis -o - %t.thinlto.bc | llvm-as -o - | llvm-dis -o - | FileCheck %s --check-prefix=DCO + +; RUN: llvm-bcanalyzer -dump %t.thinlto.bc | FileCheck %s --check-prefix=COMBINED + ; RUN: llvm-dis -o - %t.bc | FileCheck %s --check-prefix=DIS ; Round trip it through llvm-as ; RUN: llvm-dis -o - %t.bc | llvm-as -o - | llvm-dis -o - | FileCheck %s --check-prefix=DIS @@ -18,6 +28,9 @@ ; RUN: llvm-dis -o - %t.bc | llvm-as -o - | llvm-dis -o - | FileCheck %s --check-prefix=DIS ; DIS: ^0 = module: (path: "{{.*}}", hash: ({{.*}})) +; DCO: ^0 = module: (path: "{{.*}}", hash: ({{.*}})) +; DCO: ^1 = module: (path: "{{.*}}", hash: ({{.*}})) + ; ModuleID = 'thinlto-function-summary-paramaccess.ll' target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" target triple = "aarch64-unknown-linux" @@ -29,13 +42,16 @@ attributes #0 = { noinline sanitize_memtag "target-features"="+mte,+neon" } ; BC-NEXT: <FLAGS ; DIS-DAG: = gv: (name: "Callee") ; guid = 900789920918863816 -declare void @Callee(i8* %p) +; DCO-DAG: = gv: (guid: 900789920918863816, summaries: (function: (module: ^1, flags: ({{[^()]+}}), insts: 1, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [0, -1]))))){{$}} + declare void @Callee(i8* %p) ; DIS-DAG: = gv: (name: "Callee2") ; guid = 72710208629861106 -declare void @Callee2(i32 %x, i8* %p) +; DCO-DAG: = gv: (guid: 72710208629861106, summaries: (function: (module: ^1, flags: ({{[^()]+}}), insts: 1, funcFlags: ({{[^()]+}}), params: ((param: 1, offset: [0, -1]))))){{$}} + declare void @Callee2(i32 %x, i8* %p) -; BC-NEXT: <PERMODULE +; BC: <PERMODULE ; DIS-DAG: = gv: (name: "NoParam", summaries: {{.*}} guid = 10287433468618421703 +; DCO-DAG: = gv: (guid: 10287433468618421703, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 1, funcFlags: ({{[^()]+}})))){{$}} define void @NoParam() #0 { entry: ret void @@ -44,6 +60,7 @@ entry: ; SSI-LABEL: function 'IntParam' ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "IntParam", summaries: {{.*}} guid = 13164714711077064397 +; DCO-DAG: = gv: (guid: 13164714711077064397, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 1, funcFlags: ({{[^()]+}})))){{$}} define void @IntParam(i32 %x) #0 { entry: ret void @@ -54,6 +71,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=0/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "WriteNone", summaries: {{.*}} params: ((param: 0, offset: [0, -1]))))) ; guid = 15261848357689602442 +; DCO-DAG: = gv: (guid: 15261848357689602442, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 1, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [0, -1]))))){{$}} define void @WriteNone(i8* %p) #0 { entry: ret void @@ -64,6 +82,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=2 op3=0/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "Write0", summaries: {{.*}} params: ((param: 0, offset: [0, 0]))))) ; guid = 5540766144860458461 +; DCO-DAG: = gv: (guid: 5540766144860458461, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 2, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [0, 0]))))){{$}} define void @Write0(i8* %p) #0 { entry: store i8 0, i8* %p @@ -75,6 +94,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=24 op2=32 op3=0/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "WriteOffset", summaries: {{.*}} params: ((param: 0, offset: [12, 15]))))) ; guid = 1417835201204712148 +; DCO-DAG: = gv: (guid: 1417835201204712148, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 4, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [12, 15]))))){{$}} define void @WriteOffset(i8* %p) #0 { entry: %0 = bitcast i8* %p to i32* @@ -88,6 +108,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=113 op2=97 op3=0/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "WriteNegOffset", summaries: {{.*}} params: ((param: 0, offset: [-56, -49]))))) ; guid = 11847411556962310546 +; DCO-DAG: = gv: (guid: 11847411556962310546, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 4, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [-56, -49]))))){{$}} define void @WriteNegOffset(i8* %p) #0 { entry: %0 = bitcast i8* %p to i64* @@ -101,6 +122,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=1 op2=-2 op3=0/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "WriteAnyOffset", summaries: {{.*}} params: ((param: 0, offset: [-9223372036854775808, 9223372036854775806]))))) ; guid = 16159595372881907190 +; DCO-DAG: = gv: (guid: 16159595372881907190, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 4, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [-9223372036854775808, 9223372036854775806]))))){{$}} define void @WriteAnyOffset(i8* %p, i64 %i) #0 { entry: %0 = bitcast i8* %p to i24* @@ -115,6 +137,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=2 op3=0 op4=1 op5=0 op6=8 op7=0/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "WritePQ", summaries: {{.*}} params: ((param: 0, offset: [0, 0]), (param: 1, offset: [0, 3]))))) ; guid = 6187077497926519485 +; DCO-DAG: = gv: (guid: 6187077497926519485, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 3, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [0, 0]), (param: 1, offset: [0, 3]))))){{$}} define void @WritePQ(i8* %p, i32* %q) #0 { entry: store i8 5, i8* %p @@ -128,6 +151,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=2 op3=0 op4=2 op5=0 op6=8 op7=0/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "WriteTwoPIQ", summaries: {{.*}} params: ((param: 0, offset: [0, 0]), (param: 2, offset: [0, 3]))))) ; guid = 2949024673554120799 +; DCO-DAG: = gv: (guid: 2949024673554120799, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 3, funcFlags: ({{[^()]+}}), params: ((param: 0, offset: [0, 0]), (param: 2, offset: [0, 3]))))){{$}} define void @WriteTwoPIQ(i8* %p, i32 %i, i32* %q) #0 { entry: store i8 7, i8* %p @@ -140,6 +164,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=1 op4=0 op5=[[CALLEE:-?[0-9]+]] op6=0 op7=2/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "Call", summaries: {{.*}} calls: ((callee: ^{{.*}})), params: ((param: 0, offset: [0, -1], calls: ((callee: ^{{.*}}, param: 0, offset: [0, 0]))))))) ; guid = 8411925997558855107 +; DCO-DAG: = gv: (guid: 8411925997558855107, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 2, funcFlags: ({{[^()]+}}), calls: ((callee: ^[[CALLEE:.]])), params: ((param: 0, offset: [0, -1], calls: ((callee: ^[[CALLEE]], param: 0, offset: [0, 0]))))))){{$}} define void @Call(i8* %p) #0 { entry: call void @Callee(i8* %p) @@ -151,6 +176,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=1 op4=0 op5=[[CALLEE]] op6=4 op7=6/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "CallOffset", summaries: {{.*}} calls: ((callee: ^{{.*}})), params: ((param: 0, offset: [0, -1], calls: ((callee: ^{{.*}}, param: 0, offset: [2, 2]))))))) ; guid = 1075564720951610524 +; DCO-DAG: = gv: (guid: 1075564720951610524, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 3, funcFlags: ({{[^()]+}}), calls: ((callee: ^[[CALLEE:.]])), params: ((param: 0, offset: [0, -1], calls: ((callee: ^[[CALLEE]], param: 0, offset: [2, 2]))))))){{$}} define void @CallOffset(i8* %p) #0 { entry: %p1 = getelementptr i8, i8* %p, i64 2 @@ -163,6 +189,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=1 op4=0 op5=[[CALLEE]] op6=1431 op7=1429/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "CallNegOffset", summaries: {{.*}} calls: ((callee: ^{{.*}})), params: ((param: 0, offset: [0, -1], calls: ((callee: ^{{.*}}, param: 0, offset: [-715, -715]))))))) ; guid = 16532891468562335146 +; DCO-DAG: = gv: (guid: 16532891468562335146, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 3, funcFlags: ({{[^()]+}}), calls: ((callee: ^[[CALLEE:.]])), params: ((param: 0, offset: [0, -1], calls: ((callee: ^[[CALLEE]], param: 0, offset: [-715, -715]))))))){{$}} define void @CallNegOffset(i8* %p) #0 { entry: %p1 = getelementptr i8, i8* %p, i64 -715 @@ -174,6 +201,7 @@ entry: ; SSI-LABEL: for function 'CallAnyOffset' ; SSI: p[]: empty-set, @Callee(arg0, full-set) ; DIS-DAG: = gv: (name: "CallAnyOffset", summaries: {{.*}} calls: ((callee: ^{{.*}}))))) ; guid = 4179978066780831873 +; DCO-DAG: = gv: (guid: 4179978066780831873, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 3, funcFlags: ({{[^()]+}}), calls: ((callee: ^[[CALLEE:.]]))))){{$}} define void @CallAnyOffset(i8* %p, i64 %i) #0 { entry: %p1 = getelementptr i8, i8* %p, i64 %i @@ -186,6 +214,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=3 op4=0 op5=[[CALLEE]] op6=1431 op7=1429 op8=0 op9=[[CALLEE]] op10=67 op11=65 op12=0 op13=[[CALLEE]] op14=248 op15=250/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "CallMany", summaries: {{.*}} calls: ((callee: ^{{.*}})), params: ((param: 0, offset: [0, -1], calls: ((callee: ^{{.*}}, param: 0, offset: [-715, -715]), (callee: ^{{.*}}, param: 0, offset: [-33, -33]), (callee: ^{{.*}}, param: 0, offset: [124, 124]))))))) ; guid = 17150418543861409076 +; DCO-DAG: = gv: (guid: 17150418543861409076, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 7, funcFlags: ({{[^()]+}}), calls: ((callee: ^[[CALLEE:.]])), params: ((param: 0, offset: [0, -1], calls: ((callee: ^[[CALLEE]], param: 0, offset: [-715, -715]), (callee: ^[[CALLEE]], param: 0, offset: [-33, -33]), (callee: ^[[CALLEE]], param: 0, offset: [124, 124]))))))){{$}} define void @CallMany(i8* %p) #0 { entry: %p0 = getelementptr i8, i8* %p, i64 -715 @@ -205,6 +234,7 @@ entry: ; BC-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=3 op4=0 op5=[[CALLEE]] op6=1431 op7=1429 op8=1 op9=[[CALLEE2:-?[0-9]+]] op10=67 op11=65 op12=0 op13=[[CALLEE]] op14=248 op15=250/> ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "CallMany2", summaries: {{.*}} calls: ((callee: ^{{.*}}), (callee: ^{{.*}})), params: ((param: 0, offset: [0, -1], calls: ((callee: ^{{.*}}, param: 0, offset: [-715, -715]), (callee: ^{{.*}}, param: 1, offset: [-33, -33]), (callee: ^{{.*}}, param: 0, offset: [124, 124]))))))) ; guid = 16654048340802466690 +; DCO-DAG: = gv: (guid: 16654048340802466690, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 7, funcFlags: ({{[^()]+}}), calls: ((callee: ^{{[0-9]+}}), (callee: ^{{[0-9]+}})), params: ((param: 0, offset: [0, -1], calls: ((callee: ^{{[0-9]+}}, param: 0, offset: [-715, -715]), (callee: ^{{[0-9]+}}, param: 1, offset: [-33, -33]), (callee: ^{{[0-9]+}}, param: 0, offset: [124, 124]))))))){{$}} define void @CallMany2(i8* %p) #0 { entry: %p0 = getelementptr i8, i8* %p, i64 -715 @@ -223,6 +253,7 @@ entry: ; SSI: p[]: full-set, @Callee(arg0, [-715,-714)), @Callee(arg0, [-33,-32)), @Callee(arg0, [124,125)) ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "CallManyUnsafe", summaries: {{.*}} calls: ((callee: ^{{.*}}))))) ; guid = 15696680128757863301 +; DCO-DAG: = gv: (guid: 15696680128757863301, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 9, funcFlags: ({{[^()]+}}), calls: ((callee: ^[[CALLEE:.]]))))){{$}} define void @CallManyUnsafe(i8* %p, i64 %i) #0 { entry: %pi = getelementptr i8, i8* %p, i64 %i @@ -244,6 +275,7 @@ entry: ; SSI: p[]: full-set ; BC-NEXT: <PERMODULE ; DIS-DAG: = gv: (name: "Ret", summaries: {{.*}} ; guid = 6707380319572075172 +; DCO-DAG: = gv: (guid: 6707380319572075172, summaries: (function: (module: ^0, flags: ({{[^()]+}}), insts: 1, funcFlags: ({{[^()]+}})))){{$}} define i8* @Ret(i8* %p) #0 { entry: ret i8* %p @@ -253,3 +285,57 @@ entry: ; BC-NOT: <PARAM_ACCESS1 +; COMBINED: <FLAGS op0=0/> +; COMBINED-NEXT: <VALUE_GUID op0=1 op1=[[CALLEE1:72710208629861106]]/> +; COMBINED-NEXT: <VALUE_GUID op0=2 op1=[[CALLEE2:900789920918863816]]/> +; COMBINED-NEXT: <VALUE_GUID op0=3 op1=1075564720951610524/> +; COMBINED-NEXT: <VALUE_GUID op0=4 op1=1417835201204712148/> +; COMBINED-NEXT: <VALUE_GUID op0=5 op1=2949024673554120799/> +; COMBINED-NEXT: <VALUE_GUID op0=6 op1=4179978066780831873/> +; COMBINED-NEXT: <VALUE_GUID op0=7 op1=5540766144860458461/> +; COMBINED-NEXT: <VALUE_GUID op0=8 op1=6187077497926519485/> +; COMBINED-NEXT: <VALUE_GUID op0=9 op1=6707380319572075172/> +; COMBINED-NEXT: <VALUE_GUID op0=10 op1=8411925997558855107/> +; COMBINED-NEXT: <VALUE_GUID op0=11 op1=-8159310605091129913/> +; COMBINED-NEXT: <VALUE_GUID op0=12 op1=-6599332516747241070/> +; COMBINED-NEXT: <VALUE_GUID op0=13 op1=-5282029362632487219/> +; COMBINED-NEXT: <VALUE_GUID op0=14 op1=-3184895716019949174/> +; COMBINED-NEXT: <VALUE_GUID op0=15 op1=-2750063944951688315/> +; COMBINED-NEXT: <VALUE_GUID op0=16 op1=-2287148700827644426/> +; COMBINED-NEXT: <VALUE_GUID op0=17 op1=-1913852605147216470/> +; COMBINED-NEXT: <VALUE_GUID op0=18 op1=-1792695732907084926/> +; COMBINED-NEXT: <VALUE_GUID op0=19 op1=-1296325529848142540/> +; COMBINED-NEXT: <PARAM_ACCESS op0=1 op1=0 op2=0 op3=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=1 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=2 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=1 op4=0 op5=[[CALLEE2]] op6=4 op7=6/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=3 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=24 op2=32 op3=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=4 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=2 op3=0 op4=2 op5=0 op6=8 op7=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=5 +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=6 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=2 op3=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=7 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=2 op3=0 op4=1 op5=0 op6=8 op7=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=8 +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=9 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=1 op4=0 op5=[[CALLEE2]] op6=0 op7=2/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=10 +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=11 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=113 op2=97 op3=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=12 +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=13 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=14 +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=15 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=1 op2=-2 op3=0/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=16 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=1 op4=0 op5=[[CALLEE2]] op6=1431 op7=1429/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=17 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=3 op4=0 op5=[[CALLEE2]] op6=1431 op7=1429 op8=1 op9=[[CALLEE1]] op10=67 op11=65 op12=0 op13=[[CALLEE2]] op14=248 op15=250/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=18 +; COMBINED-NEXT: <PARAM_ACCESS op0=0 op1=0 op2=0 op3=3 op4=0 op5=[[CALLEE2]] op6=1431 op7=1429 op8=0 op9=[[CALLEE2]] op10=67 op11=65 op12=0 op13=[[CALLEE2]] op14=248 op15=250/> +; COMBINED-NEXT: <COMBINED abbrevid=4 op0=19 +; COMBINED-NEXT: <BLOCK_COUNT op0=19/>
\ No newline at end of file |
