mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-22 20:18:38 +00:00
815b02e9ce
two fixes with one about error verify-regalloc reported, and another about live range update of phi after rematerialization. r265547: Replace analyzeSiblingValues with new algorithm to fix its compile time issue. The patch is to solve PR17409 and its duplicates. analyzeSiblingValues is a N x N complexity algorithm where N is the number of siblings generated by reg splitting. Although it causes siginificant compile time issue when N is large, it is also important for performance since it removes redundent spills and enables rematerialization. To solve the compile time issue, the patch removes analyzeSiblingValues and replaces it with lower cost alternatives containing two parts. The first part creates a new spill hoisting method in postOptimization of register allocation. It does spill hoisting at once after all the spills are generated instead of inside every instance of selectOrSplit. The second part queries the define expr of the original register for rematerializaiton and keep it always available during register allocation even if it is already dead. It deletes those dead instructions only in postOptimization. With the two parts in the patch, it can remove analyzeSiblingValues without sacrificing performance. Patches on top of r265547: r265610 "Fix the compare-clang diff error introduced by r265547." r265639 "Fix the sanitizer bootstrap error in r265547." r265657 "InlineSpiller.cpp: Escap \@ in r265547. [-Wdocumentation]" Differential Revision: http://reviews.llvm.org/D15302 Differential Revision: http://reviews.llvm.org/D18934 Differential Revision: http://reviews.llvm.org/D18935 Differential Revision: http://reviews.llvm.org/D18936 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266162 91177308-0d34-0410-b5e6-96231b3b80d8
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
//===-- llvm/CodeGen/Spiller.h - Spiller -*- C++ -*------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_LIB_CODEGEN_SPILLER_H
|
|
#define LLVM_LIB_CODEGEN_SPILLER_H
|
|
|
|
namespace llvm {
|
|
|
|
class LiveRangeEdit;
|
|
class MachineFunction;
|
|
class MachineFunctionPass;
|
|
class VirtRegMap;
|
|
class LiveIntervals;
|
|
|
|
/// Spiller interface.
|
|
///
|
|
/// Implementations are utility classes which insert spill or remat code on
|
|
/// demand.
|
|
class Spiller {
|
|
virtual void anchor();
|
|
public:
|
|
virtual ~Spiller() = 0;
|
|
|
|
/// spill - Spill the LRE.getParent() live interval.
|
|
virtual void spill(LiveRangeEdit &LRE) = 0;
|
|
virtual void postOptimization(){};
|
|
};
|
|
|
|
/// Create and return a spiller that will insert spill code directly instead
|
|
/// of deferring though VirtRegMap.
|
|
Spiller *createInlineSpiller(MachineFunctionPass &pass,
|
|
MachineFunction &mf,
|
|
VirtRegMap &vrm);
|
|
}
|
|
|
|
#endif
|