[PATCH] D83102: [Scalarizer] Constant InsertElement Hanlding
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 2 15:41:15 PDT 2020
lebedev.ri marked an inline comment as done.
lebedev.ri added inline comments.
================
Comment at: llvm/test/Transforms/Scalarizer/basic.ll:624
+; Test that constant inserts are nicely scalarized
+define <4 x i32> @f25(<4 x i32> *%src, i32 %repl, i32 %index) {
----------------
Previously we'd end up with https://godbolt.org/z/NyExWc
```
%val0 = load <4 x i32>, <4 x i32>* %src, align 16
%val1 = insertelement <4 x i32> %val0, i32 %repl, i32 3
%val0.i0 = extractelement <4 x i32> %val0, i32 0
%val2.i0 = shl i32 1, %val0.i0
%val0.i1 = extractelement <4 x i32> %val0, i32 1
%val2.i1 = shl i32 2, %val0.i1
%val0.i2 = extractelement <4 x i32> %val0, i32 2
%val2.i2 = shl i32 3, %val0.i2
%val2.i3 = shl i32 4, %repl
%val2.upto0 = insertelement <4 x i32> undef, i32 %val2.i0, i32 0
%val2.upto1 = insertelement <4 x i32> %val2.upto0, i32 %val2.i1, i32 1
%val2.upto2 = insertelement <4 x i32> %val2.upto1, i32 %val2.i2, i32 2
%val2 = insertelement <4 x i32> %val2.upto2, i32 %val2.i3, i32 3
ret <4 x i32> %val2
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83102/new/
https://reviews.llvm.org/D83102
More information about the llvm-commits
mailing list