diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-24 01:00:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-24 01:00:13 +0000 |
commit | 3914f721cc95bb1e8534101a6bb62dc484ef7520 (patch) | |
tree | b978a3ea668bb91f87becf40602c5a2686dddc78 /test/Transforms | |
parent | 0a26891ce9b6de840c087d73c04324729c3d1a8b (diff) | |
download | external_llvm-3914f721cc95bb1e8534101a6bb62dc484ef7520.zip external_llvm-3914f721cc95bb1e8534101a6bb62dc484ef7520.tar.gz external_llvm-3914f721cc95bb1e8534101a6bb62dc484ef7520.tar.bz2 |
Make InstCombineStoreToCast handle aggregates more aggressively,
handling the case in Transforms/InstCombine/cast-store-gep.ll, which
is a heavily reduced testcase from Clang on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62904 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms')
-rw-r--r-- | test/Transforms/InstCombine/cast-store-gep.ll | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/cast-store-gep.ll b/test/Transforms/InstCombine/cast-store-gep.ll new file mode 100644 index 0000000..95a069d --- /dev/null +++ b/test/Transforms/InstCombine/cast-store-gep.ll @@ -0,0 +1,17 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep inttoptr +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep alloca + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" +target triple = "x86_64-apple-darwin10.0" + %T = type { i8*, i8 } + +define i8* @test(i8* %Val, i64 %V) nounwind { +entry: + %A = alloca %T, align 8 + %mrv_gep = bitcast %T* %A to i64* ; <i64*> [#uses=1] + %B = getelementptr %T* %A, i64 0, i32 0 ; <i8**> [#uses=1] + + store i64 %V, i64* %mrv_gep + %C = load i8** %B, align 8 ; <i8*> [#uses=1] + ret i8* %C +} |