This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] If the maskedoff is vundefined(), use ta,ma for vsetvli.
AbandonedPublic

Authored by HsiangKai on Jul 28 2021, 2:13 AM.

Diff Detail

Event Timeline

HsiangKai created this revision.Jul 28 2021, 2:13 AM
HsiangKai requested review of this revision.Jul 28 2021, 2:13 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 28 2021, 2:13 AM
craig.topper added inline comments.Jul 28 2021, 7:42 PM
llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
379

ture -> true

382

Wouldn't the lack of tied operand for those indicate they weren't masked.

What if we did

bool MaskAgnostic = true;
if (MI.isRegTiedToUseOperand(0, &UseOpIdx)) {
  MaskAgnostic = RISCVII::hasDummyMaskOp(TSFlags);
}
384

Doesn't have hasDummyMaskOp return a bool? We shouldn't need a conditional operator.

HsiangKai updated this revision to Diff 362617.Jul 28 2021, 8:43 PM

Address comments.

HsiangKai marked 3 inline comments as done.Jul 28 2021, 8:44 PM

LGTM but there are test failures. Is that just a whole load of mu->ma changes that have been omitted for a smaller diff?

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
379

nit, but purely from a code layout and comment perspective this MaskAgnostic is in the middle of two "Tail" variables. Also the "tail" variables are well-commented ahead of time but the "mask" logic is only commented on inside the if statement below. It just looks a bit imbalanced.

I'm wondering if it'd be better there was even something simple like "Default to mask agnostic unless the operation is masked and the destination is tied to a source."

412

nit: maybe we don't need /*TailAgnostic*/ or /*MaskAgnostic*/ anymore?

llvm/test/CodeGen/RISCV/rvv/maskedoff-undef.ll
4

I don't think we're typically using --riscv-no-aliases in our CodeGen tests?

craig.topper added inline comments.Jul 29 2021, 9:20 AM
llvm/test/CodeGen/RISCV/rvv/maskedoff-undef.ll
4

We were at one point using that on rvv tests, but I think it's been removed now.

HsiangKai updated this revision to Diff 362920.Jul 29 2021, 4:32 PM
  • Add more comments.
  • Remove unnecessary --riscv-no-aliases in the test case.

LGTM but there are test failures. Is that just a whole load of mu->ma changes that have been omitted for a smaller diff?

Updated test cases are put in https://reviews.llvm.org/D107022.

LGTM but there are test failures. Is that just a whole load of mu->ma changes that have been omitted for a smaller diff?

Updated test cases are put in https://reviews.llvm.org/D107022.

Should I combine these two into one patch?

LGTM but there are test failures. Is that just a whole load of mu->ma changes that have been omitted for a smaller diff?

Updated test cases are put in https://reviews.llvm.org/D107022.

Should I combine these two into one patch?

Hmm, unsure, the test changes are pretty much unreviewable given how large the diff would be. There's nothing unexpected in there, presumably?

HsiangKai abandoned this revision.Dec 16 2021, 12:24 AM