<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I reverted for now.</div><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 22, 2016, at 10:17 PM, Vitaly Buka via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">heap-use-after-free is in this patch: <a href="http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15737/steps/check-clang%20asan/logs/stdio" class="">http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/15737/steps/check-clang%20asan/logs/stdio</a><br class=""></div><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Mon, Aug 22, 2016 at 8:28 PM Matthias Braun via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: matze<br class="">
Date: Mon Aug 22 22:20:09 2016<br class="">
New Revision: 279502<br class="">
<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=279502&view=rev" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project?rev=279502&view=rev</a><br class="">
Log:<br class="">
CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses<br class="">
<br class="">
This patch removes the MachineFunctionAnalysis. Instead we keep a<br class="">
map from IR Function to MachineFunction in the MachineModuleInfo.<br class="">
<br class="">
This allows the insertion of ModulePasses into the codegen pipeline<br class="">
without breaking it because the MachineFunctionAnalysis gets dropped<br class="">
before a module pass.<br class="">
<br class="">
Peak memory should stay unchanged without a ModulePass in the codegen<br class="">
pipeline: Previously the MachineFunction was freed at the end of a codegen<br class="">
function pipeline because the MachineFunctionAnalysis was dropped; With<br class="">
this patch the MachineFunction is freed after the AsmPrinter has<br class="">
finished.<br class="">
<br class="">
Differential Revision: <a href="http://reviews.llvm.org/D23736" rel="noreferrer" target="_blank" class="">http://reviews.llvm.org/D23736</a><br class="">
<br class="">
Removed:<br class="">
llvm/trunk/include/llvm/CodeGen/MachineFunctionAnalysis.h<br class="">
llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp<br class="">
Modified:<br class="">
llvm/trunk/include/llvm/CodeGen/AsmPrinter.h<br class="">
llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h<br class="">
llvm/trunk/include/llvm/Target/TargetMachine.h<br class="">
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br class="">
llvm/trunk/lib/CodeGen/CMakeLists.txt<br class="">
llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp<br class="">
llvm/trunk/lib/CodeGen/MachineFunctionPass.cpp<br class="">
llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp<br class="">
llvm/trunk/lib/CodeGen/StackMapLivenessAnalysis.cpp<br class="">
llvm/trunk/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp<br class="">
llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp<br class="">
llvm/trunk/lib/Target/Hexagon/HexagonGenExtract.cpp<br class="">
llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp<br class="">
llvm/trunk/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp<br class="">
llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp<br class="">
llvm/trunk/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp<br class="">
llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp<br class="">
llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp<br class="">
llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp<br class="">
llvm/trunk/test/CodeGen/Generic/stop-after.ll<br class="">
llvm/trunk/test/CodeGen/X86/hidden-vis-pic.ll<br class="">
llvm/trunk/tools/llc/llc.cpp<br class="">
llvm/trunk/unittests/MI/LiveIntervalTest.cpp<br class="">
<br class="">
Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)<br class="">
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Mon Aug 22 22:20:09 2016<br class="">
@@ -204,11 +204,7 @@ public:<br class="">
bool doFinalization(Module &M) override;<br class="">
<br class="">
/// Emit the specified function out to the OutStreamer.<br class="">
- bool runOnMachineFunction(MachineFunction &MF) override {<br class="">
- SetupMachineFunction(MF);<br class="">
- EmitFunctionBody();<br class="">
- return false;<br class="">
- }<br class="">
+ bool runOnMachineFunction(MachineFunction &MF) override;<br class="">
<br class="">
//===------------------------------------------------------------------===//<br class="">
// Coarse grained IR lowering routines.<br class="">
<br class="">
Removed: llvm/trunk/include/llvm/CodeGen/MachineFunctionAnalysis.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunctionAnalysis.h?rev=279501&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunctionAnalysis.h?rev=279501&view=auto</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/include/llvm/CodeGen/MachineFunctionAnalysis.h (original)<br class="">
+++ llvm/trunk/include/llvm/CodeGen/MachineFunctionAnalysis.h (removed)<br class="">
@@ -1,55 +0,0 @@<br class="">
-//===-- MachineFunctionAnalysis.h - Owner of MachineFunctions ----*-C++ -*-===//<br class="">
-//<br class="">
-// The LLVM Compiler Infrastructure<br class="">
-//<br class="">
-// This file is distributed under the University of Illinois Open Source<br class="">
-// License. See LICENSE.TXT for details.<br class="">
-//<br class="">
-//===----------------------------------------------------------------------===//<br class="">
-//<br class="">
-// This file declares the MachineFunctionAnalysis class.<br class="">
-//<br class="">
-//===----------------------------------------------------------------------===//<br class="">
-<br class="">
-#ifndef LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H<br class="">
-#define LLVM_CODEGEN_MACHINEFUNCTIONANALYSIS_H<br class="">
-<br class="">
-#include "llvm/Pass.h"<br class="">
-<br class="">
-namespace llvm {<br class="">
-<br class="">
-class MachineFunction;<br class="">
-class MachineFunctionInitializer;<br class="">
-class TargetMachine;<br class="">
-<br class="">
-/// MachineFunctionAnalysis - This class is a Pass that manages a<br class="">
-/// MachineFunction object.<br class="">
-struct MachineFunctionAnalysis : public FunctionPass {<br class="">
-private:<br class="">
- const TargetMachine &TM;<br class="">
- MachineFunction *MF;<br class="">
- unsigned NextFnNum;<br class="">
- MachineFunctionInitializer *MFInitializer;<br class="">
-<br class="">
-public:<br class="">
- static char ID;<br class="">
- explicit MachineFunctionAnalysis(const TargetMachine &tm,<br class="">
- MachineFunctionInitializer *MFInitializer);<br class="">
- ~MachineFunctionAnalysis() override;<br class="">
-<br class="">
- MachineFunction &getMF() const { return *MF; }<br class="">
-<br class="">
- const char* getPassName() const override {<br class="">
- return "Machine Function Analysis";<br class="">
- }<br class="">
-<br class="">
-private:<br class="">
- bool doInitialization(Module &M) override;<br class="">
- bool runOnFunction(Function &F) override;<br class="">
- void releaseMemory() override;<br class="">
- void getAnalysisUsage(AnalysisUsage &AU) const override;<br class="">
-};<br class="">
-<br class="">
-} // End llvm namespace<br class="">
-<br class="">
-#endif<br class="">
<br class="">
Modified: llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h (original)<br class="">
+++ llvm/trunk/include/llvm/CodeGen/MachineModuleInfo.h Mon Aug 22 22:20:09 2016<br class="">
@@ -54,6 +54,7 @@ class BlockAddress;<br class="">
class MDNode;<br class="">
class MMIAddrLabelMap;<br class="">
class MachineBasicBlock;<br class="">
+class MachineFunctionInitializer;<br class="">
class MachineFunction;<br class="">
class Module;<br class="">
class PointerType;<br class="">
@@ -107,6 +108,8 @@ protected:<br class="">
/// schemes and reformated for specific use.<br class="">
///<br class="">
class MachineModuleInfo : public ImmutablePass {<br class="">
+ const TargetMachine &TM;<br class="">
+<br class="">
/// Context - This is the MCContext used for the entire code generator.<br class="">
MCContext Context;<br class="">
<br class="">
@@ -184,6 +187,12 @@ class MachineModuleInfo : public Immutab<br class="">
<br class="">
EHPersonality PersonalityTypeCache;<br class="">
<br class="">
+ MachineFunctionInitializer *MFInitializer;<br class="">
+ /// Maps IR Functions to their corresponding MachineFunctions.<br class="">
+ DenseMap<const Function*, std::unique_ptr<MachineFunction>> MachineFunctions;<br class="">
+ const Function *LastRequest = nullptr; ///< Used for shortcut/cache.<br class="">
+ MachineFunction *LastResult = nullptr; ///< Used for shortcut/cache.<br class="">
+<br class="">
public:<br class="">
static char ID; // Pass identification, replacement for typeid<br class="">
<br class="">
@@ -202,8 +211,9 @@ public:<br class="">
<br class="">
MachineModuleInfo(); // DUMMY CONSTRUCTOR, DO NOT CALL.<br class="">
// Real constructor.<br class="">
- MachineModuleInfo(const MCAsmInfo &MAI, const MCRegisterInfo &MRI,<br class="">
- const MCObjectFileInfo *MOFI);<br class="">
+ MachineModuleInfo(const TargetMachine &TM, const MCAsmInfo &MAI,<br class="">
+ const MCRegisterInfo &MRI, const MCObjectFileInfo *MOFI,<br class="">
+ MachineFunctionInitializer *MFInitializer = nullptr);<br class="">
~MachineModuleInfo() override;<br class="">
<br class="">
// Initialization and Finalization<br class="">
@@ -220,6 +230,15 @@ public:<br class="">
void setModule(const Module *M) { TheModule = M; }<br class="">
const Module *getModule() const { return TheModule; }<br class="">
<br class="">
+ /// Returns the MachineFunction constructed for the IR function \p F.<br class="">
+ /// Creates a new MachineFunction and runs the MachineFunctionInitializer<br class="">
+ /// if none exists yet.<br class="">
+ MachineFunction &getMachineFunction(const Function &F);<br class="">
+<br class="">
+ /// \brief Delete the MachineFunction \p MF and reset the link in the IR<br class="">
+ /// Function to Machine Function map.<br class="">
+ void deleteMachineFunction(MachineFunction &MF);<br class="">
+<br class="">
/// getInfo - Keep track of various per-function pieces of information for<br class="">
/// backends that would like to do so.<br class="">
///<br class="">
<br class="">
Modified: llvm/trunk/include/llvm/Target/TargetMachine.h<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachine.h?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/include/llvm/Target/TargetMachine.h (original)<br class="">
+++ llvm/trunk/include/llvm/Target/TargetMachine.h Mon Aug 22 22:20:09 2016<br class="">
@@ -314,11 +314,8 @@ public:<br class="">
bool DisableVerify = true) override;<br class="">
<br class="">
/// Add MachineModuleInfo pass to pass manager.<br class="">
- MachineModuleInfo &addMachineModuleInfo(PassManagerBase &PM) const;<br class="">
-<br class="">
- /// Add MachineFunctionAnalysis pass to pass manager.<br class="">
- void addMachineFunctionAnalysis(PassManagerBase &PM,<br class="">
- MachineFunctionInitializer *MFInitializer) const;<br class="">
+ MachineModuleInfo &addMachineModuleInfo(PassManagerBase &PM,<br class="">
+ MachineFunctionInitializer *MFI = nullptr) const;<br class="">
};<br class="">
<br class="">
} // End llvm namespace<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -2571,7 +2571,14 @@ isBlockOnlyReachableByFallthrough(const<br class="">
return true;<br class="">
}<br class="">
<br class="">
+bool AsmPrinter::runOnMachineFunction(MachineFunction &MF) {<br class="">
+ SetupMachineFunction(MF);<br class="">
+ EmitFunctionBody();<br class="">
<br class="">
+ MachineModuleInfo &MMI = getAnalysis<MachineModuleInfo>();<br class="">
+ MMI.deleteMachineFunction(MF);<br class="">
+ return false;<br class="">
+}<br class="">
<br class="">
GCMetadataPrinter *AsmPrinter::GetOrCreateGCPrinter(GCStrategy &S) {<br class="">
if (!S.usesMetadata())<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/CMakeLists.txt<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CMakeLists.txt?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/CMakeLists.txt (original)<br class="">
+++ llvm/trunk/lib/CodeGen/CMakeLists.txt Mon Aug 22 22:20:09 2016<br class="">
@@ -59,7 +59,6 @@ add_llvm_library(LLVMCodeGen<br class="">
MachineCSE.cpp<br class="">
MachineDominanceFrontier.cpp<br class="">
MachineDominators.cpp<br class="">
- MachineFunctionAnalysis.cpp<br class="">
MachineFunction.cpp<br class="">
MachineFunctionPass.cpp<br class="">
MachineFunctionPrinterPass.cpp<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/LLVMTargetMachine.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -15,7 +15,6 @@<br class="">
#include "llvm/Analysis/Passes.h"<br class="">
#include "llvm/CodeGen/AsmPrinter.h"<br class="">
#include "llvm/CodeGen/BasicTTIImpl.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineModuleInfo.h"<br class="">
#include "llvm/CodeGen/Passes.h"<br class="">
#include "llvm/CodeGen/TargetPassConfig.h"<br class="">
@@ -103,19 +102,15 @@ TargetIRAnalysis LLVMTargetMachine::getT<br class="">
}<br class="">
<br class="">
MachineModuleInfo &<br class="">
-LLVMTargetMachine::addMachineModuleInfo(PassManagerBase &PM) const {<br class="">
- MachineModuleInfo *MMI = new MachineModuleInfo(*getMCAsmInfo(),<br class="">
+LLVMTargetMachine::addMachineModuleInfo(PassManagerBase &PM,<br class="">
+ MachineFunctionInitializer *MFI) const {<br class="">
+ MachineModuleInfo *MMI = new MachineModuleInfo(*this, *getMCAsmInfo(),<br class="">
*getMCRegisterInfo(),<br class="">
- getObjFileLowering());<br class="">
+ getObjFileLowering(), MFI);<br class="">
PM.add(MMI);<br class="">
return *MMI;<br class="">
}<br class="">
<br class="">
-void LLVMTargetMachine::addMachineFunctionAnalysis(PassManagerBase &PM,<br class="">
- MachineFunctionInitializer *MFInitializer) const {<br class="">
- PM.add(new MachineFunctionAnalysis(*this, MFInitializer));<br class="">
-}<br class="">
-<br class="">
/// addPassesToX helper drives creation and initialization of TargetPassConfig.<br class="">
static MCContext *<br class="">
addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM,<br class="">
@@ -150,8 +145,7 @@ addPassesToGenerateCode(LLVMTargetMachin<br class="">
<br class="">
PassConfig->addISelPrepare();<br class="">
<br class="">
- MachineModuleInfo &MMI = TM->addMachineModuleInfo(PM);<br class="">
- TM->addMachineFunctionAnalysis(PM, MFInitializer);<br class="">
+ MachineModuleInfo &MMI = TM->addMachineModuleInfo(PM, MFInitializer);<br class="">
<br class="">
// Enable FastISel with -fast, but allow that to be overridden.<br class="">
TM->setO0WantsFastISel(EnableFastISelOption != cl::BOU_FALSE);<br class="">
<br class="">
Removed: llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp?rev=279501&view=auto" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp?rev=279501&view=auto</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/MachineFunctionAnalysis.cpp (removed)<br class="">
@@ -1,62 +0,0 @@<br class="">
-//===-- MachineFunctionAnalysis.cpp ---------------------------------------===//<br class="">
-//<br class="">
-// The LLVM Compiler Infrastructure<br class="">
-//<br class="">
-// This file is distributed under the University of Illinois Open Source<br class="">
-// License. See LICENSE.TXT for details.<br class="">
-//<br class="">
-//===----------------------------------------------------------------------===//<br class="">
-//<br class="">
-// This file contains the definitions of the MachineFunctionAnalysis members.<br class="">
-//<br class="">
-//===----------------------------------------------------------------------===//<br class="">
-<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
-#include "llvm/CodeGen/GCMetadata.h"<br class="">
-#include "llvm/CodeGen/MachineFunction.h"<br class="">
-#include "llvm/CodeGen/MachineModuleInfo.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionInitializer.h"<br class="">
-using namespace llvm;<br class="">
-<br class="">
-char MachineFunctionAnalysis::ID = 0;<br class="">
-<br class="">
-MachineFunctionAnalysis::MachineFunctionAnalysis(<br class="">
- const TargetMachine &tm, MachineFunctionInitializer *MFInitializer)<br class="">
- : FunctionPass(ID), TM(tm), MF(nullptr), MFInitializer(MFInitializer) {<br class="">
- initializeMachineModuleInfoPass(*PassRegistry::getPassRegistry());<br class="">
-}<br class="">
-<br class="">
-MachineFunctionAnalysis::~MachineFunctionAnalysis() {<br class="">
- releaseMemory();<br class="">
- assert(!MF && "MachineFunctionAnalysis left initialized!");<br class="">
-}<br class="">
-<br class="">
-void MachineFunctionAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {<br class="">
- AU.setPreservesAll();<br class="">
- AU.addRequired<MachineModuleInfo>();<br class="">
-}<br class="">
-<br class="">
-bool MachineFunctionAnalysis::doInitialization(Module &M) {<br class="">
- MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();<br class="">
- assert(MMI && "MMI not around yet??");<br class="">
- MMI->setModule(&M);<br class="">
- NextFnNum = 0;<br class="">
- return false;<br class="">
-}<br class="">
-<br class="">
-<br class="">
-bool MachineFunctionAnalysis::runOnFunction(Function &F) {<br class="">
- assert(!MF && "MachineFunctionAnalysis already initialized!");<br class="">
- MF = new MachineFunction(&F, TM, NextFnNum++,<br class="">
- getAnalysis<MachineModuleInfo>());<br class="">
- if (MFInitializer) {<br class="">
- if (MFInitializer->initializeMachineFunction(*MF))<br class="">
- report_fatal_error("Unable to initialize machine function");<br class="">
- }<br class="">
- return false;<br class="">
-}<br class="">
-<br class="">
-void MachineFunctionAnalysis::releaseMemory() {<br class="">
- delete MF;<br class="">
- MF = nullptr;<br class="">
-}<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/MachineFunctionPass.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionPass.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunctionPass.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/MachineFunctionPass.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/MachineFunctionPass.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -22,7 +22,7 @@<br class="">
#include "llvm/Analysis/ScalarEvolution.h"<br class="">
#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineFunction.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
+#include "llvm/CodeGen/MachineModuleInfo.h"<br class="">
#include "llvm/CodeGen/Passes.h"<br class="">
#include "llvm/CodeGen/StackProtector.h"<br class="">
#include "llvm/IR/Dominators.h"<br class="">
@@ -41,7 +41,9 @@ bool MachineFunctionPass::runOnFunction(<br class="">
if (F.hasAvailableExternallyLinkage())<br class="">
return false;<br class="">
<br class="">
- MachineFunction &MF = getAnalysis<MachineFunctionAnalysis>().getMF();<br class="">
+ MachineModuleInfo &MMI = getAnalysis<MachineModuleInfo>();<br class="">
+ MachineFunction &MF = MMI.getMachineFunction(F);<br class="">
+<br class="">
MachineFunctionProperties &MFProps = MF.getProperties();<br class="">
<br class="">
#ifndef NDEBUG<br class="">
@@ -65,8 +67,8 @@ bool MachineFunctionPass::runOnFunction(<br class="">
}<br class="">
<br class="">
void MachineFunctionPass::getAnalysisUsage(AnalysisUsage &AU) const {<br class="">
- AU.addRequired<MachineFunctionAnalysis>();<br class="">
- AU.addPreserved<MachineFunctionAnalysis>();<br class="">
+ AU.addRequired<MachineModuleInfo>();<br class="">
+ AU.addPreserved<MachineModuleInfo>();<br class="">
<br class="">
// MachineFunctionPass preserves all LLVM IR passes, but there's no<br class="">
// high-level way to express this. Instead, just list a bunch of<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/MachineModuleInfo.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -13,6 +13,7 @@<br class="">
#include "llvm/Analysis/EHPersonalities.h"<br class="">
#include "llvm/Analysis/ValueTracking.h"<br class="">
#include "llvm/CodeGen/MachineFunction.h"<br class="">
+#include "llvm/CodeGen/MachineFunctionInitializer.h"<br class="">
#include "llvm/CodeGen/MachineFunctionPass.h"<br class="">
#include "llvm/CodeGen/Passes.h"<br class="">
#include "llvm/IR/Constants.h"<br class="">
@@ -186,15 +187,19 @@ void MMIAddrLabelMapCallbackPtr::allUses<br class="">
<br class="">
//===----------------------------------------------------------------------===//<br class="">
<br class="">
-MachineModuleInfo::MachineModuleInfo(const MCAsmInfo &MAI,<br class="">
+MachineModuleInfo::MachineModuleInfo(const TargetMachine &TM,<br class="">
+ const MCAsmInfo &MAI,<br class="">
const MCRegisterInfo &MRI,<br class="">
- const MCObjectFileInfo *MOFI)<br class="">
- : ImmutablePass(ID), Context(&MAI, &MRI, MOFI, nullptr, false) {<br class="">
+ const MCObjectFileInfo *MOFI,<br class="">
+ MachineFunctionInitializer *MFI)<br class="">
+ : ImmutablePass(ID), TM(TM), Context(&MAI, &MRI, MOFI, nullptr, false),<br class="">
+ MFInitializer(MFI) {<br class="">
initializeMachineModuleInfoPass(*PassRegistry::getPassRegistry());<br class="">
}<br class="">
<br class="">
MachineModuleInfo::MachineModuleInfo()<br class="">
- : ImmutablePass(ID), Context(nullptr, nullptr, nullptr) {<br class="">
+ : ImmutablePass(ID), TM(*((TargetMachine*)nullptr)),<br class="">
+ Context(nullptr, nullptr, nullptr) {<br class="">
llvm_unreachable("This MachineModuleInfo constructor should never be called, "<br class="">
"MMI should always be explicitly constructed by "<br class="">
"LLVMTargetMachine");<br class="">
@@ -213,7 +218,7 @@ bool MachineModuleInfo::doInitialization<br class="">
DbgInfoAvailable = UsesVAFloatArgument = UsesMorestackAddr = false;<br class="">
PersonalityTypeCache = EHPersonality::Unknown;<br class="">
AddrLabelSymbols = nullptr;<br class="">
- TheModule = nullptr;<br class="">
+ TheModule = &M;<br class="">
<br class="">
return false;<br class="">
}<br class="">
@@ -461,3 +466,42 @@ try_next:;<br class="">
FilterIds.push_back(0); // terminator<br class="">
return FilterID;<br class="">
}<br class="">
+<br class="">
+MachineFunction &MachineModuleInfo::getMachineFunction(const Function &F) {<br class="">
+ // Shortcut for the common case where a sequence of MachineFunctionPasses<br class="">
+ // all query for the same Function.<br class="">
+ if (LastRequest == &F)<br class="">
+ return *LastResult;<br class="">
+<br class="">
+ auto I = MachineFunctions.insert(<br class="">
+ std::make_pair(&F, std::unique_ptr<MachineFunction>()));<br class="">
+ MachineFunction *MF;<br class="">
+ if (I.second) {<br class="">
+ // No pre-existing machine function, create a new one.<br class="">
+ unsigned FunctionNum = (unsigned)MachineFunctions.size() - 1;<br class="">
+ MF = new MachineFunction(&F, TM, FunctionNum, *this);<br class="">
+ // Update the set entry.<br class="">
+ I.first->second.reset(MF);<br class="">
+<br class="">
+ if (MFInitializer)<br class="">
+ if (MFInitializer->initializeMachineFunction(*MF))<br class="">
+ report_fatal_error("Unable to initialize machine function");<br class="">
+ } else {<br class="">
+ MF = I.first->second.get();<br class="">
+ }<br class="">
+<br class="">
+ LastRequest = &F;<br class="">
+ LastResult = MF;<br class="">
+ return *MF;<br class="">
+}<br class="">
+<br class="">
+void MachineModuleInfo::deleteMachineFunction(MachineFunction &MF) {<br class="">
+ if (LastResult == &MF) {<br class="">
+ LastRequest = nullptr;<br class="">
+ LastResult = nullptr;<br class="">
+ }<br class="">
+<br class="">
+ auto I = MachineFunctions.find(MF.getFunction());<br class="">
+ assert(I != MachineFunctions.end() && "MachineFunction is known");<br class="">
+ I->second.reset(nullptr);<br class="">
+}<br class="">
<br class="">
Modified: llvm/trunk/lib/CodeGen/StackMapLivenessAnalysis.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackMapLivenessAnalysis.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackMapLivenessAnalysis.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/CodeGen/StackMapLivenessAnalysis.cpp (original)<br class="">
+++ llvm/trunk/lib/CodeGen/StackMapLivenessAnalysis.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -17,7 +17,6 @@<br class="">
#include "llvm/CodeGen/LivePhysRegs.h"<br class="">
#include "llvm/CodeGen/MachineFrameInfo.h"<br class="">
#include "llvm/CodeGen/MachineFunction.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineFunctionPass.h"<br class="">
#include "llvm/CodeGen/Passes.h"<br class="">
#include "llvm/Support/CommandLine.h"<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -18,7 +18,6 @@<br class="">
#include "llvm/ADT/Statistic.h"<br class="">
#include "llvm/CodeGen/MachineDominators.h"<br class="">
#include "llvm/CodeGen/MachineFunction.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineFunctionPass.h"<br class="">
#include "llvm/CodeGen/MachineInstrBuilder.h"<br class="">
#include "llvm/CodeGen/MachineJumpTableInfo.h"<br class="">
@@ -144,11 +143,10 @@ public:<br class="">
}<br class="">
<br class="">
void getAnalysisUsage(AnalysisUsage &AU) const override {<br class="">
- AU.addPreserved<MachineFunctionAnalysis>();<br class="">
- AU.addRequired<MachineFunctionAnalysis>();<br class="">
AU.addRequired<MachineDominatorTree>();<br class="">
AU.addRequired<MachinePostDominatorTree>();<br class="">
AU.addRequired<MachineLoopInfo>();<br class="">
+ MachineFunctionPass::getAnalysisUsage(AU);<br class="">
}<br class="">
<br class="">
/// Perform the CFG structurization<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -14,7 +14,6 @@<br class="">
#include "llvm/ADT/STLExtras.h"<br class="">
#include "llvm/Analysis/LoopInfo.h"<br class="">
#include "llvm/Analysis/PostDominators.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/IR/Constants.h"<br class="">
#include "llvm/IR/Dominators.h"<br class="">
#include "llvm/IR/Function.h"<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/Hexagon/HexagonGenExtract.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonGenExtract.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonGenExtract.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/Hexagon/HexagonGenExtract.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/Hexagon/HexagonGenExtract.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -8,7 +8,6 @@<br class="">
//===----------------------------------------------------------------------===//<br class="">
<br class="">
#include "llvm/ADT/STLExtras.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/IR/Constants.h"<br class="">
#include "llvm/IR/Dominators.h"<br class="">
#include "llvm/IR/Function.h"<br class="">
@@ -60,7 +59,6 @@ namespace {<br class="">
virtual void getAnalysisUsage(AnalysisUsage &AU) const override {<br class="">
AU.addRequired<DominatorTreeWrapperPass>();<br class="">
AU.addPreserved<DominatorTreeWrapperPass>();<br class="">
- AU.addPreserved<MachineFunctionAnalysis>();<br class="">
FunctionPass::getAnalysisUsage(AU);<br class="">
}<br class="">
private:<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/Hexagon/HexagonNewValueJump.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -29,7 +29,6 @@<br class="">
#include "HexagonTargetMachine.h"<br class="">
#include "llvm/ADT/Statistic.h"<br class="">
#include "llvm/CodeGen/LiveVariables.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineFunctionPass.h"<br class="">
#include "llvm/CodeGen/MachineInstrBuilder.h"<br class="">
#include "llvm/CodeGen/MachineRegisterInfo.h"<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/Hexagon/HexagonOptimizeSZextends.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -12,7 +12,6 @@<br class="">
//<br class="">
//===----------------------------------------------------------------------===//<br class="">
<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/StackProtector.h"<br class="">
#include "llvm/IR/Function.h"<br class="">
#include "llvm/IR/Instructions.h"<br class="">
@@ -43,8 +42,6 @@ namespace {<br class="">
}<br class="">
<br class="">
void getAnalysisUsage(AnalysisUsage &AU) const override {<br class="">
- AU.addRequired<MachineFunctionAnalysis>();<br class="">
- AU.addPreserved<MachineFunctionAnalysis>();<br class="">
AU.addPreserved<StackProtector>();<br class="">
FunctionPass::getAnalysisUsage(AU);<br class="">
}<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -22,7 +22,6 @@<br class="">
#include "HexagonVLIWPacketizer.h"<br class="">
#include "llvm/Analysis/AliasAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineDominators.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineFunctionPass.h"<br class="">
#include "llvm/CodeGen/MachineLoopInfo.h"<br class="">
#include "llvm/CodeGen/MachineRegisterInfo.h"<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -12,7 +12,6 @@<br class="">
//===----------------------------------------------------------------------===//<br class="">
<br class="">
#include "NVPTXAllocaHoisting.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/StackProtector.h"<br class="">
#include "llvm/IR/Constants.h"<br class="">
#include "llvm/IR/Function.h"<br class="">
@@ -28,7 +27,6 @@ public:<br class="">
NVPTXAllocaHoisting() : FunctionPass(ID) {}<br class="">
<br class="">
void getAnalysisUsage(AnalysisUsage &AU) const override {<br class="">
- AU.addPreserved<MachineFunctionAnalysis>();<br class="">
AU.addPreserved<StackProtector>();<br class="">
}<br class="">
<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -15,7 +15,6 @@<br class="">
#include "NVPTX.h"<br class="">
#include "MCTargetDesc/NVPTXBaseInfo.h"<br class="">
#include "NVPTXUtilities.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/ValueTypes.h"<br class="">
#include "llvm/IR/Constants.h"<br class="">
#include "llvm/IR/DerivedTypes.h"<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -14,7 +14,6 @@<br class="">
//===----------------------------------------------------------------------===//<br class="">
<br class="">
#include "NVPTXLowerAggrCopies.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/StackProtector.h"<br class="">
#include "llvm/IR/Constants.h"<br class="">
#include "llvm/IR/DataLayout.h"<br class="">
@@ -41,7 +40,6 @@ struct NVPTXLowerAggrCopies : public Fun<br class="">
NVPTXLowerAggrCopies() : FunctionPass(ID) {}<br class="">
<br class="">
void getAnalysisUsage(AnalysisUsage &AU) const override {<br class="">
- AU.addPreserved<MachineFunctionAnalysis>();<br class="">
AU.addPreserved<StackProtector>();<br class="">
}<br class="">
<br class="">
<br class="">
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp (original)<br class="">
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -20,7 +20,6 @@<br class="">
#include "NVPTXTargetTransformInfo.h"<br class="">
#include "llvm/Analysis/Passes.h"<br class="">
#include "llvm/CodeGen/AsmPrinter.h"<br class="">
-#include "llvm/CodeGen/MachineFunctionAnalysis.h"<br class="">
#include "llvm/CodeGen/MachineModuleInfo.h"<br class="">
#include "llvm/CodeGen/Passes.h"<br class="">
#include "llvm/CodeGen/TargetPassConfig.h"<br class="">
<br class="">
Modified: llvm/trunk/test/CodeGen/Generic/stop-after.ll<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/stop-after.ll?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Generic/stop-after.ll?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/test/CodeGen/Generic/stop-after.ll (original)<br class="">
+++ llvm/trunk/test/CodeGen/Generic/stop-after.ll Mon Aug 22 22:20:09 2016<br class="">
@@ -3,7 +3,6 @@<br class="">
<br class="">
; STOP: -loop-reduce<br class="">
; STOP: Loop Strength Reduction<br class="">
-; STOP-NEXT: Machine Function Analysis<br class="">
; STOP-NEXT: MIR Printing Pass<br class="">
<br class="">
; START: -machine-branch-prob -pre-isel-intrinsic-lowering<br class="">
<br class="">
Modified: llvm/trunk/test/CodeGen/X86/hidden-vis-pic.ll<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/hidden-vis-pic.ll?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/hidden-vis-pic.ll?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/test/CodeGen/X86/hidden-vis-pic.ll (original)<br class="">
+++ llvm/trunk/test/CodeGen/X86/hidden-vis-pic.ll Mon Aug 22 22:20:09 2016<br class="">
@@ -17,7 +17,7 @@ entry:<br class="">
<br class="">
; This must use movl of the stub, not an lea, since the function isn't being<br class="">
; emitted here.<br class="">
-; CHECK: movl L__ZNSbIcED1Ev$non_lazy_ptr-L1$pb(<br class="">
+; CHECK: movl L__ZNSbIcED1Ev$non_lazy_ptr-L0$pb(<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
Modified: llvm/trunk/tools/llc/llc.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/tools/llc/llc.cpp (original)<br class="">
+++ llvm/trunk/tools/llc/llc.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -450,8 +450,7 @@ static int compileModule(char **argv, LL<br class="">
LLVMTargetMachine &LLVMTM = static_cast<LLVMTargetMachine&>(*Target);<br class="">
TargetPassConfig &TPC = *LLVMTM.createPassConfig(PM);<br class="">
PM.add(&TPC);<br class="">
- LLVMTM.addMachineModuleInfo(PM);<br class="">
- LLVMTM.addMachineFunctionAnalysis(PM, MIR.get());<br class="">
+ LLVMTM.addMachineModuleInfo(PM, MIR.get());<br class="">
TPC.printAndVerify("");<br class="">
<br class="">
for (const std::string &RunPassName : *RunPassNames) {<br class="">
<br class="">
Modified: llvm/trunk/unittests/MI/LiveIntervalTest.cpp<br class="">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/MI/LiveIntervalTest.cpp?rev=279502&r1=279501&r2=279502&view=diff" rel="noreferrer" target="_blank" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/MI/LiveIntervalTest.cpp?rev=279502&r1=279501&r2=279502&view=diff</a><br class="">
==============================================================================<br class="">
--- llvm/trunk/unittests/MI/LiveIntervalTest.cpp (original)<br class="">
+++ llvm/trunk/unittests/MI/LiveIntervalTest.cpp Mon Aug 22 22:20:09 2016<br class="">
@@ -70,8 +70,7 @@ std::unique_ptr<Module> parseMIR(LLVMCon<br class="">
return nullptr;<br class="">
<br class="">
const LLVMTargetMachine &LLVMTM = static_cast<const LLVMTargetMachine&>(TM);<br class="">
- LLVMTM.addMachineModuleInfo(PM);<br class="">
- LLVMTM.addMachineFunctionAnalysis(PM, MIR.get());<br class="">
+ LLVMTM.addMachineModuleInfo(PM, MIR.get());<br class="">
<br class="">
return M;<br class="">
}<br class="">
<br class="">
<br class="">
_______________________________________________<br class="">
llvm-commits mailing list<br class="">
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank" class="">llvm-commits@lists.llvm.org</a><br class="">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="">
</blockquote></div>
_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></blockquote></div><br class=""></body></html>