This is an archive of the discontinued LLVM Phabricator instance.

Atomic-IR pass: move out into generic area
ClosedPublic

Authored by t.p.northover on Apr 11 2014, 8:53 AM.

Details

Summary

Hi,

I think the atomic expansion pass is now doing nicely in the ARM backend, so I'd like to move towards making it more generally available by putting it somewhere in lib/CodeGen. After this I'll switch ARM64 over in short order, but I can cope with that part on my own as long as the overall design is sound.

This move probably means the code should have stricter requirements on documentation, naming & cleanliness (in particular any layering violations; I wasn't very sure about putting hooks involving IRBuilder into TargetLowering.h), so I'm asking if people can take another look at it.

As part of the move I've added the necessary hooks for it to be executed directly from opt, and some direct IR-level tests.

Does it look good? Does anyone else have any suggestions on where things should go?

Cheers.

Tim.

Diff Detail

Event Timeline

I don't see anything terrible in the pass or how you've written it. I can't comment on the atomic lowerings itself without a much closer look.

I don't see anything terrible in the pass or how you've written it. I can't comment on the atomic lowerings itself without a much closer look.

Thanks very much for taking a look, Eric. I'm reasonably confident
about the lowerings themselves (far more than I am about even the
existing MachineInstr stuff; I spotted a couple of dodgy points while
porting, around extension & max/min).

I've committed it as r206485.

Tim.

t.p.northover accepted this revision.Apr 17 2014, 11:29 AM
t.p.northover closed this revision.
lib/CodeGen/CodeGen.cpp