diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-07-31 00:13:28 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-07-31 00:13:28 +0000 |
commit | 9177867b247fb2b5505cb2f349a04cb1b05aa89b (patch) | |
tree | 71e8f72dac4ca083203fdef55e1d7024efd05045 /llvm/test | |
parent | e8514fc1f78dc917ed81c8a8112c9d110a1b7c9e (diff) | |
download | bcm5719-llvm-9177867b247fb2b5505cb2f349a04cb1b05aa89b.tar.gz bcm5719-llvm-9177867b247fb2b5505cb2f349a04cb1b05aa89b.zip |
UseListOrder: Don't give constant IDs to GlobalValues
Since initializers of GlobalValues are being assigned IDs before
GlobalValues themselves, explicitly exclude GlobalValues from the
constant pool. Added targeted test in `test/Bitcode/use-list-order.ll`
and added two more RUN lines in `test/Assembly`.
This is part of PR5680.
llvm-svn: 214368
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Assembler/ConstantExprFold.ll | 1 | ||||
-rw-r--r-- | llvm/test/Assembler/ConstantExprFoldCast.ll | 1 | ||||
-rw-r--r-- | llvm/test/Bitcode/use-list-order.ll | 13 |
3 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/Assembler/ConstantExprFold.ll b/llvm/test/Assembler/ConstantExprFold.ll index fc18ce708ed..f3da4e089b4 100644 --- a/llvm/test/Assembler/ConstantExprFold.ll +++ b/llvm/test/Assembler/ConstantExprFold.ll @@ -2,6 +2,7 @@ ; situations ; RUN: llvm-as < %s | llvm-dis | not grep "(" +; RUN: verify-uselistorder %s -preserve-bc-use-list-order -num-shuffles=5 @A = global i64 0 diff --git a/llvm/test/Assembler/ConstantExprFoldCast.ll b/llvm/test/Assembler/ConstantExprFoldCast.ll index 161a4ca3575..825ca573d94 100644 --- a/llvm/test/Assembler/ConstantExprFoldCast.ll +++ b/llvm/test/Assembler/ConstantExprFoldCast.ll @@ -1,6 +1,7 @@ ; This test checks to make sure that constant exprs fold in some simple situations ; RUN: llvm-as < %s | llvm-dis | not grep cast +; RUN: verify-uselistorder %s -preserve-bc-use-list-order -num-shuffles=5 @A = global i32* bitcast (i8* null to i32*) ; Cast null -> fold @B = global i32** bitcast (i32** @A to i32**) ; Cast to same type -> fold diff --git a/llvm/test/Bitcode/use-list-order.ll b/llvm/test/Bitcode/use-list-order.ll index fb18b462da5..3d3a06ca9de 100644 --- a/llvm/test/Bitcode/use-list-order.ll +++ b/llvm/test/Bitcode/use-list-order.ll @@ -22,6 +22,19 @@ @globalAndFunction = global i4 4 @globalAndFunctionGlobalUser = global i4* @globalAndFunction +; Check use-list order for constants used by globals that are themselves used +; as aliases. This confirms that this globals are recognized as GlobalValues +; (not general constants). +@const.global = global i63 0 +@const.global.ptr = global i63* @const.global +@const.global.2 = global i63 0 + +; Same as above, but for aliases. +@const.target = global i62 1 +@const.alias = alias i62* @const.target +@const.alias.ptr = alias i62* @const.alias +@const.alias.2 = alias i62* @const.target + define i64 @f(i64 %f) { entry: %sum = add i64 %f, 0 |