[PATCH] D62543: [MIR-Canon] Add support for rewriting VRegs that are typed but don't have an RC.
Saleem Abdulrasool via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 28 12:00:56 PDT 2019
compnerd added inline comments.
================
Comment at: llvm/lib/CodeGen/MIRCanonicalizerPass.cpp:320
+static bool doVRegTypesMatch(const MachineRegisterInfo &MRI, unsigned VReg0,
+ unsigned VReg1) {
----------------
I think that the `do` is superfluous
================
Comment at: llvm/lib/CodeGen/MIRCanonicalizerPass.cpp:325
+ ? true
+ : MRI.getType(VReg0) == MRI.getType(VReg1);
+ return false;
----------------
I think that this can just be `return MRI.getRegClassOrNull(VReg0) || MRI.getType(VReg0) == MRI.getType(VReg1);`
================
Comment at: llvm/lib/CodeGen/MIRCanonicalizerPass.cpp:519
virtualVRegNumber++;
-
- return MRI.createVirtualRegister(RC, OS.str());
+ if (RC)
+ return MRI.createVirtualRegister(RC, OS.str());
----------------
Why not sink the get into the conditional?
```
if (auto RC = MRI.getRegClassOrNull(VReg))
return MRI.createVirtualRegister(RC, OS.str());
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D62543/new/
https://reviews.llvm.org/D62543
More information about the llvm-commits
mailing list