[llvm] [InstCombine] Pull extract through broadcast (PR #143380)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 01:56:37 PDT 2025


================
@@ -91,10 +91,7 @@ define i8 @extractelement_bitcast_insert_extra_use_bitcast(<vscale x 2 x i32> %a
 
 define i32 @extractelement_shuffle_maybe_out_of_range(i32 %v) {
 ; CHECK-LABEL: @extractelement_shuffle_maybe_out_of_range(
-; CHECK-NEXT:    [[IN:%.*]] = insertelement <vscale x 4 x i32> poison, i32 [[V:%.*]], i64 0
-; CHECK-NEXT:    [[SPLAT:%.*]] = shufflevector <vscale x 4 x i32> [[IN]], <vscale x 4 x i32> poison, <vscale x 4 x i32> zeroinitializer
-; CHECK-NEXT:    [[R:%.*]] = extractelement <vscale x 4 x i32> [[SPLAT]], i64 4
-; CHECK-NEXT:    ret i32 [[R]]
----------------
RKSimon wrote:

might be useful to add a comment above the test explaining the reasoning,similar to your comment here

https://github.com/llvm/llvm-project/pull/143380


More information about the llvm-commits mailing list