[llvm] bc60cdc - [InstCombine] add test for trunc-extelt; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 30 06:43:45 PDT 2020
Author: Sanjay Patel
Date: 2020-03-30T09:43:03-04:00
New Revision: bc60cdcc3f86606f312bc3f43f14fe0c5de225a5
URL: https://github.com/llvm/llvm-project/commit/bc60cdcc3f86606f312bc3f43f14fe0c5de225a5
DIFF: https://github.com/llvm/llvm-project/commit/bc60cdcc3f86606f312bc3f43f14fe0c5de225a5.diff
LOG: [InstCombine] add test for trunc-extelt; NFC
Goes with D76983
Added:
Modified:
llvm/test/Transforms/InstCombine/trunc-extractelement.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/trunc-extractelement.ll b/llvm/test/Transforms/InstCombine/trunc-extractelement.ll
index 822020119b55..9f4ff5d9ce22 100644
--- a/llvm/test/Transforms/InstCombine/trunc-extractelement.ll
+++ b/llvm/test/Transforms/InstCombine/trunc-extractelement.ll
@@ -68,6 +68,18 @@ define i16 @shrinkExtractElt_i64_to_i16_2(<3 x i64> %x) {
ret i16 %t
}
+; Crazy types may be ok.
+define i11 @shrinkExtractElt_i33_to_11_2(<3 x i33> %x) {
+; ANY-LABEL: @shrinkExtractElt_i33_to_11_2(
+; ANY-NEXT: [[E:%.*]] = extractelement <3 x i33> [[X:%.*]], i16 2
+; ANY-NEXT: [[T:%.*]] = trunc i33 [[E]] to i11
+; ANY-NEXT: ret i11 [[T]]
+;
+ %e = extractelement <3 x i33> %x, i16 2
+ %t = trunc i33 %e to i11
+ ret i11 %t
+}
+
; Do not optimize if it would result in an invalid bitcast instruction.
define i13 @shrinkExtractElt_i67_to_i13_2(<3 x i67> %x) {
; ANY-LABEL: @shrinkExtractElt_i67_to_i13_2(
More information about the llvm-commits
mailing list