diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-06-26 00:30:52 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-06-26 00:30:52 +0000 |
| commit | b03ebfb77ee0a4da44c8191ae0ebcbb3615df939 (patch) | |
| tree | c26bb5c203dfb4f54d9eb30f8dae3c79aff67385 /llvm/test/Transforms | |
| parent | 2251672878c7212c96f16c6f2d30c142f2aae877 (diff) | |
| download | bcm5719-llvm-b03ebfb77ee0a4da44c8191ae0ebcbb3615df939.tar.gz bcm5719-llvm-b03ebfb77ee0a4da44c8191ae0ebcbb3615df939.zip | |
Don't build switch tables for dllimport and TLS variables in GEPs
This is a follow-up to r211331, which failed to notice that we were
returning early from ValidLookupTableConstant for GEPs.
llvm-svn: 211753
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll b/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll index ee63d2c0c0f..51ced4099ac 100644 --- a/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll +++ b/llvm/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll @@ -946,10 +946,10 @@ return: } ; Don't build tables for switches with dllimport variables. -@dllimport_a = external dllimport global i32 -@dllimport_b = external dllimport global i32 -@dllimport_c = external dllimport global i32 -@dllimport_d = external dllimport global i32 +@dllimport_a = external dllimport global [3x i32] +@dllimport_b = external dllimport global [3x i32] +@dllimport_c = external dllimport global [3x i32] +@dllimport_d = external dllimport global [3x i32] define i32* @dllimport(i32 %x) { entry: switch i32 %x, label %sw.default [ @@ -964,7 +964,10 @@ sw.bb2: sw.default: br label %return return: - %retval.0 = phi i32* [ @dllimport_d, %sw.default ], [ @dllimport_c, %sw.bb2 ], [ @dllimport_b, %sw.bb1 ], [ @dllimport_a, %entry ] + %retval.0 = phi i32* [ getelementptr inbounds ([3 x i32]* @dllimport_d, i32 0, i32 0), %sw.default ], + [ getelementptr inbounds ([3 x i32]* @dllimport_c, i32 0, i32 0), %sw.bb2 ], + [ getelementptr inbounds ([3 x i32]* @dllimport_b, i32 0, i32 0), %sw.bb1 ], + [ getelementptr inbounds ([3 x i32]* @dllimport_a, i32 0, i32 0), %entry ] ret i32* %retval.0 ; CHECK-LABEL: @dllimport( ; CHECK: switch i32 |

