So it appears that in a lot of cases before registerbanks are selected, we dont have Register classes and MIR-Canon is crashing. This attempts to fix this by creating new override registers that use the generic type rather than the register class.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/CodeGen/MIRCanonicalizerPass.cpp | ||
---|---|---|
320 | I think that the do is superfluous | |
325 | I think that this can just be return MRI.getRegClassOrNull(VReg0) || MRI.getType(VReg0) == MRI.getType(VReg1); | |
519 | Why not sink the get into the conditional? if (auto RC = MRI.getRegClassOrNull(VReg)) return MRI.createVirtualRegister(RC, OS.str()); |
Comment Actions
Going to leave out the vregTypesMatch part as that changes some of the behavior in a way that causes llvm/test/CodeGen/MIR/AMDGPU/mir-canon-multi.mir to fail, and I'd like to understand why that is happening. But for now this change makes the cursor create vregs based on the vreg type if there is no register class to base off of.
Why not sink the get into the conditional?