This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Refactor vecPolicyOp skip logic in doPeepholeMaskedRVV. NFC
ClosedPublic

Authored by luke on Jun 14 2023, 2:15 PM.

Details

Summary

We can just explicitly check if the new unmasked pseudo takes a policy
op, rather than implicitly relying on I->UnmaskedTUPseudo ==
I->UnmaskedPseudo. Split out from another patch to make the diff more
readable.

Diff Detail

Event Timeline

luke created this revision.Jun 14 2023, 2:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2023, 2:15 PM
luke requested review of this revision.Jun 14 2023, 2:15 PM
frasercrmck added inline comments.Jun 15 2023, 12:01 AM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
3182

I know this is an intermediary patch but I was surprised to see a new check on RISCVII::hasVecPolicyOp(MaskedMCID.TSFlags) being introduced just 4 lines above an existing one. Could we move the setting of TailPolicyOpIdx into there?

luke added inline comments.Jun 15 2023, 2:47 AM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
3182

Ah you’re right, that makes much more sense. Will do

luke updated this revision to Diff 531693.Jun 15 2023, 4:16 AM

Move assignment into if

luke marked an inline comment as done.Jun 15 2023, 5:26 AM
reames accepted this revision.Jun 15 2023, 8:34 AM

LGTM - That really helps readability.

This revision is now accepted and ready to land.Jun 15 2023, 8:34 AM
This revision was landed with ongoing or failed builds.Jun 16 2023, 4:40 PM
This revision was automatically updated to reflect the committed changes.