diff options
| author | evgeny <eleviant@accesssoftek.com> | 2020-01-15 19:29:01 +0300 |
|---|---|---|
| committer | evgeny <eleviant@accesssoftek.com> | 2020-01-15 19:29:01 +0300 |
| commit | 10cadee5ce86e80d7486855199d329951f38af01 (patch) | |
| tree | 9af9164ab50e8b7cee108cbe50f0473e9b1fd09c /llvm/test/Bitcode/thinlto-function-summary-refgraph.ll | |
| parent | 3f3017e162ec4208399dcf633c99bdac788c06fd (diff) | |
| download | llvm-10cadee5ce86e80d7486855199d329951f38af01.zip llvm-10cadee5ce86e80d7486855199d329951f38af01.tar.gz llvm-10cadee5ce86e80d7486855199d329951f38af01.tar.bz2 | |
[ThinLTO] Always import constants
This patch imports constant variables even when they can't be internalized
(which results in promotion). This offers some extra constant folding
opportunities.
Differential revision: https://reviews.llvm.org/D70404
Diffstat (limited to 'llvm/test/Bitcode/thinlto-function-summary-refgraph.ll')
| -rw-r--r-- | llvm/test/Bitcode/thinlto-function-summary-refgraph.ll | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll b/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll index 5a33daa..92a9b70 100644 --- a/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-refgraph.ll @@ -73,7 +73,7 @@ target triple = "x86_64-unknown-linux-gnu" @bar = global void (...)* bitcast (void ()* @func to void (...)*), align 8 -@globalvar = global i32 0, align 4 +@globalvar = constant i32 0, align 4 declare void @func() #0 declare i32 @func2(...) #1 @@ -154,11 +154,12 @@ entry: ; DIS-DAG: = gv: (name: "foo") ; guid = 6699318081062747564 ; DIS-DAG: = gv: (name: "func") ; guid = 7289175272376759421 ; DIS-DAG: = gv: (name: "func3") ; guid = 11517462787082255043 -; DIS-DAG: = gv: (name: "globalvar", summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), varFlags: (readonly: 1, writeonly: 1)))) ; guid = 12887606300320728018 +; Check that default value of writeonly attribute is zero for constant variables +; DIS-DAG: = gv: (name: "globalvar", summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), varFlags: (readonly: 1, writeonly: 0, constant: 1)))) ; guid = 12887606300320728018 ; DIS-DAG: = gv: (name: "func2") ; guid = 14069196320850861797 ; DIS-DAG: = gv: (name: "llvm.ctpop.i8") ; guid = 15254915475081819833 ; DIS-DAG: = gv: (name: "main", summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), insts: 9, calls: ((callee: ^{{.*}})), refs: (^{{.*}})))) ; guid = 15822663052811949562 -; DIS-DAG: = gv: (name: "bar", summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), varFlags: (readonly: 1, writeonly: 1), refs: (^{{.*}})))) ; guid = 16434608426314478903 +; DIS-DAG: = gv: (name: "bar", summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0, canAutoHide: 0), varFlags: (readonly: 1, writeonly: 1, constant: 0), refs: (^{{.*}})))) ; guid = 16434608426314478903 ; Don't try to match the exact GUID. Since it is private, the file path ; will get hashed, and that will be test dependent. ; DIS-DAG: = gv: (name: "Y", summaries: (function: (module: ^0, flags: (linkage: private, notEligibleToImport: 0, live: 0, dsoLocal: 1, canAutoHide: 0), insts: 14, calls: ((callee: ^{{.*}}))))) ; guid = |
