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–222 | Maybe add an assert(Output.getSubReg() == 0); just to document that we do not write subregisters with Phis. | |
213–221 | 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 | ||
4–8 | You can remove the whole IR block in this case. | |
22 | 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 | Ha, indeed. |
Why go through the trouble of creating a new output register? You should be able to reuse "OutputReg" and not do any replaceRegWith operation.