This is an archive of the discontinued LLVM Phabricator instance.

[MachineDCE] Predicated instructions shouldn't clear LivePhysRegs.
AbandonedPublic

Authored by kariddi on Apr 14 2020, 6:13 PM.

Details

Summary

Predicated instructions might not endup being executed. If that happens
they don't really kill the registers they right, so we can't DCE
instructions that are overwritten by potentially predicated
instructions. Fixing MachineDCE to reflect that.

Diff Detail

Event Timeline

kariddi created this revision.Apr 14 2020, 6:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2020, 6:13 PM

Typo in commit message: "registers they right,".
Otherwise looks reasonable for me, but need someone from Hexagon BE to review it.

This isn't completely correct. Predicated instructions should have implicit use of the register that they are modifying (unless it's undefined). The cmoveit doesn't have it. How did you get this MIR?

hgreving requested changes to this revision.Apr 16 2020, 7:21 AM

s/kill the registers they right/kill the registers they write/

so we can't DCE instructions that are overwritten by potentially predicated instructions

nit: re-phrase?

This revision now requires changes to proceed.Apr 16 2020, 7:21 AM
kariddi abandoned this revision.Apr 16 2020, 3:14 PM

I'm abandoning this for now based on the fact that I have another patch that ports DeadMachineInstrs to LivePhysRegs. LivePhysRegs though doesn't seem to care about predicates as well ... Probably the fix might need to go there