[PATCH] D103419: [VectorCombine] Fix alignment in single element store

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 9 09:39:05 PDT 2021


spatel added inline comments.


================
Comment at: llvm/test/Transforms/VectorCombine/load-insert-store.ll:142
 
+define void @insert_store_nonconst_large_alignment(<4 x i32>* %q, i32 zeroext %s, i32 %idx) {
+; CHECK-LABEL: @insert_store_nonconst_large_alignment(
----------------
spatel wrote:
> lebedev.ri wrote:
> > I think we still want those two tests i suggested,
> > they demonstrate that we don't increase alignment from the maximal one allowed.
> > 
> > Please precommit the tests.
> +1 - additional tests and pre-commit will make this easier to understand.
Let me know if I'm not seeing it, but we want 1 test with nonconst index where the original alignment is less than the presumed alignment for the new scalar store:


```
define void @src(<8 x i64>* %q, i64 %s, i32 %idx) {
  %cmp = icmp ult i32 %idx, 2
  call void @llvm.assume(i1 %cmp)
  %i = load <8 x i64>, <8 x i64>* %q, align 4
  %vecins = insertelement <8 x i64> %i, i64 %s, i32 %idx
  store <8 x i64> %vecins, <8 x i64>* %q, align 2 ; make this different just to exercise the logic a bit more
  ret void
}
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103419



More information about the llvm-commits mailing list