diff options
author | Eli Bendersky <eliben@google.com> | 2014-04-03 17:51:58 +0000 |
---|---|---|
committer | Eli Bendersky <eliben@google.com> | 2014-04-03 17:51:58 +0000 |
commit | 9966b26dacfb16fb0e5aa695f51ef7006ca5fe4b (patch) | |
tree | 5002df845fe83316ff7ac8af0a1901319cd27c68 /llvm/test/Transforms/InstCombine/gep-addrspace.ll | |
parent | bc79fddb9a09463cff5e4f2d13bf4cc1a4058b3b (diff) | |
download | bcm5719-llvm-9966b26dacfb16fb0e5aa695f51ef7006ca5fe4b.tar.gz bcm5719-llvm-9966b26dacfb16fb0e5aa695f51ef7006ca5fe4b.zip |
Fix PR19270 - type mismatch caused by invalid optimization.
Patch by Jingyue Wu.
llvm-svn: 205547
Diffstat (limited to 'llvm/test/Transforms/InstCombine/gep-addrspace.ll')
-rw-r--r-- | llvm/test/Transforms/InstCombine/gep-addrspace.ll | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InstCombine/gep-addrspace.ll b/llvm/test/Transforms/InstCombine/gep-addrspace.ll index 24c355d817e..29511a3c667 100644 --- a/llvm/test/Transforms/InstCombine/gep-addrspace.ll +++ b/llvm/test/Transforms/InstCombine/gep-addrspace.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -instcombine -S +; RUN: opt < %s -instcombine -S | FileCheck %s 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-n8:16:32:64" target triple = "x86_64-pc-win32" @@ -17,3 +17,18 @@ ST: ret void } +@array = internal addrspace(3) global [256 x float] zeroinitializer, align 4 +@scalar = internal addrspace(3) global float 0.000000e+00, align 4 + +define void @keep_necessary_addrspacecast(i64 %i, float** %out0, float** %out1) { +entry: +; CHECK-LABEL: @keep_necessary_addrspacecast + %0 = getelementptr [256 x float]* addrspacecast ([256 x float] addrspace(3)* @array to [256 x float]*), i64 0, i64 %i +; CHECK: addrspacecast float addrspace(3)* %{{[0-9]+}} to float* + %1 = getelementptr [0 x float]* addrspacecast (float addrspace(3)* @scalar to [0 x float]*), i64 0, i64 %i +; CHECK: addrspacecast float addrspace(3)* %{{[0-9]+}} to float* + store float* %0, float** %out0, align 4 + store float* %1, float** %out1, align 4 + ret void +} + |