[PATCH] D83101: [Scalarizer] Constant ExtractElement 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:611
+; Test that constant extracts are nicely scalarized
+define i32 @f24(<4 x i32> *%src, i32 %index) {
+; CHECK-LABEL: @f24(
----------------
Previously we'd end up with https://godbolt.org/z/HDKdqh
```
%val0 = load <4 x i32>, <4 x i32>* %src, align 16
%val0.i0 = extractelement <4 x i32> %val0, i32 0
%val1.i0 = shl i32 1, %val0.i0
%val0.i1 = extractelement <4 x i32> %val0, i32 1
%val1.i1 = shl i32 2, %val0.i1
%val0.i2 = extractelement <4 x i32> %val0, i32 2
%val1.i2 = shl i32 3, %val0.i2
%val0.i3 = extractelement <4 x i32> %val0, i32 3
%val1.i3 = shl i32 4, %val0.i3
%val1.upto0 = insertelement <4 x i32> undef, i32 %val1.i0, i32 0
%val1.upto1 = insertelement <4 x i32> %val1.upto0, i32 %val1.i1, i32 1
%val1.upto2 = insertelement <4 x i32> %val1.upto1, i32 %val1.i2, i32 2
%val1 = insertelement <4 x i32> %val1.upto2, i32 %val1.i3, i32 3
%val2 = extractelement <4 x i32> %val1, i32 3
ret i32 %val2
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83101/new/
https://reviews.llvm.org/D83101
More information about the llvm-commits
mailing list