summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-02-05 22:58:45 +0000
committerSanjay Patel <spatel@rotateright.com>2019-02-05 22:58:45 +0000
commitcddb1e54697d0eed7329f4bee8878802b388ab29 (patch)
treed3f16fedd30c8ccf6cccf18b5f099d84f78e120a /llvm/test/Transforms
parent1b8df427121e3d7edf5cfaf0f3e3550ed2091d62 (diff)
downloadbcm5719-llvm-cddb1e54697d0eed7329f4bee8878802b388ab29.tar.gz
bcm5719-llvm-cddb1e54697d0eed7329f4bee8878802b388ab29.zip
[InstCombine] limit extracting shuffle transform based on uses
As discussed in D53037, this can lead to worse codegen, and we don't generally expect the backend to be able to optimize arbitrary shuffles. If there's only one use of the 1st shuffle, that means it's getting removed, so that should always be safe. llvm-svn: 353235
Diffstat (limited to 'llvm/test/Transforms')
-rw-r--r--llvm/test/Transforms/InstCombine/vec_shuffle.ll4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/test/Transforms/InstCombine/vec_shuffle.ll b/llvm/test/Transforms/InstCombine/vec_shuffle.ll
index 401bcee4991..aae337d0de3 100644
--- a/llvm/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/llvm/test/Transforms/InstCombine/vec_shuffle.ll
@@ -195,7 +195,7 @@ define <4 x i8> @extract_subvector_of_shuffle_undefs_types(<2 x i8> %x, <2 x i8>
ret <4 x i8> %extract_subv
}
-; FIXME: Extra uses are not ok - we should only do the transform when we can eliminate an instruction.
+; Extra uses are not ok - we only do the transform when we can eliminate an instruction.
declare void @use_v5i8(<5 x i8>)
@@ -203,7 +203,7 @@ define <4 x i8> @extract_subvector_of_shuffle_extra_use(<2 x i8> %x, <2 x i8> %y
; CHECK-LABEL: @extract_subvector_of_shuffle_extra_use(
; CHECK-NEXT: [[SHUF:%.*]] = shufflevector <2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]], <5 x i32> <i32 undef, i32 2, i32 0, i32 1, i32 0>
; CHECK-NEXT: call void @use_v5i8(<5 x i8> [[SHUF]])
-; CHECK-NEXT: [[EXTRACT_SUBV:%.*]] = shufflevector <2 x i8> [[X]], <2 x i8> [[Y]], <4 x i32> <i32 undef, i32 2, i32 0, i32 undef>
+; CHECK-NEXT: [[EXTRACT_SUBV:%.*]] = shufflevector <5 x i8> [[SHUF]], <5 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 undef>
; CHECK-NEXT: ret <4 x i8> [[EXTRACT_SUBV]]
;
%shuf = shufflevector <2 x i8> %x, <2 x i8> %y, <5 x i32> <i32 undef, i32 2, i32 0, i32 1, i32 0>
OpenPOWER on IntegriCloud