This is an archive of the discontinued LLVM Phabricator instance.

MIR: Infer not-SSA for subregister defs
ClosedPublic

Authored by arsenm on Jun 29 2020, 6:30 AM.

Details

Summary

It's possible to have a single virtual register def with a subreg
index that would pass the previous check, but it's not possible to
have a subregister def in SSA.

This is in preparation for adding stricter checks for SSA MIR.

Diff Detail

Event Timeline

arsenm created this revision.Jun 29 2020, 6:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 29 2020, 6:30 AM
thegameg added inline comments.Jul 1 2020, 8:09 AM
llvm/include/llvm/CodeGen/MachineRegisterInfo.h
453

There is a MachineInstr *getUniqueVRegDef(Register Reg) const;. Maybe name this one getUniqueVRegDefOperand? Are they actually vreg-only?

arsenm marked an inline comment as done.Jul 9 2020, 7:28 AM
arsenm added inline comments.
llvm/include/llvm/CodeGen/MachineRegisterInfo.h
453

I guess this would technically work for physical registers. I picked the name to mirror the existing hasOneDef just above

qcolombet accepted this revision.Aug 21 2020, 11:47 AM

LGTM

llvm/lib/CodeGen/MIRParser/MIRParser.cpp
330

Replying to the FIXME: Unclear, if Reg is a reserved reg, maybe that's fine.
I could also be that we removed the implicit_defs.

This revision is now accepted and ready to land.Aug 21 2020, 11:47 AM
arsenm added inline comments.Aug 21 2020, 12:19 PM
llvm/lib/CodeGen/MIRParser/MIRParser.cpp
330

I was working on making it illegal to remove implicit_defs in ssa at the time I did this; however the complication is implicit_defs are folded into undef operands just before phi elimination so we end up in a weird half-SSA state