This is an archive of the discontinued LLVM Phabricator instance.

CodeGen: Refactor regallocator command line and target selection
ClosedPublic

Authored by arsenm on Dec 4 2018, 10:00 AM.

Details

Reviewers
MatzeB
qcolombet
Summary

This will allow targets more flexibility to replace the
register allocator core passes. In a future commit,
AMDGPU will run the core register assignment passes
twice, and will also want to disallow using the
standard -regalloc option.

Diff Detail

Event Timeline

arsenm created this revision.Dec 4 2018, 10:00 AM
aheejin added inline comments.Dec 4 2018, 9:21 PM
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
191

Could you clang-format these? clang-format would place these short functions in a single line.

arsenm updated this revision to Diff 186693.Feb 13 2019, 10:21 AM
arsenm added a reviewer: qcolombet.

clang-format

qcolombet added inline comments.Feb 22 2019, 9:03 AM
include/llvm/CodeGen/TargetPassConfig.h
438

Should the hook says Assignment *and* rewriting?

lib/CodeGen/TargetPassConfig.cpp
900–902

No braces

1114

Where do you draw the line of which pass to pull in that method?
In particular, why pull StackSlotColoring and not MachineCopyPropagation for instance.

arsenm updated this revision to Diff 187948.Feb 22 2019, 10:30 AM
arsenm marked an inline comment as done.

Rename hook, move StackSlotColoring

qcolombet accepted this revision.Feb 22 2019, 11:57 AM

LGTM, one last nitpick below.

lib/CodeGen/TargetPassConfig.cpp
1106

Add a comment on the declaration of addPreRewrite that it may not be honored if the target overloads addRegAssignAndRewriteOptimized or more generally doesn't actually have two distinct passes (e.g., the fast variant wouldn't call into addPreRewrite).

This revision is now accepted and ready to land.Feb 22 2019, 11:57 AM
arsenm closed this revision.Mar 19 2019, 12:32 PM
arsenm marked an inline comment as done.

r356506