Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Hi,
I ran into a verifier error after PHIElimination with this patch.
I saw this for my out-of-tree target, but I think the following mir-testcase exposes the same thing on X86:
llc -verify-machineinstrs -o /dev/null bbi-61405_x86.mir -run-pass=livevars,phi-node-elimination,twoaddressinstruction
Result:
*** Bad machine code: LiveVariables: Block should not be in AliveBlocks *** - function: f245 - basic block: %bb.1 (0x7353b68) Virtual register %6 is not needed live through the block. LLVM ERROR: Found 1 machine code errors.
It seems to be the undef use of %6 in
dead %2:gr16 = PHI undef %6, %bb.1, undef %3, %bb.5
that trips PHI Elimination over.
Without it, the inserted COPY for the other PHI gets a kill marking on its source (%6), and all is fine.
But with the "undef %6" operand in the second PHI, the kill marking is skipped and then we get the verifier error.