This is an archive of the discontinued LLVM Phabricator instance.

[VP] Teach isVPBinaryOp to recognize vp.smin/smax/umin/umax/minnum/maxnum.
ClosedPublic

Authored by fakepaper56 on Oct 12 2022, 12:57 AM.

Details

Diff Detail

Event Timeline

fakepaper56 created this revision.Oct 12 2022, 12:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 12:57 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
fakepaper56 requested review of this revision.Oct 12 2022, 12:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 12 2022, 12:57 AM

Remove all the reviewers since the patch cause some fails.

Remove all the reviewers since the patch cause some fails.

You can change the state to "Plan Changes" to make it not ready for review.

fakepaper56 planned changes to this revision.Oct 12 2022, 4:34 PM

Thank Craig's opinion.

Update test cases.

Update commit message.

fakepaper56 edited the summary of this revision. (Show Details)Oct 18 2022, 12:14 AM
frasercrmck added inline comments.Oct 18 2022, 2:03 AM
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vmax-vp.ll
360

I think these FIXMEs can be removed. The upper halves are now being removed, aren't they? I'm not sure what is causing that, but it's good news.

eopXD added a comment.Oct 18 2022, 2:18 AM

Sorry that I am unclear to the context of VP_BINARY_OP, may elaborate on how adding VP_BINARY_OP helps the code generation?
My trace stopped at DAGCombiner.cpp where ISD::isVPBinaryOp() == true is setting `return value type to undef.

fakepaper56 added a comment.EditedOct 18 2022, 4:58 AM

Sorry that I am unclear to the context of VP_BINARY_OP, may elaborate on how adding VP_BINARY_OP helps the code generation?
My trace stopped at DAGCombiner.cpp where ISD::isVPBinaryOp() == true is setting `return value type to undef.

As you mentioned, DAGCombiner make vp binary op with evl = 0 or false mask be undefined value. The improvement in test cases is caused that there are some vp operations with evl = 0 is transformed to undef value by DAGCombiner.

Remove redundant FIXMEs.

craig.topper added inline comments.Oct 18 2022, 8:55 PM
llvm/test/CodeGen/RISCV/rvv/vmax-vp.ll
1170

Why does RV64 not see the EVL is 0?

fakepaper56 added inline comments.Oct 18 2022, 11:23 PM
llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vmax-vp.ll
360

Done.

llvm/test/CodeGen/RISCV/rvv/vmax-vp.ll
1170

As the comment of the test illustrated, DAGCombiner could not transformed usubsat((and (vscale x 16), 0xffffffff), vscale x 16) to 0 before lowering. And vp binary operations are only existed before lowering.

craig.topper added inline comments.Oct 19 2022, 2:18 PM
llvm/test/CodeGen/RISCV/rvv/vmax-vp.ll
1170

Thanks. I didn't see the comment.

This revision is now accepted and ready to land.Oct 19 2022, 2:19 PM