Page MenuHomePhabricator

[BranchFolding] do not iterate the aliases of virtual registers
ClosedPublic

Authored by jingyue on Jul 13 2015, 10:15 PM.

Details

Summary

MCRegAliasIterator only works for physical registers. So, do not run it
on virtual registers.

With this issue fixed, we can resurrect the BranchFolding pass in NVPTX
backend.

Diff Detail

Repository
rL LLVM

Event Timeline

jingyue updated this revision to Diff 29643.Jul 13 2015, 10:15 PM
jingyue retitled this revision from to [BranchFolding] do not iterate the aliases of virtual registers.
jingyue updated this object.
jingyue added reviewers: bkramer, jholewinski.
jingyue added subscribers: llvm-commits, meheff, henryhu.
bkramer edited edge metadata.Jul 21 2015, 3:29 PM

This looks good with one comment below. Also the top comment in this file could use an update so it's clear that the pass has to handle vregs too.

lib/CodeGen/BranchFolding.cpp
1812–1816 ↗(On Diff #29643)

The alias iterator has the IncludeSelf flag set, so shouldn't Reg be removed from the set even if it's a vreg?

jingyue updated this revision to Diff 30311.Jul 21 2015, 7:45 PM
jingyue edited edge metadata.

fixed the bug Ben pointed out

jingyue marked an inline comment as done.Jul 21 2015, 7:45 PM

Nice catch. Thank you!

jingyue updated this revision to Diff 30313.Jul 21 2015, 7:56 PM

update header comments

This revision was automatically updated to reflect the committed changes.