[PATCH] D105053: [INSTCOMBINE] Transform reduction(shuffle V, poison, unique_mask) to reduction(V).

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 05:20:25 PDT 2021


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/reduction-shufflevector.ll:9
+;
+  %shuf = shufflevector <4 x i32> %x, <4 x i32> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
+  %res = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %shuf)
----------------
ABataev wrote:
> spatel wrote:
> > Identity shuffle should be reduced even without this patch.
> > It would be better to pre-commit the test file, so we can make sure that we are testing as expected.
> Yes, I believe so, just added a check to try all possible combinations.
> Did not precommit the test initially to be sure that the patch/the test are correct. Will precommit it, if it is fine.
Sure, please precommit - the transform can be confirmed by Alive2:
https://alive2.llvm.org/ce/z/CZH3eH


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105053



More information about the llvm-commits mailing list