[llvm] [RISCV] Remove SEW operand for load/store and SEW-aware pseudos (PR #90396)
Michael Maitland via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 09:01:32 PDT 2024
================
@@ -769,15 +769,20 @@ class GetVTypeScalarPredicates<VTypeInfo vti> {
class VPseudoUSLoadNoMask<VReg RetClass,
int EEW> :
Pseudo<(outs RetClass:$rd),
- (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$sew,
- ixlenimm:$policy), []>,
+ !if(!eq(EEW, 1),
+ (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$sew, ixlenimm:$policy),
+ (ins RetClass:$dest, GPRMem:$rs1, AVL:$vl, ixlenimm:$policy)), []>,
RISCVVPseudo,
RISCVVLE</*Masked*/0, /*Strided*/0, /*FF*/0, !logtwo(EEW), VLMul> {
let mayLoad = 1;
let mayStore = 0;
let hasSideEffects = 0;
let HasVLOp = 1;
- let HasSEWOp = 1;
+ defvar hasSEWOp = !eq(EEW, 1);
+ let HasSEWOp = hasSEWOp;
+ // For mask load, EEW = 1.
+ let HasImplictSEW = !not(hasSEWOp);
----------------
michaelmaitland wrote:
nit: I'm not sure if you can do this but would it be simpler to do:
```
let HasSEWOp = !eq(EEW, 1);
// For mask load, EEW = 1.
let HasImplictSEW = !not(HasSEWOp);
let VSEW = !if(HasSEWOp, 0, !logtwo(!div(EEW, 8)));
```
If that is not valid tablegen, please feel free to ignore this comment.
https://github.com/llvm/llvm-project/pull/90396
More information about the llvm-commits
mailing list