aboutsummaryrefslogtreecommitdiff
path: root/include/llvm
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-04-03 07:51:10 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-04-03 07:51:10 +0000
commitb5efedaf2ab20d844d5a21cdef76b55acbf4f01c (patch)
treeba3309de92b14839b2ca6ca0c6d3b39714f95d4c /include/llvm
parent104bd8179fb5f6551c65c94ebcd0a4918b060189 (diff)
downloadsrc-b5efedaf2ab20d844d5a21cdef76b55acbf4f01c.tar.gz
src-b5efedaf2ab20d844d5a21cdef76b55acbf4f01c.zip
Update LLVM to r100285.
Notes
Notes: svn path=/vendor/llvm/dist/; revision=206124
Diffstat (limited to 'include/llvm')
-rw-r--r--include/llvm/Analysis/DebugInfo.h7
-rw-r--r--include/llvm/Analysis/LoopPass.h4
-rw-r--r--include/llvm/Assembly/PrintModulePass.h4
-rw-r--r--include/llvm/BasicBlock.h6
-rw-r--r--include/llvm/Bitcode/LLVMBitCodes.h5
-rw-r--r--include/llvm/CallGraphSCCPass.h4
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h1
-rw-r--r--include/llvm/CodeGen/MachineFunction.h10
-rw-r--r--include/llvm/CodeGen/MachineFunctionPass.h3
-rw-r--r--include/llvm/CodeGen/MachineInstr.h7
-rw-r--r--include/llvm/CodeGen/MachineModuleInfo.h13
-rw-r--r--include/llvm/CodeGen/Passes.h6
-rw-r--r--include/llvm/CodeGen/SelectionDAG.h10
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h37
-rw-r--r--include/llvm/CodeGen/SlotIndexes.h6
-rw-r--r--include/llvm/Instruction.h6
-rw-r--r--include/llvm/IntrinsicsX86.td4
-rw-r--r--include/llvm/Pass.h16
-rw-r--r--include/llvm/Support/Allocator.h2
-rw-r--r--include/llvm/Support/DebugLoc.h58
-rw-r--r--include/llvm/Support/IRBuilder.h6
-rw-r--r--include/llvm/Support/MathExtras.h12
-rw-r--r--include/llvm/Support/SlowOperationInformer.h2
-rw-r--r--include/llvm/Target/TargetLowering.h18
-rw-r--r--include/llvm/Transforms/Utils/SSAUpdater.h32
25 files changed, 130 insertions, 149 deletions
diff --git a/include/llvm/Analysis/DebugInfo.h b/include/llvm/Analysis/DebugInfo.h
index 4e8c4c85bfe4..d68bfa3c0dfe 100644
--- a/include/llvm/Analysis/DebugInfo.h
+++ b/include/llvm/Analysis/DebugInfo.h
@@ -31,8 +31,6 @@ namespace llvm {
class Type;
class Value;
class DbgDeclareInst;
- class DebugLoc;
- struct DebugLocTracker;
class Instruction;
class MDNode;
class LLVMContext;
@@ -710,11 +708,6 @@ namespace llvm {
std::string &Type, unsigned &LineNo, std::string &File,
std::string &Dir);
- /// ExtractDebugLocation - Extract debug location information
- /// from DILocation.
- DebugLoc ExtractDebugLocation(DILocation &Loc,
- DebugLocTracker &DebugLocInfo);
-
/// getDISubprogram - Find subprogram that is enclosing this scope.
DISubprogram getDISubprogram(MDNode *Scope);
diff --git a/include/llvm/Analysis/LoopPass.h b/include/llvm/Analysis/LoopPass.h
index 10ff1033dcef..6f77d019b691 100644
--- a/include/llvm/Analysis/LoopPass.h
+++ b/include/llvm/Analysis/LoopPass.h
@@ -31,6 +31,10 @@ public:
explicit LoopPass(intptr_t pid) : Pass(PT_Loop, pid) {}
explicit LoopPass(void *pid) : Pass(PT_Loop, pid) {}
+ /// getPrinterPass - Get a pass to print the function corresponding
+ /// to a Loop.
+ Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+
// runOnLoop - This method should be implemented by the subclass to perform
// whatever action is necessary for the specified Loop.
virtual bool runOnLoop(Loop *L, LPPassManager &LPM) = 0;
diff --git a/include/llvm/Assembly/PrintModulePass.h b/include/llvm/Assembly/PrintModulePass.h
index fb4f6a7e13ea..239fbcc0c8ca 100644
--- a/include/llvm/Assembly/PrintModulePass.h
+++ b/include/llvm/Assembly/PrintModulePass.h
@@ -27,7 +27,9 @@ namespace llvm {
/// createPrintModulePass - Create and return a pass that writes the
/// module to the specified raw_ostream.
- ModulePass *createPrintModulePass(raw_ostream *OS, bool DeleteStream=false);
+ ModulePass *createPrintModulePass(raw_ostream *OS,
+ bool DeleteStream=false,
+ const std::string &Banner = "");
/// createPrintFunctionPass - Create and return a pass that prints
/// functions to the specified raw_ostream as they are processed.
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index e358f91f90ad..bf5874f6824a 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -131,6 +131,12 @@ public:
const Instruction* getFirstNonPHI() const {
return const_cast<BasicBlock*>(this)->getFirstNonPHI();
}
+
+ // Same as above, but also skip debug intrinsics.
+ Instruction* getFirstNonPHIOrDbg();
+ const Instruction* getFirstNonPHIOrDbg() const {
+ return const_cast<BasicBlock*>(this)->getFirstNonPHIOrDbg();
+ }
/// removeFromParent - This method unlinks 'this' from the containing
/// function, but does not delete it.
diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h
index a980df811040..de9b64d4a46c 100644
--- a/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/include/llvm/Bitcode/LLVMBitCodes.h
@@ -240,7 +240,10 @@ namespace bitc {
// new select on i1 or [N x i1]
FUNC_CODE_INST_VSELECT = 29, // VSELECT: [ty,opval,opval,predty,pred]
FUNC_CODE_INST_INBOUNDS_GEP= 30, // INBOUNDS_GEP: [n x operands]
- FUNC_CODE_INST_INDIRECTBR = 31 // INDIRECTBR: [opty, op0, op1, ...]
+ FUNC_CODE_INST_INDIRECTBR = 31, // INDIRECTBR: [opty, op0, op1, ...]
+
+ FUNC_CODE_DEBUG_LOC = 32, // DEBUG_LOC: [Line,Col,ScopeVal, IAVal]
+ FUNC_CODE_DEBUG_LOC_AGAIN = 33 // DEBUG_LOC_AGAIN
};
} // End bitc namespace
} // End llvm namespace
diff --git a/include/llvm/CallGraphSCCPass.h b/include/llvm/CallGraphSCCPass.h
index feab7637969d..37a454e07aab 100644
--- a/include/llvm/CallGraphSCCPass.h
+++ b/include/llvm/CallGraphSCCPass.h
@@ -35,6 +35,10 @@ struct CallGraphSCCPass : public Pass {
explicit CallGraphSCCPass(intptr_t pid) : Pass(PT_CallGraphSCC, pid) {}
explicit CallGraphSCCPass(void *pid) : Pass(PT_CallGraphSCC, pid) {}
+ /// createPrinterPass - Get a pass that prints the Module
+ /// corresponding to a CallGraph.
+ Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+
/// doInitialization - This method is called before the SCC's of the program
/// has been processed, allowing the pass to do initialization as necessary.
virtual bool doInitialization(CallGraph &CG) {
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index ffeb44da7bc8..a405932beadb 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -19,6 +19,7 @@
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/Support/DebugLoc.h"
#include "llvm/Target/TargetMachine.h"
+#include "llvm/ADT/DenseMap.h"
namespace llvm {
class BlockAddress;
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h
index 76ec9db5510d..59b171850d0d 100644
--- a/include/llvm/CodeGen/MachineFunction.h
+++ b/include/llvm/CodeGen/MachineFunction.h
@@ -26,7 +26,6 @@
namespace llvm {
-class DILocation;
class Value;
class Function;
class MachineRegisterInfo;
@@ -112,9 +111,6 @@ class MachineFunction {
// of a function.
DebugLoc DefaultDebugLoc;
- // Tracks debug locations.
- DebugLocTracker DebugLocInfo;
-
/// FunctionNumber - This provides a unique ID for each function emitted in
/// this translation unit.
///
@@ -402,9 +398,6 @@ public:
// Debug location.
//
- /// getDILocation - Get the DILocation for a given DebugLoc object.
- DILocation getDILocation(DebugLoc DL) const;
-
/// getDefaultDebugLoc - Get the default debug location for the machine
/// function.
DebugLoc getDefaultDebugLoc() const { return DefaultDebugLoc; }
@@ -412,9 +405,6 @@ public:
/// setDefaultDebugLoc - Get the default debug location for the machine
/// function.
void setDefaultDebugLoc(DebugLoc DL) { DefaultDebugLoc = DL; }
-
- /// getDebugLocInfo - Get the debug info location tracker.
- DebugLocTracker &getDebugLocInfo() { return DebugLocInfo; }
};
//===--------------------------------------------------------------------===//
diff --git a/include/llvm/CodeGen/MachineFunctionPass.h b/include/llvm/CodeGen/MachineFunctionPass.h
index bac110316d4f..1a2b12972aba 100644
--- a/include/llvm/CodeGen/MachineFunctionPass.h
+++ b/include/llvm/CodeGen/MachineFunctionPass.h
@@ -34,6 +34,9 @@ protected:
explicit MachineFunctionPass(intptr_t ID) : FunctionPass(ID) {}
explicit MachineFunctionPass(void *ID) : FunctionPass(ID) {}
+ /// createPrinterPass - Get a machine function printer pass.
+ Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+
/// runOnMachineFunction - This method must be overloaded to perform the
/// desired machine code transformation or analysis.
///
diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h
index d84f882bcd1b..fa819275271a 100644
--- a/include/llvm/CodeGen/MachineInstr.h
+++ b/include/llvm/CodeGen/MachineInstr.h
@@ -16,12 +16,13 @@
#ifndef LLVM_CODEGEN_MACHINEINSTR_H
#define LLVM_CODEGEN_MACHINEINSTR_H
-#include "llvm/ADT/ilist.h"
-#include "llvm/ADT/ilist_node.h"
-#include "llvm/ADT/STLExtras.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/Target/TargetInstrDesc.h"
#include "llvm/Target/TargetOpcodes.h"
+#include "llvm/ADT/ilist.h"
+#include "llvm/ADT/ilist_node.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/Support/DebugLoc.h"
#include <vector>
diff --git a/include/llvm/CodeGen/MachineModuleInfo.h b/include/llvm/CodeGen/MachineModuleInfo.h
index d446eaeb7f49..d610390b6357 100644
--- a/include/llvm/CodeGen/MachineModuleInfo.h
+++ b/include/llvm/CodeGen/MachineModuleInfo.h
@@ -37,6 +37,7 @@
#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/MC/MCContext.h"
#include "llvm/Support/Dwarf.h"
+#include "llvm/Support/DebugLoc.h"
#include "llvm/Support/ValueHandle.h"
#include "llvm/System/DataTypes.h"
#include "llvm/ADT/DenseMap.h"
@@ -156,8 +157,8 @@ class MachineModuleInfo : public ImmutablePass {
public:
static char ID; // Pass identification, replacement for typeid
- typedef std::pair<unsigned, TrackingVH<MDNode> > UnsignedAndMDNodePair;
- typedef SmallVector< std::pair<TrackingVH<MDNode>, UnsignedAndMDNodePair>, 4>
+ typedef std::pair<unsigned, DebugLoc> UnsignedDebugLocPair;
+ typedef SmallVector<std::pair<TrackingVH<MDNode>, UnsignedDebugLocPair>, 4>
VariableDbgInfoMapTy;
VariableDbgInfoMapTy VariableDbgInfo;
@@ -330,10 +331,10 @@ public:
/// of one is required to emit exception handling info.
Function *getPersonality() const;
- /// setVariableDbgInfo - Collect information used to emit debugging information
- /// of a variable.
- void setVariableDbgInfo(MDNode *N, unsigned Slot, MDNode *Scope) {
- VariableDbgInfo.push_back(std::make_pair(N, std::make_pair(Slot, Scope)));
+ /// setVariableDbgInfo - Collect information used to emit debugging
+ /// information of a variable.
+ void setVariableDbgInfo(MDNode *N, unsigned Slot, DebugLoc Loc) {
+ VariableDbgInfo.push_back(std::make_pair(N, std::make_pair(Slot, Loc)));
}
VariableDbgInfoMapTy &getVariableDbgInfo() { return VariableDbgInfo; }
diff --git a/include/llvm/CodeGen/Passes.h b/include/llvm/CodeGen/Passes.h
index 911be223b21a..d3c2720c15f5 100644
--- a/include/llvm/CodeGen/Passes.h
+++ b/include/llvm/CodeGen/Passes.h
@@ -21,6 +21,7 @@
namespace llvm {
class FunctionPass;
+ class MachineFunctionPass;
class PassInfo;
class TargetLowering;
class RegisterCoalescer;
@@ -36,8 +37,9 @@ namespace llvm {
/// MachineFunctionPrinter pass - This pass prints out the machine function to
/// the given stream, as a debugging tool.
- FunctionPass *createMachineFunctionPrinterPass(raw_ostream &OS,
- const std::string &Banner ="");
+ MachineFunctionPass *
+ createMachineFunctionPrinterPass(raw_ostream &OS,
+ const std::string &Banner ="");
/// MachineLoopInfo pass - This pass is a loop analysis pass.
///
diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h
index 610edb6fcfb1..ef5d7e2a8959 100644
--- a/include/llvm/CodeGen/SelectionDAG.h
+++ b/include/llvm/CodeGen/SelectionDAG.h
@@ -461,8 +461,7 @@ public:
SDValue getCALLSEQ_START(SDValue Chain, SDValue Op) {
SDVTList VTs = getVTList(MVT::Other, MVT::Flag);
SDValue Ops[] = { Chain, Op };
- return getNode(ISD::CALLSEQ_START, DebugLoc::getUnknownLoc(),
- VTs, Ops, 2);
+ return getNode(ISD::CALLSEQ_START, DebugLoc(), VTs, Ops, 2);
}
/// getCALLSEQ_END - Return a new CALLSEQ_END node, which always must have a
@@ -476,20 +475,19 @@ public:
Ops.push_back(Op1);
Ops.push_back(Op2);
Ops.push_back(InFlag);
- return getNode(ISD::CALLSEQ_END, DebugLoc::getUnknownLoc(), NodeTys,
- &Ops[0],
+ return getNode(ISD::CALLSEQ_END, DebugLoc(), NodeTys, &Ops[0],
(unsigned)Ops.size() - (InFlag.getNode() == 0 ? 1 : 0));
}
/// getUNDEF - Return an UNDEF node. UNDEF does not have a useful DebugLoc.
SDValue getUNDEF(EVT VT) {
- return getNode(ISD::UNDEF, DebugLoc::getUnknownLoc(), VT);
+ return getNode(ISD::UNDEF, DebugLoc(), VT);
}
/// getGLOBAL_OFFSET_TABLE - Return a GLOBAL_OFFSET_TABLE node. This does
/// not have a useful DebugLoc.
SDValue getGLOBAL_OFFSET_TABLE(EVT VT) {
- return getNode(ISD::GLOBAL_OFFSET_TABLE, DebugLoc::getUnknownLoc(), VT);
+ return getNode(ISD::GLOBAL_OFFSET_TABLE, DebugLoc(), VT);
}
/// getNode - Gets or creates the specified node.
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 4dcf0135a474..782d354bdfe7 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -1569,8 +1569,7 @@ public:
#else
explicit HandleSDNode(SDValue X)
#endif
- : SDNode(ISD::HANDLENODE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)) {
+ : SDNode(ISD::HANDLENODE, DebugLoc(), getSDVTList(MVT::Other)) {
InitOperands(&Op, X);
}
~HandleSDNode();
@@ -1801,7 +1800,7 @@ class ConstantSDNode : public SDNode {
friend class SelectionDAG;
ConstantSDNode(bool isTarget, const ConstantInt *val, EVT VT)
: SDNode(isTarget ? ISD::TargetConstant : ISD::Constant,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), Value(val) {
+ DebugLoc(), getSDVTList(VT)), Value(val) {
}
public:
@@ -1825,7 +1824,7 @@ class ConstantFPSDNode : public SDNode {
friend class SelectionDAG;
ConstantFPSDNode(bool isTarget, const ConstantFP *val, EVT VT)
: SDNode(isTarget ? ISD::TargetConstantFP : ISD::ConstantFP,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), Value(val) {
+ DebugLoc(), getSDVTList(VT)), Value(val) {
}
public:
@@ -1896,7 +1895,7 @@ class FrameIndexSDNode : public SDNode {
friend class SelectionDAG;
FrameIndexSDNode(int fi, EVT VT, bool isTarg)
: SDNode(isTarg ? ISD::TargetFrameIndex : ISD::FrameIndex,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), FI(fi) {
+ DebugLoc(), getSDVTList(VT)), FI(fi) {
}
public:
@@ -1915,7 +1914,7 @@ class JumpTableSDNode : public SDNode {
friend class SelectionDAG;
JumpTableSDNode(int jti, EVT VT, bool isTarg, unsigned char TF)
: SDNode(isTarg ? ISD::TargetJumpTable : ISD::JumpTable,
- DebugLoc::getUnknownLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) {
+ DebugLoc(), getSDVTList(VT)), JTI(jti), TargetFlags(TF) {
}
public:
@@ -1941,7 +1940,7 @@ class ConstantPoolSDNode : public SDNode {
ConstantPoolSDNode(bool isTarget, Constant *c, EVT VT, int o, unsigned Align,
unsigned char TF)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- DebugLoc::getUnknownLoc(),
+ DebugLoc(),
getSDVTList(VT)), Offset(o), Alignment(Align), TargetFlags(TF) {
assert((int)Offset >= 0 && "Offset is too large");
Val.ConstVal = c;
@@ -1949,7 +1948,7 @@ class ConstantPoolSDNode : public SDNode {
ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
EVT VT, int o, unsigned Align, unsigned char TF)
: SDNode(isTarget ? ISD::TargetConstantPool : ISD::ConstantPool,
- DebugLoc::getUnknownLoc(),
+ DebugLoc(),
getSDVTList(VT)), Offset(o), Alignment(Align), TargetFlags(TF) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
@@ -1997,8 +1996,7 @@ class BasicBlockSDNode : public SDNode {
/// blocks out of order when they're jumped to, which makes it a bit
/// harder. Let's see if we need it first.
explicit BasicBlockSDNode(MachineBasicBlock *mbb)
- : SDNode(ISD::BasicBlock, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), MBB(mbb) {
+ : SDNode(ISD::BasicBlock, DebugLoc(), getSDVTList(MVT::Other)), MBB(mbb) {
}
public:
@@ -2044,8 +2042,7 @@ class SrcValueSDNode : public SDNode {
friend class SelectionDAG;
/// Create a SrcValue for a general value.
explicit SrcValueSDNode(const Value *v)
- : SDNode(ISD::SRCVALUE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), V(v) {}
+ : SDNode(ISD::SRCVALUE, DebugLoc(), getSDVTList(MVT::Other)), V(v) {}
public:
/// getValue - return the contained Value.
@@ -2062,8 +2059,7 @@ class RegisterSDNode : public SDNode {
unsigned Reg;
friend class SelectionDAG;
RegisterSDNode(unsigned reg, EVT VT)
- : SDNode(ISD::Register, DebugLoc::getUnknownLoc(),
- getSDVTList(VT)), Reg(reg) {
+ : SDNode(ISD::Register, DebugLoc(), getSDVTList(VT)), Reg(reg) {
}
public:
@@ -2081,7 +2077,7 @@ class BlockAddressSDNode : public SDNode {
friend class SelectionDAG;
BlockAddressSDNode(unsigned NodeTy, EVT VT, BlockAddress *ba,
unsigned char Flags)
- : SDNode(NodeTy, DebugLoc::getUnknownLoc(), getSDVTList(VT)),
+ : SDNode(NodeTy, DebugLoc(), getSDVTList(VT)),
BA(ba), TargetFlags(Flags) {
}
public:
@@ -2119,8 +2115,7 @@ class ExternalSymbolSDNode : public SDNode {
friend class SelectionDAG;
ExternalSymbolSDNode(bool isTarget, const char *Sym, unsigned char TF, EVT VT)
: SDNode(isTarget ? ISD::TargetExternalSymbol : ISD::ExternalSymbol,
- DebugLoc::getUnknownLoc(),
- getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) {
+ DebugLoc(), getSDVTList(VT)), Symbol(Sym), TargetFlags(TF) {
}
public:
@@ -2138,8 +2133,8 @@ class CondCodeSDNode : public SDNode {
ISD::CondCode Condition;
friend class SelectionDAG;
explicit CondCodeSDNode(ISD::CondCode Cond)
- : SDNode(ISD::CONDCODE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), Condition(Cond) {
+ : SDNode(ISD::CONDCODE, DebugLoc(), getSDVTList(MVT::Other)),
+ Condition(Cond) {
}
public:
@@ -2296,8 +2291,8 @@ class VTSDNode : public SDNode {
EVT ValueType;
friend class SelectionDAG;
explicit VTSDNode(EVT VT)
- : SDNode(ISD::VALUETYPE, DebugLoc::getUnknownLoc(),
- getSDVTList(MVT::Other)), ValueType(VT) {
+ : SDNode(ISD::VALUETYPE, DebugLoc(), getSDVTList(MVT::Other)),
+ ValueType(VT) {
}
public:
diff --git a/include/llvm/CodeGen/SlotIndexes.h b/include/llvm/CodeGen/SlotIndexes.h
index dd4caba1e568..caefdf4489df 100644
--- a/include/llvm/CodeGen/SlotIndexes.h
+++ b/include/llvm/CodeGen/SlotIndexes.h
@@ -22,11 +22,11 @@
#ifndef LLVM_CODEGEN_SLOTINDEXES_H
#define LLVM_CODEGEN_SLOTINDEXES_H
-#include "llvm/ADT/PointerIntPair.h"
-#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachineInstr.h"
+#include "llvm/ADT/PointerIntPair.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/ErrorHandling.h"
diff --git a/include/llvm/Instruction.h b/include/llvm/Instruction.h
index 13331e60ed2f..0b772b0aae44 100644
--- a/include/llvm/Instruction.h
+++ b/include/llvm/Instruction.h
@@ -32,7 +32,7 @@ class Instruction : public User, public ilist_node<Instruction> {
Instruction(const Instruction &); // Do not implement
BasicBlock *Parent;
- NewDebugLoc DbgLoc; // 'dbg' Metadata cache.
+ DebugLoc DbgLoc; // 'dbg' Metadata cache.
enum {
/// HasMetadataBit - This is a bit stored in the SubClassData field which
@@ -181,10 +181,10 @@ public:
}
/// setDebugLoc - Set the debug location information for this instruction.
- void setDebugLoc(const NewDebugLoc &Loc) { DbgLoc = Loc; }
+ void setDebugLoc(const DebugLoc &Loc) { DbgLoc = Loc; }
/// getDebugLoc - Return the debug location for this node as a DebugLoc.
- const NewDebugLoc &getDebugLoc() const { return DbgLoc; }
+ const DebugLoc &getDebugLoc() const { return DbgLoc; }
private:
/// hasMetadataHashEntry - Return true if we have an entry in the on-the-side
diff --git a/include/llvm/IntrinsicsX86.td b/include/llvm/IntrinsicsX86.td
index 25169b4597d7..a48a1ed27741 100644
--- a/include/llvm/IntrinsicsX86.td
+++ b/include/llvm/IntrinsicsX86.td
@@ -782,7 +782,7 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
// Advanced Encryption Standard (AES) Instructions
let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
def int_x86_aesni_aesimc : GCCBuiltin<"__builtin_ia32_aesimc128">,
- Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
+ Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty],
[IntrNoMem]>;
def int_x86_aesni_aesenc : GCCBuiltin<"__builtin_ia32_aesenc128">,
Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
@@ -797,7 +797,7 @@ let TargetPrefix = "x86" in { // All intrinsics start with "llvm.x86.".
Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_v2i64_ty],
[IntrNoMem]>;
def int_x86_aesni_aeskeygenassist :
- GCCBuiltin<"__builtin_ia32_aeskeygenassist">,
+ GCCBuiltin<"__builtin_ia32_aeskeygenassist128">,
Intrinsic<[llvm_v2i64_ty], [llvm_v2i64_ty, llvm_i32_ty],
[IntrNoMem]>;
}
diff --git a/include/llvm/Pass.h b/include/llvm/Pass.h
index 8fc3a5307b3a..8d0c47d7bbe3 100644
--- a/include/llvm/Pass.h
+++ b/include/llvm/Pass.h
@@ -30,7 +30,9 @@
#define LLVM_PASS_H
#include "llvm/System/DataTypes.h"
+
#include <cassert>
+#include <string>
#include <utility>
#include <vector>
@@ -120,6 +122,11 @@ public:
virtual void print(raw_ostream &O, const Module *M) const;
void dump() const; // dump - Print to stderr.
+ /// createPrinterPass - Get a Pass appropriate to print the IR this
+ /// pass operates one (Module, Function or MachineFunction).
+ virtual Pass *createPrinterPass(raw_ostream &O,
+ const std::string &Banner) const = 0;
+
/// Each pass is responsible for assigning a pass manager to itself.
/// PMS is the stack of available pass manager.
virtual void assignPassManager(PMStack &,
@@ -233,6 +240,9 @@ public:
///
class ModulePass : public Pass {
public:
+ /// createPrinterPass - Get a module printer pass.
+ Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+
/// runOnModule - Virtual method overriden by subclasses to process the module
/// being operated on.
virtual bool runOnModule(Module &M) = 0;
@@ -293,6 +303,9 @@ public:
explicit FunctionPass(intptr_t pid) : Pass(PT_Function, pid) {}
explicit FunctionPass(const void *pid) : Pass(PT_Function, pid) {}
+ /// createPrinterPass - Get a function printer pass.
+ Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+
/// doInitialization - Virtual method overridden by subclasses to do
/// any necessary per-module initialization.
///
@@ -343,6 +356,9 @@ public:
explicit BasicBlockPass(intptr_t pid) : Pass(PT_BasicBlock, pid) {}
explicit BasicBlockPass(const void *pid) : Pass(PT_BasicBlock, pid) {}
+ /// createPrinterPass - Get a function printer pass.
+ Pass *createPrinterPass(raw_ostream &O, const std::string &Banner) const;
+
/// doInitialization - Virtual method overridden by subclasses to do
/// any necessary per-module initialization.
///
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h
index bd381807e0c6..eb6c2d1e25a7 100644
--- a/include/llvm/Support/Allocator.h
+++ b/include/llvm/Support/Allocator.h
@@ -200,7 +200,7 @@ public:
while (Slab) {
char *End = Slab == Allocator.CurSlab ? Allocator.CurPtr :
(char *)Slab + Slab->Size;
- for (char *Ptr = (char*)Slab+1; Ptr < End; Ptr += sizeof(T)) {
+ for (char *Ptr = (char*)(Slab+1); Ptr < End; Ptr += sizeof(T)) {
Ptr = Allocator.AlignPtr(Ptr, alignof<T>());
if (Ptr + sizeof(T) <= End)
reinterpret_cast<T*>(Ptr)->~T();
diff --git a/include/llvm/Support/DebugLoc.h b/include/llvm/Support/DebugLoc.h
index ede1ed305450..ccc344612913 100644
--- a/include/llvm/Support/DebugLoc.h
+++ b/include/llvm/Support/DebugLoc.h
@@ -12,11 +12,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_DEBUGLOC_H
-#define LLVM_DEBUGLOC_H
-
-#include "llvm/ADT/DenseMap.h"
-#include <vector>
+#ifndef LLVM_SUPPORT_DEBUGLOC_H
+#define LLVM_SUPPORT_DEBUGLOC_H
namespace llvm {
class MDNode;
@@ -25,7 +22,7 @@ namespace llvm {
/// DebugLoc - Debug location id. This is carried by Instruction, SDNode,
/// and MachineInstr to compactly encode file/line/scope information for an
/// operation.
- class NewDebugLoc {
+ class DebugLoc {
/// LineCol - This 32-bit value encodes the line and column number for the
/// location, encoded as 24-bits for line and 8 bits for col. A value of 0
/// for either means unknown.
@@ -35,15 +32,15 @@ namespace llvm {
/// decoded by LLVMContext. 0 is unknown.
int ScopeIdx;
public:
- NewDebugLoc() : LineCol(0), ScopeIdx(0) {} // Defaults to unknown.
+ DebugLoc() : LineCol(0), ScopeIdx(0) {} // Defaults to unknown.
/// get - Get a new DebugLoc that corresponds to the specified line/col
/// scope/inline location.
- static NewDebugLoc get(unsigned Line, unsigned Col,
- MDNode *Scope, MDNode *InlinedAt = 0);
+ static DebugLoc get(unsigned Line, unsigned Col,
+ MDNode *Scope, MDNode *InlinedAt = 0);
- /// getFromDILocation - Translate the DILocation quad into a NewDebugLoc.
- static NewDebugLoc getFromDILocation(MDNode *N);
+ /// getFromDILocation - Translate the DILocation quad into a DebugLoc.
+ static DebugLoc getFromDILocation(MDNode *N);
/// isUnknown - Return true if this is an unknown location.
bool isUnknown() const { return ScopeIdx == 0; }
@@ -73,48 +70,11 @@ namespace llvm {
/// DILocation compatible MDNode.
MDNode *getAsMDNode(const LLVMContext &Ctx) const;
- bool operator==(const NewDebugLoc &DL) const {
+ bool operator==(const DebugLoc &DL) const {
return LineCol == DL.LineCol && ScopeIdx == DL.ScopeIdx;
}
- bool operator!=(const NewDebugLoc &DL) const { return !(*this == DL); }
- };
-
-
-
- /// DebugLoc - Debug location id. This is carried by SDNode and MachineInstr
- /// to index into a vector of unique debug location tuples.
- class DebugLoc {
- unsigned Idx;
- public:
- DebugLoc() : Idx(~0U) {} // Defaults to invalid.
-
- static DebugLoc getUnknownLoc() { DebugLoc L; L.Idx = ~0U; return L; }
- static DebugLoc get(unsigned idx) { DebugLoc L; L.Idx = idx; return L; }
-
- unsigned getIndex() const { return Idx; }
-
- /// isUnknown - Return true if there is no debug info for the SDNode /
- /// MachineInstr.
- bool isUnknown() const { return Idx == ~0U; }
-
- bool operator==(const DebugLoc &DL) const { return Idx == DL.Idx; }
bool operator!=(const DebugLoc &DL) const { return !(*this == DL); }
};
-
- /// DebugLocTracker - This class tracks debug location information.
- ///
- struct DebugLocTracker {
- /// DebugLocations - A vector of unique DebugLocTuple's.
- ///
- std::vector<MDNode *> DebugLocations;
-
- /// DebugIdMap - This maps DebugLocTuple's to indices into the
- /// DebugLocations vector.
- DenseMap<MDNode *, unsigned> DebugIdMap;
-
- DebugLocTracker() {}
- };
-
} // end namespace llvm
#endif /* LLVM_DEBUGLOC_H */
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index c352625aeb4d..faa8fa3aee2b 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -40,7 +40,7 @@ protected:
/// IRBuilderBase - Common base class shared among various IRBuilders.
class IRBuilderBase {
- NewDebugLoc CurDbgLocation;
+ DebugLoc CurDbgLocation;
protected:
BasicBlock *BB;
BasicBlock::iterator InsertPt;
@@ -82,13 +82,13 @@ public:
/// SetCurrentDebugLocation - Set location information used by debugging
/// information.
- void SetCurrentDebugLocation(const NewDebugLoc &L) {
+ void SetCurrentDebugLocation(const DebugLoc &L) {
CurDbgLocation = L;
}
/// getCurrentDebugLocation - Get location information used by debugging
/// information.
- const NewDebugLoc &getCurrentDebugLocation() const { return CurDbgLocation; }
+ const DebugLoc &getCurrentDebugLocation() const { return CurDbgLocation; }
/// SetInstDebugLocation - If this builder has a current debug location, set
/// it on the specified instruction.
diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h
index 9c5f32cd5ff2..f56241c5790b 100644
--- a/include/llvm/Support/MathExtras.h
+++ b/include/llvm/Support/MathExtras.h
@@ -457,6 +457,18 @@ inline int64_t abs64(int64_t x) {
return (x < 0) ? -x : x;
}
+/// SignExtend32 - Sign extend B-bit number x to 32-bit int.
+/// Usage int32_t r = SignExtend32<5>(x);
+template <unsigned B> inline int32_t SignExtend32(int32_t x) {
+ return (x << (32 - B)) >> (32 - B);
+}
+
+/// SignExtend64 - Sign extend B-bit number x to 64-bit int.
+/// Usage int64_t r = SignExtend64<5>(x);
+template <unsigned B> inline int64_t SignExtend64(int32_t x) {
+ return (x << (64 - B)) >> (64 - B);
+}
+
} // End llvm namespace
#endif
diff --git a/include/llvm/Support/SlowOperationInformer.h b/include/llvm/Support/SlowOperationInformer.h
index 524049cbff17..607d993fff7b 100644
--- a/include/llvm/Support/SlowOperationInformer.h
+++ b/include/llvm/Support/SlowOperationInformer.h
@@ -41,7 +41,7 @@ namespace llvm {
SlowOperationInformer(const SlowOperationInformer&); // DO NOT IMPLEMENT
void operator=(const SlowOperationInformer&); // DO NOT IMPLEMENT
public:
- SlowOperationInformer(const std::string &Name);
+ explicit SlowOperationInformer(const std::string &Name);
~SlowOperationInformer();
/// progress - Clients should periodically call this method when they can
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h
index b0534ddaa5e5..f040c9db38ca 100644
--- a/include/llvm/Target/TargetLowering.h
+++ b/include/llvm/Target/TargetLowering.h
@@ -633,15 +633,19 @@ public:
}
/// getOptimalMemOpType - Returns the target specific optimal type for load
- /// and store operations as a result of memset, memcpy, and memmove lowering.
- /// If DstAlign is zero that means it's safe to destination alignment can
- /// satisfy any constraint. Similarly if SrcAlign is zero it means there isn't
- /// a need to check it against alignment requirement, probably because the
- /// source does not need to be loaded. It returns EVT::Other if SelectionDAG
- /// should be responsible for determining it.
+ /// and store operations as a result of memset, memcpy, and memmove
+ /// lowering. If DstAlign is zero that means it's safe to destination
+ /// alignment can satisfy any constraint. Similarly if SrcAlign is zero it
+ /// means there isn't a need to check it against alignment requirement,
+ /// probably because the source does not need to be loaded. If
+ /// 'NonScalarIntSafe' is true, that means it's safe to return a
+ /// non-scalar-integer type, e.g. empty string source, constant, or loaded
+ /// from memory. It returns EVT::Other if SelectionDAG should be responsible
+ /// for determining it.
virtual EVT getOptimalMemOpType(uint64_t Size,
unsigned DstAlign, unsigned SrcAlign,
- bool SafeToUseFP, SelectionDAG &DAG) const {
+ bool NonScalarIntSafe,
+ SelectionDAG &DAG) const {
return MVT::Other;
}
diff --git a/include/llvm/Transforms/Utils/SSAUpdater.h b/include/llvm/Transforms/Utils/SSAUpdater.h
index b29b749e8d9a..927e156abfb5 100644
--- a/include/llvm/Transforms/Utils/SSAUpdater.h
+++ b/include/llvm/Transforms/Utils/SSAUpdater.h
@@ -27,28 +27,22 @@ namespace llvm {
/// transformation wants to rewrite a set of uses of one value with uses of a
/// set of values.
class SSAUpdater {
-public:
- class BBInfo;
-
-private:
/// AvailableVals - This keeps track of which value to use on a per-block
- /// basis. When we insert PHI nodes, we keep track of them here.
- //typedef DenseMap<BasicBlock*, Value*> AvailableValsTy;
+ /// basis. When we insert PHI nodes, we keep track of them here. We use
+ /// TrackingVH's for the value of the map because we RAUW PHI nodes when we
+ /// eliminate them, and want the TrackingVH's to track this.
+ //typedef DenseMap<BasicBlock*, TrackingVH<Value> > AvailableValsTy;
void *AV;
/// PrototypeValue is an arbitrary representative value, which we derive names
/// and a type for PHI nodes.
Value *PrototypeValue;
- /// BBMap - The GetValueAtEndOfBlock method maintains this mapping from
- /// basic blocks to BBInfo structures.
- /// typedef DenseMap<BasicBlock*, BBInfo*> BBMapTy;
- void *BM;
-
- /// Allocator - The GetValueAtEndOfBlock method uses this BumpPtrAllocator to
- /// hold its internal data. The allocator and its storage is created and
- /// discarded for each invocation of GetValueAtEndOfBlock.
- void *BPA;
+ /// IncomingPredInfo - We use this as scratch space when doing our recursive
+ /// walk. This should only be used in GetValueInBlockInternal, normally it
+ /// should be empty.
+ //std::vector<std::pair<BasicBlock*, TrackingVH<Value> > > IncomingPredInfo;
+ void *IPI;
/// InsertedPHIs - If this is non-null, the SSAUpdater adds all PHI nodes that
/// it creates to the vector.
@@ -105,14 +99,6 @@ public:
private:
Value *GetValueAtEndOfBlockInternal(BasicBlock *BB);
- void FindPHIPlacement(BasicBlock *BB, BBInfo *Info, bool &Changed,
- unsigned Counter);
- void FindAvailableVal(BasicBlock *BB, BBInfo *Info, unsigned Counter);
- void FindExistingPHI(BasicBlock *BB);
- bool CheckIfPHIMatches(PHINode *PHI);
- void RecordMatchingPHI(PHINode *PHI);
- void ClearPHITags(PHINode *PHI);
-
void operator=(const SSAUpdater&); // DO NOT IMPLEMENT
SSAUpdater(const SSAUpdater&); // DO NOT IMPLEMENT
};