[PATCH] D91271: [AArch64] Attempt to sink mul operands
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 11 06:11:58 PST 2021
dmgreen added inline comments.
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:10967
+ ShuffleVectorInst *Shuffle = dyn_cast<ShuffleVectorInst>(Op);
+ if (!Shuffle)
+ continue;
----------------
Should this be checking for isZeroEltSplat too?
================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:10972
+ InsertElementInst *Insert = dyn_cast<InsertElementInst>(ShuffleOperand);
+ if (!Insert)
+ continue;
----------------
Check for insert into element 0 too?
================
Comment at: llvm/test/CodeGen/AArch64/aarch64-matrix-umull-smull.ll:169
+ %broadcast.splatinsert31 = insertelement <4 x i32> undef, i32 %splat.input.ext, i32 0
+ %broadcast.splat32 = shufflevector <4 x i32> %broadcast.splatinsert31, <4 x i32> %broadcast.splat, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
+ %3 = trunc i64 %index to i32
----------------
Try loading the value in the loop, to keep the mul loop-variant:
```
vector.body: ; preds = %vector.header, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.header ]
%g = getelementptr inbounds i16, i16* %A, i64 %index
%val1 = load i16, i16* %g
%splat.input.ext = zext i16 %val1 to i32
%broadcast.splatinsert31 = insertelement <4 x i32> undef, i32 %splat.input.ext, i32 0
%broadcast.splat32 = shufflevector <4 x i32> %broadcast.splatinsert31, <4 x i32> %broadcast.splat, <4 x i32> <i32 0, i32 0, i32 0, i32 0>
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91271/new/
https://reviews.llvm.org/D91271
More information about the llvm-commits
mailing list