diff options
author | Derek Schuff <dschuff@google.com> | 2016-03-28 17:05:30 +0000 |
---|---|---|
committer | Derek Schuff <dschuff@google.com> | 2016-03-28 17:05:30 +0000 |
commit | ad154c837e4428842cfe5c0f9dbfcc42ba7a1454 (patch) | |
tree | d2814494f2f8e2c72605d033d9ef6b566fa6e223 /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | |
parent | 77e2128580e0fdaf6091454d8f04277e8abf74f7 (diff) | |
download | bcm5719-llvm-ad154c837e4428842cfe5c0f9dbfcc42ba7a1454.tar.gz bcm5719-llvm-ad154c837e4428842cfe5c0f9dbfcc42ba7a1454.zip |
Introduce MachineFunctionProperties and the AllVRegsAllocated property
MachineFunctionProperties represents a set of properties that a MachineFunction
can have at particular points in time. Existing examples of this idea are
MachineRegisterInfo::isSSA() and MachineRegisterInfo::tracksLiveness() which
will eventually be switched to use this mechanism.
This change introduces the AllVRegsAllocated property; i.e. the property that
all virtual registers have been allocated and there are no VReg operands
left.
With this mechanism, passes can declare that they require a particular property
to be set, or that they set or clear properties by implementing e.g.
MachineFunctionPass::getRequiredProperties(). The MachineFunctionPass base class
verifies that the requirements are met, and handles the setting and clearing
based on the delcarations. Passes can also directly query and update the current
properties of the MF if they want to have conditional behavior.
This change annotates the target-independent post-regalloc passes; future
changes will also annotate target-specific ones.
Reviewers: qcolombet, hfinkel
Differential Revision: http://reviews.llvm.org/D18421
llvm-svn: 264593
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp index 2e4ed625fad..ba13c2f97af 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -106,6 +106,8 @@ public: bool addILPOpts() override; void addPreRegAlloc() override; void addPostRegAlloc() override; + void addMachineLateOptimization() override; + bool addGCPasses() override { return false; } void addPreEmitPass() override; }; } // end anonymous namespace @@ -179,6 +181,9 @@ void WebAssemblyPassConfig::addPostRegAlloc() { // virtual registers. Consider removing their restrictions and re-enabling // them. // + + // Has no asserts of its own, but was not written to handle virtual regs. + disablePass(&ShrinkWrapID); // We use our own PrologEpilogInserter which is very slightly modified to // tolerate virtual registers. disablePass(&PrologEpilogCodeInserterID); @@ -201,11 +206,20 @@ void WebAssemblyPassConfig::addPostRegAlloc() { addPass(createWebAssemblyPEI()); } +void WebAssemblyPassConfig::addMachineLateOptimization() { + disablePass(&MachineCopyPropagationID); + disablePass(&PostRASchedulerID); + TargetPassConfig::addMachineLateOptimization(); +} + void WebAssemblyPassConfig::addPreEmitPass() { TargetPassConfig::addPreEmitPass(); // Eliminate multiple-entry loops. addPass(createWebAssemblyFixIrreducibleControlFlow()); + disablePass(&FuncletLayoutID); + disablePass(&StackMapLivenessID); + disablePass(&LiveDebugValuesID); // Put the CFG in structured form; insert BLOCK and LOOP markers. addPass(createWebAssemblyCFGStackify()); |