summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/StraightLineStrengthReduce
diff options
context:
space:
mode:
authorJingyue Wu <jingyue@google.com>2015-08-13 18:48:49 +0000
committerJingyue Wu <jingyue@google.com>2015-08-13 18:48:49 +0000
commit13a80eaceb538adb2aafce9756fb54ee4117d7fe (patch)
tree55c0bed3fc9bd7e79518c2297e7174fa63bc79c2 /llvm/test/Transforms/StraightLineStrengthReduce
parent65270736c77c2aa4f556a02125aca91d040d3ffb (diff)
downloadbcm5719-llvm-13a80eaceb538adb2aafce9756fb54ee4117d7fe.tar.gz
bcm5719-llvm-13a80eaceb538adb2aafce9756fb54ee4117d7fe.zip
[SeparateConstOffsetFromGEP] strengthen the inbounds attribute
We used to be over-conservative about preserving inbounds. Actually, the second GEP (which applies the constant offset) can inherit the inbounds attribute of the original GEP, because the resultant pointer is equivalent to that of the original GEP. For example, x = GEP inbounds a, i+5 => y = GEP a, i // inbounds removed x = GEP inbounds y, 5 // inbounds preserved llvm-svn: 244937
Diffstat (limited to 'llvm/test/Transforms/StraightLineStrengthReduce')
-rw-r--r--llvm/test/Transforms/StraightLineStrengthReduce/AMDGPU/reassociate-geps-and-slsr-addrspace.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/StraightLineStrengthReduce/AMDGPU/reassociate-geps-and-slsr-addrspace.ll b/llvm/test/Transforms/StraightLineStrengthReduce/AMDGPU/reassociate-geps-and-slsr-addrspace.ll
index 278250a9c80..f2853aca698 100644
--- a/llvm/test/Transforms/StraightLineStrengthReduce/AMDGPU/reassociate-geps-and-slsr-addrspace.ll
+++ b/llvm/test/Transforms/StraightLineStrengthReduce/AMDGPU/reassociate-geps-and-slsr-addrspace.ll
@@ -57,10 +57,10 @@ bb:
; CHECK-LABEL: @slsr_after_reassociate_lds_geps_ds_max_offset(
; CHECK: [[B1:%[0-9]+]] = getelementptr float, float addrspace(3)* %arr, i32 %i
-; CHECK: getelementptr float, float addrspace(3)* [[B1]], i32 16383
+; CHECK: getelementptr inbounds float, float addrspace(3)* [[B1]], i32 16383
; CHECK: [[B2:%[0-9]+]] = getelementptr float, float addrspace(3)* [[B1]], i32 %i
-; CHECK: getelementptr float, float addrspace(3)* [[B2]], i32 16383
+; CHECK: getelementptr inbounds float, float addrspace(3)* [[B2]], i32 16383
define void @slsr_after_reassociate_lds_geps_ds_max_offset(float addrspace(1)* %out, float addrspace(3)* noalias %arr, i32 %i) {
bb:
%i2 = shl nsw i32 %i, 1
OpenPOWER on IntegriCloud