This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix bugs in pseudo instructions for masked segment load.
ClosedPublic

Authored by HsiangKai on Feb 17 2021, 11:00 PM.

Details

Summary

For masked segment load, the destination register should not overlap with mask register. It could not be V0.

In the original implementation, there is no segment load/store register class without V0. In this patch, I added these register classes and modify GetVRegNoV0 to get the correct one.

Diff Detail

Event Timeline

HsiangKai created this revision.Feb 17 2021, 11:00 PM
HsiangKai requested review of this revision.Feb 17 2021, 11:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2021, 11:00 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
rogfer01 accepted this revision.Feb 17 2021, 11:44 PM

Thanks @HsiangKai. LGTM.

llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
495–506

Now that we're here, is it possible to replace !eq(1, 1) with true?

This revision is now accepted and ready to land.Feb 17 2021, 11:44 PM
HsiangKai added inline comments.Feb 17 2021, 11:49 PM
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
495–506

I will do it. Thanks.

foad added a subscriber: foad.Feb 18 2021, 6:27 AM

I'm seeing:

$ ninja -C ~/llvm-release/ check-llvm-codegen-amdgpu
ninja: Entering directory `/home/jayfoad2/llvm-release/'
[125/1115] Building RISCVGenAsmMatcher.inc...
FAILED: lib/Target/RISCV/RISCVGenAsmMatcher.inc 
cd /home/jayfoad2/llvm-release && /home/jayfoad2/llvm-release/bin/llvm-tblgen -gen-asm-matcher -I /home/jayfoad2/git/llvm-project/llvm/lib/Target/RISCV -I/home/jayfoad2/llvm-release/include -I/home/jayfoad2/git/llvm-project/llvm/include -I /home/jayfoad2/git/llvm-project/llvm/lib/Target /home/jayfoad2/git/llvm-project/llvm/lib/Target/RISCV/RISCV.td --write-if-changed -o lib/Target/RISCV/RISCVGenAsmMatcher.inc -d lib/Target/RISCV/RISCVGenAsmMatcher.inc.d
Included from /home/jayfoad2/git/llvm-project/llvm/lib/Target/RISCV/RISCV.td:234:
Included from /home/jayfoad2/git/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfo.td:1262:
Included from /home/jayfoad2/git/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoV.td:1166:
Included from /home/jayfoad2/git/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:4439:
/home/jayfoad2/git/llvm-project/llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td:388:13: error: Value specified for template argument 'VPatUSLoadStoreWholeVRSDNode::type' (#0) is of type ValueType; expected type LLVMType: vti.Vector
  defm "" : VPatUSLoadStoreWholeVRSDNode<vti.Vector, vti.SEW, vti.LMul,
            ^
[150/1042] Building AMDGPUGenInstrInfo.inc...
ninja: build stopped: subcommand failed.

Could this be caused by your patch? Or maybe it's D96416?