aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AggressiveAntiDepBreaker.cpp1
-rw-r--r--lib/CodeGen/AllocationOrder.h15
-rw-r--r--lib/CodeGen/Analysis.cpp47
-rw-r--r--lib/CodeGen/AsmPrinter/ARMException.cpp4
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp165
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp14
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp18
-rw-r--r--lib/CodeGen/AsmPrinter/DIE.cpp10
-rw-r--r--lib/CodeGen/AsmPrinter/DIE.h6
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp14
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfAccelTable.h24
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCFIException.cpp9
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp56
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfCompileUnit.h26
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp262
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.h87
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfException.cpp6
-rw-r--r--lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp8
-rw-r--r--lib/CodeGen/AsmPrinter/Win64Exception.cpp4
-rw-r--r--lib/CodeGen/BasicTargetTransformInfo.cpp402
-rw-r--r--lib/CodeGen/BranchFolding.cpp6
-rw-r--r--lib/CodeGen/CMakeLists.txt16
-rw-r--r--lib/CodeGen/CallingConvLower.cpp2
-rw-r--r--lib/CodeGen/CodeGen.cpp1
-rw-r--r--lib/CodeGen/CodePlacementOpt.cpp3
-rw-r--r--lib/CodeGen/DwarfEHPrepare.cpp10
-rw-r--r--lib/CodeGen/GCMetadata.cpp2
-rw-r--r--lib/CodeGen/GCStrategy.cpp4
-rw-r--r--lib/CodeGen/IfConversion.cpp8
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp48
-rw-r--r--lib/CodeGen/LLVMTargetMachine.cpp4
-rw-r--r--lib/CodeGen/LexicalScopes.cpp2
-rw-r--r--lib/CodeGen/LiveDebugVariables.cpp6
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp2
-rw-r--r--lib/CodeGen/LocalStackSlotAllocation.cpp12
-rw-r--r--lib/CodeGen/MachineBasicBlock.cpp62
-rw-r--r--lib/CodeGen/MachineBlockPlacement.cpp6
-rw-r--r--lib/CodeGen/MachineBranchProbabilityInfo.cpp2
-rw-r--r--lib/CodeGen/MachineFunction.cpp81
-rw-r--r--lib/CodeGen/MachineFunctionPass.cpp2
-rw-r--r--lib/CodeGen/MachineInstr.cpp393
-rw-r--r--lib/CodeGen/MachineInstrBundle.cpp16
-rw-r--r--lib/CodeGen/MachineLICM.cpp4
-rw-r--r--lib/CodeGen/MachineModuleInfo.cpp16
-rw-r--r--lib/CodeGen/MachineRegisterInfo.cpp55
-rw-r--r--lib/CodeGen/MachineSSAUpdater.cpp12
-rw-r--r--lib/CodeGen/MachineScheduler.cpp101
-rw-r--r--lib/CodeGen/MachineVerifier.cpp25
-rw-r--r--lib/CodeGen/OptimizePHIs.cpp2
-rw-r--r--lib/CodeGen/PHIElimination.cpp2
-rw-r--r--lib/CodeGen/Passes.cpp15
-rw-r--r--lib/CodeGen/PeepholeOptimizer.cpp11
-rw-r--r--lib/CodeGen/PostRASchedulerList.cpp8
-rw-r--r--lib/CodeGen/PrologEpilogInserter.cpp25
-rw-r--r--lib/CodeGen/PseudoSourceValue.cpp4
-rw-r--r--lib/CodeGen/RegAllocFast.cpp8
-rw-r--r--lib/CodeGen/RegAllocGreedy.cpp19
-rw-r--r--lib/CodeGen/RegAllocPBQP.cpp2
-rw-r--r--lib/CodeGen/RegisterClassInfo.cpp24
-rw-r--r--lib/CodeGen/RegisterCoalescer.cpp47
-rw-r--r--lib/CodeGen/ScheduleDAGInstrs.cpp19
-rw-r--r--lib/CodeGen/ScheduleDAGPrinter.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp75
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp29
-rw-r--r--lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp24
-rw-r--r--lib/CodeGen/SelectionDAG/InstrEmitter.cpp160
-rw-r--r--lib/CodeGen/SelectionDAG/InstrEmitter.h12
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp96
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp458
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp29
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypes.cpp44
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypes.h6
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp34
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp16
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp4
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp20
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h4
-rw-r--r--lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAG.cpp106
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp221
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h6
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp4
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp95
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp2
-rw-r--r--lib/CodeGen/SelectionDAG/TargetLowering.cpp1273
-rw-r--r--lib/CodeGen/ShadowStackGC.cpp6
-rw-r--r--lib/CodeGen/ShrinkWrapping.cpp1
-rw-r--r--lib/CodeGen/SjLjEHPrepare.cpp22
-rw-r--r--lib/CodeGen/StackColoring.cpp7
-rw-r--r--lib/CodeGen/StackProtector.cpp28
-rw-r--r--lib/CodeGen/StackSlotColoring.cpp2
-rw-r--r--lib/CodeGen/TailDuplication.cpp13
-rw-r--r--lib/CodeGen/TargetLoweringBase.cpp1274
-rw-r--r--lib/CodeGen/TargetLoweringObjectFileImpl.cpp12
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp2
-rw-r--r--lib/CodeGen/UnreachableBlockElim.cpp8
99 files changed, 3694 insertions, 2674 deletions
diff --git a/lib/CodeGen/AggressiveAntiDepBreaker.cpp b/lib/CodeGen/AggressiveAntiDepBreaker.cpp
index 14c13c4fef..152d9fa3a7 100644
--- a/lib/CodeGen/AggressiveAntiDepBreaker.cpp
+++ b/lib/CodeGen/AggressiveAntiDepBreaker.cpp
@@ -25,7 +25,6 @@
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
-#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
using namespace llvm;
diff --git a/lib/CodeGen/AllocationOrder.h b/lib/CodeGen/AllocationOrder.h
index a5293f60a0..aed461a7ed 100644
--- a/lib/CodeGen/AllocationOrder.h
+++ b/lib/CodeGen/AllocationOrder.h
@@ -39,6 +39,9 @@ public:
const VirtRegMap &VRM,
const RegisterClassInfo &RegClassInfo);
+ /// Get the allocation order without reordered hints.
+ ArrayRef<MCPhysReg> getOrder() const { return Order; }
+
/// Return the next physical register in the allocation order, or 0.
/// It is safe to call next() again after it returned 0, it will keep
/// returning 0 until rewind() is called.
@@ -53,6 +56,18 @@ public:
return 0;
}
+ /// As next(), but allow duplicates to be returned, and stop before the
+ /// Limit'th register in the RegisterClassInfo allocation order.
+ ///
+ /// This can produce more than Limit registers if there are hints.
+ unsigned nextWithDups(unsigned Limit) {
+ if (Pos < 0)
+ return Hints.end()[Pos++];
+ if (Pos < int(Limit))
+ return Order[Pos++];
+ return 0;
+ }
+
/// Start over from the beginning.
void rewind() { Pos = -int(Hints.size()); }
diff --git a/lib/CodeGen/Analysis.cpp b/lib/CodeGen/Analysis.cpp
index 88fffe0726..aaba1449a6 100644
--- a/lib/CodeGen/Analysis.cpp
+++ b/lib/CodeGen/Analysis.cpp
@@ -14,14 +14,13 @@
#include "llvm/CodeGen/Analysis.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/CodeGen/MachineFunction.h"
-#include "llvm/CodeGen/SelectionDAG.h"
-#include "llvm/DataLayout.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Function.h"
-#include "llvm/Instructions.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/LLVMContext.h"
-#include "llvm/Module.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/Module.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Target/TargetLowering.h"
@@ -266,7 +265,7 @@ static const Value *getNoopInput(const Value *V, const TargetLowering &TLI) {
/// between it and the return.
///
/// This function only tests target-independent requirements.
-bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr,
+bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attribute CalleeRetAttr,
const TargetLowering &TLI) {
const Instruction *I = CS.getInstruction();
const BasicBlock *ExitBB = I->getParent();
@@ -313,14 +312,14 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr,
// Conservatively require the attributes of the call to match those of
// the return. Ignore noalias because it doesn't affect the call sequence.
const Function *F = ExitBB->getParent();
- Attributes CallerRetAttr = F->getAttributes().getRetAttributes();
- if (AttrBuilder(CalleeRetAttr).removeAttribute(Attributes::NoAlias) !=
- AttrBuilder(CallerRetAttr).removeAttribute(Attributes::NoAlias))
+ Attribute CallerRetAttr = F->getAttributes().getRetAttributes();
+ if (AttrBuilder(CalleeRetAttr).removeAttribute(Attribute::NoAlias) !=
+ AttrBuilder(CallerRetAttr).removeAttribute(Attribute::NoAlias))
return false;
// It's not safe to eliminate the sign / zero extension of the return value.
- if (CallerRetAttr.hasAttribute(Attributes::ZExt) ||
- CallerRetAttr.hasAttribute(Attributes::SExt))
+ if (CallerRetAttr.hasAttribute(Attribute::ZExt) ||
+ CallerRetAttr.hasAttribute(Attribute::SExt))
return false;
// Otherwise, make sure the unmodified return value of I is the return value.
@@ -348,23 +347,3 @@ bool llvm::isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr,
return true;
}
-
-bool llvm::isInTailCallPosition(SelectionDAG &DAG, SDNode *Node,
- SDValue &Chain, const TargetLowering &TLI) {
- const Function *F = DAG.getMachineFunction().getFunction();
-
- // Conservatively require the attributes of the call to match those of
- // the return. Ignore noalias because it doesn't affect the call sequence.
- Attributes CallerRetAttr = F->getAttributes().getRetAttributes();
- if (AttrBuilder(CallerRetAttr)
- .removeAttribute(Attributes::NoAlias).hasAttributes())
- return false;
-
- // It's not safe to eliminate the sign / zero extension of the return value.
- if (CallerRetAttr.hasAttribute(Attributes::ZExt) ||
- CallerRetAttr.hasAttribute(Attributes::SExt))
- return false;
-
- // Check if the only use is a function return node.
- return TLI.isUsedByReturnOnly(Node, Chain);
-}
diff --git a/lib/CodeGen/AsmPrinter/ARMException.cpp b/lib/CodeGen/AsmPrinter/ARMException.cpp
index bcbbf2b8b9..1728331212 100644
--- a/lib/CodeGen/AsmPrinter/ARMException.cpp
+++ b/lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -19,14 +19,14 @@
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/DataLayout.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/Module.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
-#include "llvm/Module.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Dwarf.h"
#include "llvm/Support/FormattedStream.h"
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 0b04d3099d..0f381c6d0c 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -26,8 +26,10 @@
#include "llvm/CodeGen/MachineJumpTableInfo.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
-#include "llvm/DataLayout.h"
#include "llvm/DebugInfo.h"
+#include "llvm/IR/DataLayout.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/Operator.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
@@ -35,7 +37,6 @@
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
-#include "llvm/Module.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MathExtras.h"
@@ -406,9 +407,9 @@ void AsmPrinter::EmitGlobalVariable(const GlobalVariable *GV) {
// - pointer to mangled symbol above with initializer
unsigned PtrSize = TD->getPointerSizeInBits()/8;
OutStreamer.EmitSymbolValue(GetExternalSymbolSymbol("_tlv_bootstrap"),
- PtrSize, 0);
- OutStreamer.EmitIntValue(0, PtrSize, 0);
- OutStreamer.EmitSymbolValue(MangSym, PtrSize, 0);
+ PtrSize);
+ OutStreamer.EmitIntValue(0, PtrSize);
+ OutStreamer.EmitSymbolValue(MangSym, PtrSize);
OutStreamer.AddBlankLine();
return;
@@ -723,20 +724,6 @@ void AsmPrinter::EmitFunctionBody() {
case TargetOpcode::KILL:
if (isVerbose()) emitKill(II, *this);
break;
- // @LOCALMOD-BEGIN
- case TargetOpcode::BUNDLE_ALIGN_START:
- OutStreamer.EmitBundleAlignStart();
- break;
- case TargetOpcode::BUNDLE_ALIGN_END:
- OutStreamer.EmitBundleAlignEnd();
- break;
- case TargetOpcode::BUNDLE_LOCK:
- OutStreamer.EmitBundleLock();
- break;
- case TargetOpcode::BUNDLE_UNLOCK:
- OutStreamer.EmitBundleUnlock();
- break;
- // @LOCALMOD-END
default:
if (!TM.hasMCUseLoc())
MCLineEntry::Make(&OutStreamer, getCurrentSection());
@@ -991,6 +978,8 @@ bool AsmPrinter::doFinalization(Module &M) {
MMI = 0;
OutStreamer.Finish();
+ OutStreamer.reset();
+
return false;
}
@@ -1082,7 +1071,7 @@ void AsmPrinter::EmitConstantPool() {
// Emit inter-object padding for alignment.
unsigned AlignMask = CPE.getAlignment() - 1;
unsigned NewOffset = (Offset + AlignMask) & ~AlignMask;
- OutStreamer.EmitFill(NewOffset - Offset, 0/*fillval*/, 0/*addrspace*/);
+ OutStreamer.EmitZeros(NewOffset - Offset);
Type *Ty = CPE.getType();
Offset = NewOffset + TM.getDataLayout()->getTypeAllocSize(Ty);
@@ -1258,7 +1247,7 @@ void AsmPrinter::EmitJumpTableEntry(const MachineJumpTableInfo *MJTI,
assert(Value && "Unknown entry kind!");
unsigned EntrySize = MJTI->getEntrySize(*TM.getDataLayout());
- OutStreamer.EmitValue(Value, EntrySize, /*addrspace*/0);
+ OutStreamer.EmitValue(Value, EntrySize);
}
/// EmitSpecialLLVMGlobal - Check to see if the specified global is a
@@ -1380,19 +13