This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Permit select() to erase.
ClosedPublic

Authored by ab on Jul 28 2016, 9:26 AM.

Details

Summary

This lets the selector erase instructions, which is incompatible with reverse iterators. The code is pretty awkward, but I'm not sure there's anything cleaner to be done (short of having select() return iterators, which I'd rather avoid if unnecessary).

This also lets us dump all "selected" instructions (really, just the instructions between prev(MI) and next(MI)); I'll commit separately but these seem worth reviewing together.

WDYT?

Diff Detail

Repository
rL LLVM

Event Timeline

ab updated this revision to Diff 65948.Jul 28 2016, 9:26 AM
ab retitled this revision from to [GlobalISel] Permit select() to erase..
ab updated this object.
ab added reviewers: t.p.northover, tstellarAMD.
ab added subscribers: qcolombet, llvm-commits.

This patch fixes the crash for me.

Drive-by review here.

lib/CodeGen/GlobalISel/InstructionSelect.cpp
75–78 ↗(On Diff #65948)

nit: How about doing the --MII in the for statement?

for (auto MII = ...; !ReachedBegin; --MII) {
  ...
  ReachedBegin = MII == Begin;
  ...
}
t.p.northover accepted this revision.Nov 8 2016, 11:11 AM
t.p.northover edited edge metadata.

I think it's reasonable. I'll commit it later today unless Ahmed beats me to it. Sorry about the delay.

This revision is now accepted and ready to land.Nov 8 2016, 11:11 AM
This revision was automatically updated to reflect the committed changes.