diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-02 06:06:14 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-02 06:06:14 +0000 |
commit | 0148bb29a5f14dfd9c5c94ec7144c0554cd2691f (patch) | |
tree | 5e3e3140041bb6a69f075944139f5020f402336b /test/Transforms/SCCP | |
parent | 6367c3fa7cb3820bc31a40e9195388db37e452a0 (diff) | |
download | external_llvm-0148bb29a5f14dfd9c5c94ec7144c0554cd2691f.zip external_llvm-0148bb29a5f14dfd9c5c94ec7144c0554cd2691f.tar.gz external_llvm-0148bb29a5f14dfd9c5c94ec7144c0554cd2691f.tar.bz2 |
Use the libanalysis 'ConstantFoldLoadFromConstPtr' function
instead of reinventing SCCP-specific logic. This gives us
new powers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SCCP')
-rw-r--r-- | test/Transforms/SCCP/loadtest.ll | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/Transforms/SCCP/loadtest.ll b/test/Transforms/SCCP/loadtest.ll index fd82aef..add2af4 100644 --- a/test/Transforms/SCCP/loadtest.ll +++ b/test/Transforms/SCCP/loadtest.ll @@ -1,5 +1,6 @@ ; This test makes sure that these instructions are properly constant propagated. -; + +target datalayout = "e-p:32:32" ; RUN: opt < %s -sccp -S | not grep load @@ -20,7 +21,13 @@ define float @test2() { define i32 @test3() { %A = getelementptr [2 x { i32, float }]* @Y, i64 0, i64 0, i32 0 ; <i32*> [#uses=1] - %B = load i32* %A ; <i32> [#uses=1] + %B = load i32* %A ret i32 %B } +define i8 @test4() { + %A = bitcast i32* @X to i8* + %B = load i8* %A + ret i8 %B +} + |