This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: refactor swifterror tracking into CodeGen
ClosedPublic

Authored by t.p.northover on May 22 2019, 4:33 AM.

Details

Reviewers
aemerson
Summary

The special "swifterror" attribute is basically a register pretending to be a pointer in IR, so it needs a mini-mem2reg to implement the liveness and value tracking. Until now this has lived in FunctionLoweringInfo, but it's also usable virtually unchanged for GlobalIsel, provided we can get it out of lib/CodeGen/SelectionDAG.

So this patch extracts those facilities into a separate class that lives under just lib/CodeGen. The bulk of the code is identical, but I made a couple of interface improvements while I was there.

  1. Removed redundant "SwiftError" name components.
  2. Simplified the interface for the getOrCreateVReg* functions. The Def function was always used in conjunction with setCurrentVReg so I merged them, allowing the functions to return a simple register rather than a pair.

There should be no functional change, so no tests.

Diff Detail

Repository
rL LLVM

Event Timeline

t.p.northover created this revision.May 22 2019, 4:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2019, 4:33 AM
aemerson accepted this revision.May 23 2019, 9:12 AM

LGTM, thanks!

This revision is now accepted and ready to land.May 23 2019, 9:12 AM
t.p.northover closed this revision.May 24 2019, 1:37 AM

Thanks Amara. Committed as r361607.