When a PHI operand has a subregister, create a COPY into a new register instead of simply replacing the PHI output with it.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/UnreachableBlockElim.cpp | ||
---|---|---|
208 ↗ | (On Diff #97126) | Maybe add an assert(Output.getSubReg() == 0); just to document that we do not write subregisters with Phis. |
213–221 ↗ | (On Diff #97126) | Why go through the trouble of creating a new output register? You should be able to reuse "OutputReg" and not do any replaceRegWith operation. |
test/CodeGen/Hexagon/unreachable-mbb-phi-subreg.mir | ||
3–7 ↗ | (On Diff #97126) | You can remove the whole IR block in this case. |
21 ↗ | (On Diff #97126) | And there's this new cool syntax (the MIPrinter just doesn't know how to use it yet), where you can do %0 : doubleregs = COPY %d0 ... %1 : intregs = PHI ... instead of using a registers: block. |
lib/CodeGen/UnreachableBlockElim.cpp | ||
---|---|---|
213–221 ↗ | (On Diff #97126) | Ha, indeed. |