This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add passthru operand to RISCVISD::SETCC_VL.
ClosedPublic

Authored by craig.topper on Aug 17 2022, 11:41 AM.

Details

Summary

Use it to the fix a bug in the fceil/ffloor lowerings. We were
setting the passthru to IMPLICIT_DEF before and using a mask
agnostic policy. This means where the incoming bits in
the mask were 0 they could be anything in the outgoing mask. We
want those bits in the outgoing mask to be 0. This means we need to
pass the input mask as the passthru.

This generates worse code because we are unable to allocate the
v0 register to the output due to an earlyclobber constraint. We
probably need a special TIED pseudoinstruction and probably custom
isel since you can't use V0 twice in the input pattern.

Diff Detail

Event Timeline

craig.topper created this revision.Aug 17 2022, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2022, 11:41 AM
craig.topper requested review of this revision.Aug 17 2022, 11:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2022, 11:41 AM
reames accepted this revision.Aug 19 2022, 7:29 AM

LGTM

llvm/test/CodeGen/RISCV/rvv/fceil-sdnode.ll
20

Purely as an aside, the fact we had two redundant vsetvlis and managed to get rid of them after this change is interesting.

This revision is now accepted and ready to land.Aug 19 2022, 7:29 AM
craig.topper added inline comments.Aug 19 2022, 8:42 AM
llvm/test/CodeGen/RISCV/rvv/fceil-sdnode.ll
20

The mask policies were different. We do a bad job of using mask agnostic today.

reames added inline comments.Aug 19 2022, 8:47 AM
llvm/test/CodeGen/RISCV/rvv/fceil-sdnode.ll
20

You're right. I swear I checked the policy bits before commenting, but apparently my brain swapped "mu" and "ma" at least once.

This revision was landed with ongoing or failed builds.Aug 19 2022, 8:57 AM
This revision was automatically updated to reflect the committed changes.