[PATCH] D129735: [RISCV] Add new pass to transform undef to pesudo for vector values.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 29 16:54:03 PST 2022
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:73
+ MachineBasicBlock::iterator &Inst);
+ bool isVectorRegClass(const Register &R);
+ bool handleSubRegister(MachineBasicBlock &MBB,
----------------
You can pass Register by value
================
Comment at: llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:105
+ } while (Super);
+ // If we don't encounter VR then return origin one.
+ return RC;
----------------
origin -> original
================
Comment at: llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp:110
+bool RISCVInitUndef::isVectorRegClass(const Register &R) {
+ unsigned RegClassID = getVRLargestSuperClass(MRI->getRegClass(R))->getID();
+ switch (RegClassID) {
----------------
Can't we do something like
```
VRRegClass.hasSubClassEq(MRI->getRegClass(R)) ||
VRM2RegClass.hasSubClassEq(MRI->getRegClass(R)) ||
VRM4RegClass.hasSubClassEq(MRI->getRegClass(R)) ||
VRM8RegClass.hasSubClassEq(MRI->getRegClass(R))
```
why do we need to use getVRLargestSuperClass?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129735/new/
https://reviews.llvm.org/D129735
More information about the llvm-commits
mailing list