[PATCH] D61658: [PowerPC] Emit XXSEL for vec_sel and code that has the same pattern
Nemanja Ivanovic via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 6 20:01:25 PDT 2019
nemanjai marked 8 inline comments as done.
nemanjai added inline comments.
================
Comment at: lib/Target/PowerPC/PPCInstrVSX.td:964
+ (v4i32 (XXSEL $A, $B, $C))>;
+def : Pat<(v4i32 (or (and v4i32:$A, (vnot_ppc v4i32:$C)),
+ (and v4i32:$B, v4i32:$C))),
----------------
jsji wrote:
> Why we need this pattern? `and` should be a commutable op?
No good reason. I put it in to be safe in case ISEL somehow doesn't match a commuted pattern. That doesn't appear to happen so I'll remove it.
================
Comment at: test/CodeGen/PowerPC/vec-select.ll:24
+ %neg.i = xor <8 x i16> %c, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
+ %and.i = and <8 x i16> %neg.i, %a
+ %and1.i = and <8 x i16> %c, %b
----------------
jsji wrote:
> I think it would be better if we swap `%neg.i, %a` to test commutable patterns.
OK.
================
Comment at: test/CodeGen/PowerPC/vec-select.ll:26
+ %and1.i = and <8 x i16> %c, %b
+ %or.i = or <8 x i16> %and.i, %and1.i
+ ret <8 x i16> %or.i
----------------
jsji wrote:
> I think it would be better if we swap `%and.i, %and1.i` to test commutable patterns.
OK. I swapped the operands of the `and` on one and the operands of the `or` on another.
================
Comment at: test/CodeGen/PowerPC/vec-select.ll:41
+ ret <16 x i8> %or.i
+}
----------------
jsji wrote:
> How about adding a test of <2 x i64> for vector double too?
> And maybe <4 x i1> as a negative test?
Will do.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61658/new/
https://reviews.llvm.org/D61658
More information about the llvm-commits
mailing list