[PATCH] D109537: [InstCombine] move extend after insertelement if both operands are extended

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 9 12:37:51 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/insert-ext.ll:62-64
 ; CHECK-NEXT:    [[V:%.*]] = sext <2 x i16> [[X:%.*]] to <2 x i32>
 ; CHECK-NEXT:    [[S:%.*]] = sext i8 [[Y:%.*]] to i32
 ; CHECK-NEXT:    [[I:%.*]] = insertelement <2 x i32> [[V]], i32 [[S]], i32 [[INDEX:%.*]]
----------------
I guess it will depend on our profitability/correctness reasoning for this transform,
but under standard instcombine profitability model we should be fine producing
```
  %s = sext i8 %y to i16
  %i = insertelement <2 x i16> %x, i16 %s, i32 %index
  %r = sext <2 x i16> %i to <2 x i32>
```



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109537/new/

https://reviews.llvm.org/D109537



More information about the llvm-commits mailing list