mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-16 14:31:59 +00:00
Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161122 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6635cad548
commit
a20e1e7ef5
@ -26,7 +26,7 @@ class FunctionPass;
|
||||
class JITCodeEmitter;
|
||||
class X86TargetMachine;
|
||||
|
||||
/// createX86ISelDag - This pass converts a legalized DAG into a
|
||||
/// createX86ISelDag - This pass converts a legalized DAG into a
|
||||
/// X86-specific DAG, ready for instruction scheduling.
|
||||
///
|
||||
FunctionPass *createX86ISelDag(X86TargetMachine &TM,
|
||||
|
@ -37,15 +37,15 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter {
|
||||
virtual const char *getPassName() const {
|
||||
return "X86 AT&T-Style Assembly Printer";
|
||||
}
|
||||
|
||||
|
||||
const X86Subtarget &getSubtarget() const { return *Subtarget; }
|
||||
|
||||
virtual void EmitStartOfAsmFile(Module &M);
|
||||
|
||||
virtual void EmitEndOfAsmFile(Module &M);
|
||||
|
||||
|
||||
virtual void EmitInstruction(const MachineInstr *MI);
|
||||
|
||||
|
||||
void printSymbolOperand(const MachineOperand &MO, raw_ostream &O);
|
||||
|
||||
// These methods are used by the tablegen'erated instruction printer.
|
||||
@ -71,7 +71,7 @@ class LLVM_LIBRARY_VISIBILITY X86AsmPrinter : public AsmPrinter {
|
||||
void printPICLabel(const MachineInstr *MI, unsigned Op, raw_ostream &O);
|
||||
|
||||
bool runOnMachineFunction(MachineFunction &F);
|
||||
|
||||
|
||||
void PrintDebugValueComment(const MachineInstr *MI, raw_ostream &OS);
|
||||
|
||||
MachineLocation getDebugValueLocation(const MachineInstr *MI) const;
|
||||
|
@ -17,4 +17,3 @@ using namespace llvm;
|
||||
|
||||
X86COFFMachineModuleInfo::~X86COFFMachineModuleInfo() {
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//===-- X86COFFMachineModuleInfo.h - X86 COFF MMI Impl ----------*- C++ -*-===//
|
||||
//===-- X86coffmachinemoduleinfo.h - X86 COFF MMI Impl ----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
@ -33,7 +33,7 @@ public:
|
||||
void addExternalFunction(MCSymbol* Symbol) {
|
||||
Externals.insert(Symbol);
|
||||
}
|
||||
|
||||
|
||||
typedef DenseSet<MCSymbol const *>::const_iterator externals_iterator;
|
||||
externals_iterator externals_begin() const { return Externals.begin(); }
|
||||
externals_iterator externals_end() const { return Externals.end(); }
|
||||
|
@ -971,7 +971,7 @@ void FPS::handleZeroArgFP(MachineBasicBlock::iterator &I) {
|
||||
// Change from the pseudo instruction to the concrete instruction.
|
||||
MI->RemoveOperand(0); // Remove the explicit ST(0) operand
|
||||
MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
|
||||
|
||||
|
||||
// Result gets pushed on the stack.
|
||||
pushReg(DestReg);
|
||||
}
|
||||
@ -1015,7 +1015,7 @@ void FPS::handleOneArgFP(MachineBasicBlock::iterator &I) {
|
||||
} else {
|
||||
moveToTop(Reg, I); // Move to the top of the stack...
|
||||
}
|
||||
|
||||
|
||||
// Convert from the pseudo instruction to the concrete instruction.
|
||||
MI->RemoveOperand(NumOps-1); // Remove explicit ST(0) operand
|
||||
MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
|
||||
@ -1297,7 +1297,7 @@ void FPS::handleCondMovFP(MachineBasicBlock::iterator &I) {
|
||||
MI->RemoveOperand(1);
|
||||
MI->getOperand(0).setReg(getSTReg(Op1));
|
||||
MI->setDesc(TII->get(getConcreteOpcode(MI->getOpcode())));
|
||||
|
||||
|
||||
// If we kill the second operand, make sure to pop it from the stack.
|
||||
if (Op0 != Op1 && KillsOp1) {
|
||||
// Get this value off of the register stack.
|
||||
@ -1714,38 +1714,38 @@ void FPS::handleSpecialFP(MachineBasicBlock::iterator &I) {
|
||||
// Assert that the top of stack contains the right FP register.
|
||||
assert(StackTop == 1 && FirstFPRegOp == getStackEntry(0) &&
|
||||
"Top of stack not the right register for RET!");
|
||||
|
||||
|
||||
// Ok, everything is good, mark the value as not being on the stack
|
||||
// anymore so that our assertion about the stack being empty at end of
|
||||
// block doesn't fire.
|
||||
StackTop = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Otherwise, we are returning two values:
|
||||
// 2) If returning the same value for both, we only have one thing in the FP
|
||||
// stack. Consider: RET FP1, FP1
|
||||
if (StackTop == 1) {
|
||||
assert(FirstFPRegOp == SecondFPRegOp && FirstFPRegOp == getStackEntry(0)&&
|
||||
"Stack misconfiguration for RET!");
|
||||
|
||||
|
||||
// Duplicate the TOS so that we return it twice. Just pick some other FPx
|
||||
// register to hold it.
|
||||
unsigned NewReg = getScratchReg();
|
||||
duplicateToTop(FirstFPRegOp, NewReg, MI);
|
||||
FirstFPRegOp = NewReg;
|
||||
}
|
||||
|
||||
|
||||
/// Okay we know we have two different FPx operands now:
|
||||
assert(StackTop == 2 && "Must have two values live!");
|
||||
|
||||
|
||||
/// 3) If SecondFPRegOp is currently in ST(0) and FirstFPRegOp is currently
|
||||
/// in ST(1). In this case, emit an fxch.
|
||||
if (getStackEntry(0) == SecondFPRegOp) {
|
||||
assert(getStackEntry(1) == FirstFPRegOp && "Unknown regs live");
|
||||
moveToTop(FirstFPRegOp, MI);
|
||||
}
|
||||
|
||||
|
||||
/// 4) Finally, FirstFPRegOp must be in ST(0) and SecondFPRegOp must be in
|
||||
/// ST(1). Just remove both from our understanding of the stack and return.
|
||||
assert(getStackEntry(0) == FirstFPRegOp && "Unknown regs live");
|
||||
|
@ -60,7 +60,7 @@ namespace {
|
||||
int Base_FrameIndex;
|
||||
|
||||
unsigned Scale;
|
||||
SDValue IndexReg;
|
||||
SDValue IndexReg;
|
||||
int32_t Disp;
|
||||
SDValue Segment;
|
||||
const GlobalValue *GV;
|
||||
@ -80,11 +80,11 @@ namespace {
|
||||
bool hasSymbolicDisplacement() const {
|
||||
return GV != 0 || CP != 0 || ES != 0 || JT != -1 || BlockAddr != 0;
|
||||
}
|
||||
|
||||
|
||||
bool hasBaseOrIndexReg() const {
|
||||
return IndexReg.getNode() != 0 || Base_Reg.getNode() != 0;
|
||||
}
|
||||
|
||||
|
||||
/// isRIPRelative - Return true if this addressing mode is already RIP
|
||||
/// relative.
|
||||
bool isRIPRelative() const {
|
||||
@ -94,7 +94,7 @@ namespace {
|
||||
return RegNode->getReg() == X86::RIP;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void setBaseReg(SDValue Reg) {
|
||||
BaseType = RegBase;
|
||||
Base_Reg = Reg;
|
||||
@ -104,7 +104,7 @@ namespace {
|
||||
dbgs() << "X86ISelAddressMode " << this << '\n';
|
||||
dbgs() << "Base_Reg ";
|
||||
if (Base_Reg.getNode() != 0)
|
||||
Base_Reg.getNode()->dump();
|
||||
Base_Reg.getNode()->dump();
|
||||
else
|
||||
dbgs() << "nul";
|
||||
dbgs() << " Base.FrameIndex " << Base_FrameIndex << '\n'
|
||||
@ -113,7 +113,7 @@ namespace {
|
||||
if (IndexReg.getNode() != 0)
|
||||
IndexReg.getNode()->dump();
|
||||
else
|
||||
dbgs() << "nul";
|
||||
dbgs() << "nul";
|
||||
dbgs() << " Disp " << Disp << '\n'
|
||||
<< "GV ";
|
||||
if (GV)
|
||||
@ -213,21 +213,21 @@ namespace {
|
||||
SDValue &Index, SDValue &Disp,
|
||||
SDValue &Segment,
|
||||
SDValue &NodeWithChain);
|
||||
|
||||
|
||||
bool TryFoldLoad(SDNode *P, SDValue N,
|
||||
SDValue &Base, SDValue &Scale,
|
||||
SDValue &Index, SDValue &Disp,
|
||||
SDValue &Segment);
|
||||
|
||||
|
||||
/// SelectInlineAsmMemoryOperand - Implement addressing mode selection for
|
||||
/// inline asm expressions.
|
||||
virtual bool SelectInlineAsmMemoryOperand(const SDValue &Op,
|
||||
char ConstraintCode,
|
||||
std::vector<SDValue> &OutOps);
|
||||
|
||||
|
||||
void EmitSpecialCodeForMain(MachineBasicBlock *BB, MachineFrameInfo *MFI);
|
||||
|
||||
inline void getAddressOperands(X86ISelAddressMode &AM, SDValue &Base,
|
||||
inline void getAddressOperands(X86ISelAddressMode &AM, SDValue &Base,
|
||||
SDValue &Scale, SDValue &Index,
|
||||
SDValue &Disp, SDValue &Segment) {
|
||||
Base = (AM.BaseType == X86ISelAddressMode::FrameIndexBase) ?
|
||||
@ -426,7 +426,7 @@ static bool isCalleeLoad(SDValue Callee, SDValue &Chain, bool HasCallSeq) {
|
||||
void X86DAGToDAGISel::PreprocessISelDAG() {
|
||||
// OptForSize is used in pattern predicates that isel is matching.
|
||||
OptForSize = MF->getFunction()->hasFnAttr(Attribute::OptimizeForSize);
|
||||
|
||||
|
||||
for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(),
|
||||
E = CurDAG->allnodes_end(); I != E; ) {
|
||||
SDNode *N = I++; // Preincrement iterator to avoid invalidation issues.
|
||||
@ -462,7 +462,7 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
|
||||
++NumLoadMoved;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Lower fpround and fpextend nodes that target the FP stack to be store and
|
||||
// load to the stack. This is a gross hack. We would like to simply mark
|
||||
// these as being illegal, but when we do that, legalize produces these when
|
||||
@ -473,7 +473,7 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
|
||||
// FIXME: This should only happen when not compiled with -O0.
|
||||
if (N->getOpcode() != ISD::FP_ROUND && N->getOpcode() != ISD::FP_EXTEND)
|
||||
continue;
|
||||
|
||||
|
||||
EVT SrcVT = N->getOperand(0).getValueType();
|
||||
EVT DstVT = N->getValueType(0);
|
||||
|
||||
@ -496,7 +496,7 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
|
||||
if (N->getConstantOperandVal(1))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Here we could have an FP stack truncation or an FPStack <-> SSE convert.
|
||||
// FPStack has extload and truncstore. SSE can fold direct loads into other
|
||||
// operations. Based on this, decide what we want to do.
|
||||
@ -505,10 +505,10 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
|
||||
MemVT = DstVT; // FP_ROUND must use DstVT, we can't do a 'trunc load'.
|
||||
else
|
||||
MemVT = SrcIsSSE ? SrcVT : DstVT;
|
||||
|
||||
|
||||
SDValue MemTmp = CurDAG->CreateStackTemporary(MemVT);
|
||||
DebugLoc dl = N->getDebugLoc();
|
||||
|
||||
|
||||
// FIXME: optimize the case where the src/dest is a load or store?
|
||||
SDValue Store = CurDAG->getTruncStore(CurDAG->getEntryNode(), dl,
|
||||
N->getOperand(0),
|
||||
@ -524,12 +524,12 @@ void X86DAGToDAGISel::PreprocessISelDAG() {
|
||||
// To avoid invalidating 'I', back it up to the convert node.
|
||||
--I;
|
||||
CurDAG->ReplaceAllUsesOfValueWith(SDValue(N, 0), Result);
|
||||
|
||||
|
||||
// Now that we did that, the node is dead. Increment the iterator to the
|
||||
// next node to process, then delete N.
|
||||
++I;
|
||||
CurDAG->DeleteNode(N);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -584,7 +584,7 @@ bool X86DAGToDAGISel::FoldOffsetIntoAddress(uint64_t Offset,
|
||||
|
||||
bool X86DAGToDAGISel::MatchLoadInAddress(LoadSDNode *N, X86ISelAddressMode &AM){
|
||||
SDValue Address = N->getOperand(1);
|
||||
|
||||
|
||||
// load gs:0 -> GS segment register.
|
||||
// load fs:0 -> FS segment register.
|
||||
//
|
||||
@ -602,7 +602,7 @@ bool X86DAGToDAGISel::MatchLoadInAddress(LoadSDNode *N, X86ISelAddressMode &AM){
|
||||
AM.Segment = CurDAG->getRegister(X86::FS, MVT::i16);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -992,7 +992,7 @@ bool X86DAGToDAGISel::MatchAddressRecursively(SDValue N, X86ISelAddressMode &AM,
|
||||
case ISD::SHL:
|
||||
if (AM.IndexReg.getNode() != 0 || AM.Scale != 1)
|
||||
break;
|
||||
|
||||
|
||||
if (ConstantSDNode
|
||||
*CN = dyn_cast<ConstantSDNode>(N.getNode()->getOperand(1))) {
|
||||
unsigned Val = CN->getZExtValue();
|
||||
@ -1167,7 +1167,7 @@ bool X86DAGToDAGISel::MatchAddressRecursively(SDValue N, X86ISelAddressMode &AM,
|
||||
!MatchAddressRecursively(Handle.getValue().getOperand(1), AM, Depth+1))
|
||||
return false;
|
||||
AM = Backup;
|
||||
|
||||
|
||||
// Try again after commuting the operands.
|
||||
if (!MatchAddressRecursively(Handle.getValue().getOperand(1), AM, Depth+1)&&
|
||||
!MatchAddressRecursively(Handle.getValue().getOperand(0), AM, Depth+1))
|
||||
@ -1203,7 +1203,7 @@ bool X86DAGToDAGISel::MatchAddressRecursively(SDValue N, X86ISelAddressMode &AM,
|
||||
AM = Backup;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ISD::AND: {
|
||||
// Perform some heroic transforms on an and of a constant-count shift
|
||||
// with a constant to enable use of the scaled offset field.
|
||||
@ -1275,7 +1275,7 @@ bool X86DAGToDAGISel::SelectAddr(SDNode *Parent, SDValue N, SDValue &Base,
|
||||
SDValue &Scale, SDValue &Index,
|
||||
SDValue &Disp, SDValue &Segment) {
|
||||
X86ISelAddressMode AM;
|
||||
|
||||
|
||||
if (Parent &&
|
||||
// This list of opcodes are all the nodes that have an "addr:$ptr" operand
|
||||
// that are not a MemSDNode, and thus don't have proper addrspace info.
|
||||
@ -1290,7 +1290,7 @@ bool X86DAGToDAGISel::SelectAddr(SDNode *Parent, SDValue N, SDValue &Base,
|
||||
if (AddrSpace == 257)
|
||||
AM.Segment = CurDAG->getRegister(X86::FS, MVT::i16);
|
||||
}
|
||||
|
||||
|
||||
if (MatchAddress(N, AM))
|
||||
return false;
|
||||
|
||||
@ -1336,7 +1336,7 @@ bool X86DAGToDAGISel::SelectScalarSSELoad(SDNode *Root,
|
||||
// elements. This is a vector shuffle from the zero vector.
|
||||
if (N.getOpcode() == X86ISD::VZEXT_MOVL && N.getNode()->hasOneUse() &&
|
||||
// Check to see if the top elements are all zeros (or bitcast of zeros).
|
||||
N.getOperand(0).getOpcode() == ISD::SCALAR_TO_VECTOR &&
|
||||
N.getOperand(0).getOpcode() == ISD::SCALAR_TO_VECTOR &&
|
||||
N.getOperand(0).getNode()->hasOneUse() &&
|
||||
ISD::isNON_EXTLoad(N.getOperand(0).getOperand(0).getNode()) &&
|
||||
N.getOperand(0).getOperand(0).hasOneUse() &&
|
||||
@ -1411,7 +1411,7 @@ bool X86DAGToDAGISel::SelectLEAAddr(SDValue N,
|
||||
// If it isn't worth using an LEA, reject it.
|
||||
if (Complexity <= 2)
|
||||
return false;
|
||||
|
||||
|
||||
getAddressOperands(AM, Base, Scale, Index, Disp, Segment);
|
||||
return true;
|
||||
}
|
||||
@ -1422,7 +1422,7 @@ bool X86DAGToDAGISel::SelectTLSADDRAddr(SDValue N, SDValue &Base,
|
||||
SDValue &Disp, SDValue &Segment) {
|
||||
assert(N.getOpcode() == ISD::TargetGlobalTLSAddress);
|
||||
const GlobalAddressSDNode *GA = cast<GlobalAddressSDNode>(N);
|
||||
|
||||
|
||||
X86ISelAddressMode AM;
|
||||
AM.GV = GA->getGlobal();
|
||||
AM.Disp += GA->getOffset();
|
||||
@ -1435,7 +1435,7 @@ bool X86DAGToDAGISel::SelectTLSADDRAddr(SDValue N, SDValue &Base,
|
||||
} else {
|
||||
AM.IndexReg = CurDAG->getRegister(0, MVT::i64);
|
||||
}
|
||||
|
||||
|
||||
getAddressOperands(AM, Base, Scale, Index, Disp, Segment);
|
||||
return true;
|
||||
}
|
||||
@ -1449,7 +1449,7 @@ bool X86DAGToDAGISel::TryFoldLoad(SDNode *P, SDValue N,
|
||||
!IsProfitableToFold(N, P, P) ||
|
||||
!IsLegalToFold(N, P, P, OptLevel))
|
||||
return false;
|
||||
|
||||
|
||||
return SelectAddr(N.getNode(),
|
||||
N.getOperand(1), Base, Scale, Index, Disp, Segment);
|
||||
}
|
||||
@ -1700,7 +1700,7 @@ static const uint16_t AtomicOpcTbl[AtomicOpcEnd][AtomicSzEnd] = {
|
||||
SDNode *X86DAGToDAGISel::SelectAtomicLoadArith(SDNode *Node, EVT NVT) {
|
||||
if (Node->hasAnyUseOfValue(0))
|
||||
return 0;
|
||||
|
||||
|
||||
// Optimize common patterns for __sync_or_and_fetch and similar arith
|
||||
// operations where the result is not used. This allows us to use the "lock"
|
||||
// version of the arithmetic instruction.
|
||||
@ -1727,14 +1727,14 @@ SDNode *X86DAGToDAGISel::SelectAtomicLoadArith(SDNode *Node, EVT NVT) {
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool isCN = false;
|
||||
ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Val);
|
||||
if (CN && (int32_t)CN->getSExtValue() == CN->getSExtValue()) {
|
||||
isCN = true;
|
||||
Val = CurDAG->getTargetConstant(CN->getSExtValue(), NVT);
|
||||
}
|
||||
|
||||
|
||||
unsigned Opc = 0;
|
||||
switch (NVT.getSimpleVT().SimpleTy) {
|
||||
default: return 0;
|
||||
@ -1772,7 +1772,7 @@ SDNode *X86DAGToDAGISel::SelectAtomicLoadArith(SDNode *Node, EVT NVT) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
assert(Opc != 0 && "Invalid arith lock transform!");
|
||||
|
||||
DebugLoc dl = Node->getDebugLoc();
|
||||
@ -1852,7 +1852,7 @@ static bool HasNoSignedComparisonUses(SDNode *N) {
|
||||
/// isLoadIncOrDecStore - Check whether or not the chain ending in StoreNode
|
||||
/// is suitable for doing the {load; increment or decrement; store} to modify
|
||||
/// transformation.
|
||||
static bool isLoadIncOrDecStore(StoreSDNode *StoreNode, unsigned Opc,
|
||||
static bool isLoadIncOrDecStore(StoreSDNode *StoreNode, unsigned Opc,
|
||||
SDValue StoredVal, SelectionDAG *CurDAG,
|
||||
LoadSDNode* &LoadNode, SDValue &InputChain) {
|
||||
|
||||
@ -1876,15 +1876,15 @@ static bool isLoadIncOrDecStore(StoreSDNode *StoreNode, unsigned Opc,
|
||||
// Return LoadNode by reference.
|
||||
LoadNode = cast<LoadSDNode>(Load);
|
||||
// is the size of the value one that we can handle? (i.e. 64, 32, 16, or 8)
|
||||
EVT LdVT = LoadNode->getMemoryVT();
|
||||
if (LdVT != MVT::i64 && LdVT != MVT::i32 && LdVT != MVT::i16 &&
|
||||
EVT LdVT = LoadNode->getMemoryVT();
|
||||
if (LdVT != MVT::i64 && LdVT != MVT::i32 && LdVT != MVT::i16 &&
|
||||
LdVT != MVT::i8)
|
||||
return false;
|
||||
|
||||
// Is store the only read of the loaded value?
|
||||
if (!Load.hasOneUse())
|
||||
return false;
|
||||
|
||||
|
||||
// Is the address of the store the same as the load?
|
||||
if (LoadNode->getBasePtr() != StoreNode->getBasePtr() ||
|
||||
LoadNode->getOffset() != StoreNode->getOffset())
|
||||
@ -1990,7 +1990,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
||||
unsigned Opc, MOpc;
|
||||
unsigned Opcode = Node->getOpcode();
|
||||
DebugLoc dl = Node->getDebugLoc();
|
||||
|
||||
|
||||
DEBUG(dbgs() << "Selecting: "; Node->dump(CurDAG); dbgs() << '\n');
|
||||
|
||||
if (Node->isMachineOpcode()) {
|
||||
@ -2168,7 +2168,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
||||
case X86ISD::UMUL: {
|
||||
SDValue N0 = Node->getOperand(0);
|
||||
SDValue N1 = Node->getOperand(1);
|
||||
|
||||
|
||||
unsigned LoReg;
|
||||
switch (NVT.getSimpleVT().SimpleTy) {
|
||||
default: llvm_unreachable("Unsupported VT!");
|
||||
@ -2177,20 +2177,20 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
||||
case MVT::i32: LoReg = X86::EAX; Opc = X86::MUL32r; break;
|
||||
case MVT::i64: LoReg = X86::RAX; Opc = X86::MUL64r; break;
|
||||
}
|
||||
|
||||
|
||||
SDValue InFlag = CurDAG->getCopyToReg(CurDAG->getEntryNode(), dl, LoReg,
|
||||
N0, SDValue()).getValue(1);
|
||||
|
||||
|
||||
SDVTList VTs = CurDAG->getVTList(NVT, NVT, MVT::i32);
|
||||
SDValue Ops[] = {N1, InFlag};
|
||||
SDNode *CNode = CurDAG->getMachineNode(Opc, dl, VTs, Ops, 2);
|
||||
|
||||
|
||||
ReplaceUses(SDValue(Node, 0), SDValue(CNode, 0));
|
||||
ReplaceUses(SDValue(Node, 1), SDValue(CNode, 1));
|
||||
ReplaceUses(SDValue(Node, 2), SDValue(CNode, 2));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
case ISD::SMUL_LOHI:
|
||||
case ISD::UMUL_LOHI: {
|
||||
SDValue N0 = Node->getOperand(0);
|
||||
@ -2287,7 +2287,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
||||
ReplaceUses(SDValue(Node, 1), Result);
|
||||
DEBUG(dbgs() << "=> "; Result.getNode()->dump(CurDAG); dbgs() << '\n');
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -2555,7 +2555,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
||||
// a simple increment or decrement through memory of that value, if the
|
||||
// uses of the modified value and its address are suitable.
|
||||
// The DEC64m tablegen pattern is currently not able to match the case where
|
||||
// the EFLAGS on the original DEC are used. (This also applies to
|
||||
// the EFLAGS on the original DEC are used. (This also applies to
|
||||
// {INC,DEC}X{64,32,16,8}.)
|
||||
// We'll need to improve tablegen to allow flags to be transferred from a
|
||||
// node in the pattern to the result node. probably with a new keyword
|
||||
@ -2587,7 +2587,7 @@ SDNode *X86DAGToDAGISel::Select(SDNode *Node) {
|
||||
MemOp[0] = StoreNode->getMemOperand();
|
||||
MemOp[1] = LoadNode->getMemOperand();
|
||||
const SDValue Ops[] = { Base, Scale, Index, Disp, Segment, InputChain };
|
||||
EVT LdVT = LoadNode->getMemoryVT();
|
||||
EVT LdVT = LoadNode->getMemoryVT();
|
||||
unsigned newOpc = getFusedLdStOpcode(LdVT, Opc);
|
||||
MachineSDNode *Result = CurDAG->getMachineNode(newOpc,
|
||||
Node->getDebugLoc(),
|
||||
@ -2627,7 +2627,7 @@ SelectInlineAsmMemoryOperand(const SDValue &Op, char ConstraintCode,
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
OutOps.push_back(Op0);
|
||||
OutOps.push_back(Op1);
|
||||
OutOps.push_back(Op2);
|
||||
@ -2636,7 +2636,7 @@ SelectInlineAsmMemoryOperand(const SDValue &Op, char ConstraintCode,
|
||||
return false;
|
||||
}
|
||||
|
||||
/// createX86ISelDag - This pass converts a legalized DAG into a
|
||||
/// createX86ISelDag - This pass converts a legalized DAG into a
|
||||
/// X86-specific DAG, ready for instruction scheduling.
|
||||
///
|
||||
FunctionPass *llvm::createX86ISelDag(X86TargetMachine &TM,
|
||||
|
@ -173,7 +173,7 @@ X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
|
||||
// For 64-bit since we have so many registers use the ILP scheduler, for
|
||||
// 32-bit code use the register pressure specific scheduling.
|
||||
// For Atom, always use ILP scheduling.
|
||||
if (Subtarget->isAtom())
|
||||
if (Subtarget->isAtom())
|
||||
setSchedulingPreference(Sched::ILP);
|
||||
else if (Subtarget->is64Bit())
|
||||
setSchedulingPreference(Sched::ILP);
|
||||
@ -7761,9 +7761,9 @@ SDValue X86TargetLowering::LowerUINT_TO_FP_i64(SDValue Op,
|
||||
punpckldq (c0), %xmm0 // c0: (uint4){ 0x43300000U, 0x45300000U, 0U, 0U }
|
||||
subpd (c1), %xmm0 // c1: (double2){ 0x1.0p52, 0x1.0p52 * 0x1.0p32 }
|
||||
#ifdef __SSE3__
|
||||
haddpd %xmm0, %xmm0
|
||||
haddpd %xmm0, %xmm0
|
||||
#else
|
||||
pshufd $0x4e, %xmm0, %xmm1
|
||||
pshufd $0x4e, %xmm0, %xmm1
|
||||
addpd %xmm1, %xmm0
|
||||
#endif
|
||||
*/
|
||||
@ -8090,7 +8090,7 @@ SDValue X86TargetLowering::LowerFABS(SDValue Op,
|
||||
EltVT = VT.getVectorElementType();
|
||||
Constant *C;
|
||||
if (EltVT == MVT::f64) {
|
||||
C = ConstantVector::getSplat(2,
|
||||
C = ConstantVector::getSplat(2,
|
||||
ConstantFP::get(*Context, APFloat(APInt(64, ~(1ULL << 63)))));
|
||||
} else {
|
||||
C = ConstantVector::getSplat(4,
|
||||
@ -8814,11 +8814,11 @@ SDValue X86TargetLowering::LowerSELECT(SDValue Op, SelectionDAG &DAG) const {
|
||||
// (select (x != 0), -1, 0) -> neg & sbb
|
||||
// (select (x == 0), 0, -1) -> neg & sbb
|
||||
if (ConstantSDNode *YC = dyn_cast<ConstantSDNode>(Y))
|
||||
if (YC->isNullValue() &&
|
||||
if (YC->isNullValue() &&
|
||||
(isAllOnes(Op1) == (CondCode == X86::COND_NE))) {
|
||||
SDVTList VTs = DAG.getVTList(CmpOp0.getValueType(), MVT::i32);
|
||||
SDValue Neg = DAG.getNode(X86ISD::SUB, DL, VTs,
|
||||
DAG.getConstant(0, CmpOp0.getValueType()),
|
||||
SDValue Neg = DAG.getNode(X86ISD::SUB, DL, VTs,
|
||||
DAG.getConstant(0, CmpOp0.getValueType()),
|
||||
CmpOp0);
|
||||
SDValue Res = DAG.getNode(X86ISD::SETCC_CARRY, DL, Op.getValueType(),
|
||||
DAG.getConstant(X86::COND_B, MVT::i8),
|
||||
@ -11118,7 +11118,7 @@ void X86TargetLowering::ReplaceNodeResults(SDNode *N,
|
||||
Regs64bit ? X86::RBX : X86::EBX,
|
||||
swapInL, cpInH.getValue(1));
|
||||
swapInH = DAG.getCopyToReg(swapInL.getValue(0), dl,
|
||||
Regs64bit ? X86::RCX : X86::ECX,
|
||||
Regs64bit ? X86::RCX : X86::ECX,
|
||||
swapInH, swapInL.getValue(1));
|
||||
SDValue Ops[] = { swapInH.getValue(0),
|
||||
N->getOperand(1),
|
||||
@ -13075,7 +13075,7 @@ static SDValue PerformShuffleCombine256(SDNode *N, SelectionDAG &DAG,
|
||||
false/*WriteMem*/);
|
||||
return DAG.getNode(ISD::BITCAST, dl, VT, ResNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Emit a zeroed vector and insert the desired subvector on its
|
||||
// first half.
|
||||
@ -13141,7 +13141,7 @@ static SDValue PerformShuffleCombine(SDNode *N, SelectionDAG &DAG,
|
||||
/// a sequence of vector shuffle operations.
|
||||
/// It is possible when we truncate 256-bit vector to 128-bit vector
|
||||
|
||||
SDValue X86TargetLowering::PerformTruncateCombine(SDNode *N, SelectionDAG &DAG,
|
||||
SDValue X86TargetLowering::PerformTruncateCombine(SDNode *N, SelectionDAG &DAG,
|
||||
DAGCombinerInfo &DCI) const {
|
||||
if (!DCI.isBeforeLegalizeOps())
|
||||
return SDValue();
|
||||
@ -15230,7 +15230,7 @@ static SDValue PerformZExtCombine(SDNode *N, SelectionDAG &DAG,
|
||||
static SDValue PerformISDSETCCCombine(SDNode *N, SelectionDAG &DAG) {
|
||||
ISD::CondCode CC = cast<CondCodeSDNode>(N->getOperand(2))->get();
|
||||
SDValue LHS = N->getOperand(0);
|
||||
SDValue RHS = N->getOperand(1);
|
||||
SDValue RHS = N->getOperand(1);
|
||||
|
||||
if ((CC == ISD::SETNE || CC == ISD::SETEQ) && LHS.getOpcode() == ISD::SUB)
|
||||
if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(LHS.getOperand(0)))
|
||||
|
@ -65,7 +65,7 @@ namespace llvm {
|
||||
/// referenced global symbols.
|
||||
virtual void relocate(void *Function, MachineRelocation *MR,
|
||||
unsigned NumRelocs, unsigned char* GOTBase);
|
||||
|
||||
|
||||
/// allocateThreadLocalMemory - Each target has its own way of
|
||||
/// handling thread local variables. This method returns a value only
|
||||
/// meaningful to the target.
|
||||
|
@ -46,12 +46,12 @@ GetSymbolFromOperand(const MachineOperand &MO) const {
|
||||
assert((MO.isGlobal() || MO.isSymbol()) && "Isn't a symbol reference");
|
||||
|
||||
SmallString<128> Name;
|
||||
|
||||
|
||||
if (!MO.isGlobal()) {
|
||||
assert(MO.isSymbol());
|
||||
Name += MAI.getGlobalPrefix();
|
||||
Name += MO.getSymbolName();
|
||||
} else {
|
||||
} else {
|
||||
const GlobalValue *GV = MO.getGlobal();
|
||||
bool isImplicitlyPrivate = false;
|
||||
if (MO.getTargetFlags() == X86II::MO_DARWIN_STUB ||
|
||||
@ -59,7 +59,7 @@ GetSymbolFromOperand(const MachineOperand &MO) const {
|
||||
MO.getTargetFlags() == X86II::MO_DARWIN_NONLAZY_PIC_BASE ||
|
||||
MO.getTargetFlags() == X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE)
|
||||
isImplicitlyPrivate = true;
|
||||
|
||||
|
||||
Mang->getNameWithPrefix(Name, GV, isImplicitlyPrivate);
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ GetSymbolFromOperand(const MachineOperand &MO) const {
|
||||
getMachOMMI().getFnStubEntry(Sym);
|
||||
if (StubSym.getPointer())
|
||||
return Sym;
|
||||
|
||||
|
||||
if (MO.isGlobal()) {
|
||||
StubSym =
|
||||
MachineModuleInfoImpl::
|
||||
@ -135,7 +135,7 @@ MCOperand X86MCInstLower::LowerSymbolOperand(const MachineOperand &MO,
|
||||
// lot of extra uniquing.
|
||||
const MCExpr *Expr = 0;
|
||||
MCSymbolRefExpr::VariantKind RefKind = MCSymbolRefExpr::VK_None;
|
||||
|
||||
|
||||
switch (MO.getTargetFlags()) {
|
||||
default: llvm_unreachable("Unknown target flag on GV operand");
|
||||
case X86II::MO_NO_FLAG: // No flag.
|
||||
@ -144,7 +144,7 @@ MCOperand X86MCInstLower::LowerSymbolOperand(const MachineOperand &MO,
|
||||
case X86II::MO_DLLIMPORT:
|
||||
case X86II::MO_DARWIN_STUB:
|
||||
break;
|
||||
|
||||
|
||||
case X86II::MO_TLVP: RefKind = MCSymbolRefExpr::VK_TLVP; break;
|
||||
case X86II::MO_TLVP_PIC_BASE:
|
||||
Expr = MCSymbolRefExpr::Create(Sym, MCSymbolRefExpr::VK_TLVP, Ctx);
|
||||
@ -173,7 +173,7 @@ MCOperand X86MCInstLower::LowerSymbolOperand(const MachineOperand &MO,
|
||||
case X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE:
|
||||
Expr = MCSymbolRefExpr::Create(Sym, Ctx);
|
||||
// Subtract the pic base.
|
||||
Expr = MCBinaryExpr::CreateSub(Expr,
|
||||
Expr = MCBinaryExpr::CreateSub(Expr,
|
||||
MCSymbolRefExpr::Create(MF.getPICBaseSymbol(), Ctx),
|
||||
Ctx);
|
||||
if (MO.isJTI() && MAI.hasSetDirective()) {
|
||||
@ -187,10 +187,10 @@ MCOperand X86MCInstLower::LowerSymbolOperand(const MachineOperand &MO,
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (Expr == 0)
|
||||
Expr = MCSymbolRefExpr::Create(Sym, RefKind, Ctx);
|
||||
|
||||
|
||||
if (!MO.isJTI() && MO.getOffset())
|
||||
Expr = MCBinaryExpr::CreateAdd(Expr,
|
||||
MCConstantExpr::Create(MO.getOffset(), Ctx),
|
||||
@ -211,10 +211,10 @@ static void lower_lea64_32mem(MCInst *MI, unsigned OpNo) {
|
||||
// Convert registers in the addr mode according to subreg64.
|
||||
for (unsigned i = 0; i != 4; ++i) {
|
||||
if (!MI->getOperand(OpNo+i).isReg()) continue;
|
||||
|
||||
|
||||
unsigned Reg = MI->getOperand(OpNo+i).getReg();
|
||||
if (Reg == 0) continue;
|
||||
|
||||
|
||||
MI->getOperand(OpNo+i).setReg(getX86SubSuperRegister(Reg, MVT::i64));
|
||||
}
|
||||
}
|
||||
@ -280,7 +280,7 @@ static void SimplifyShortMoveForm(X86AsmPrinter &Printer, MCInst &Inst,
|
||||
return;
|
||||
|
||||
// Check whether this is an absolute address.
|
||||
// FIXME: We know TLVP symbol refs aren't, but there should be a better way
|
||||
// FIXME: We know TLVP symbol refs aren't, but there should be a better way
|
||||
// to do this here.
|
||||
bool Absolute = true;
|
||||
if (Inst.getOperand(AddrOp).isExpr()) {
|
||||
@ -289,7 +289,7 @@ static void SimplifyShortMoveForm(X86AsmPrinter &Printer, MCInst &Inst,
|
||||
if (SRE->getKind() == MCSymbolRefExpr::VK_TLVP)
|
||||
Absolute = false;
|
||||
}
|
||||
|
||||
|
||||
if (Absolute &&
|
||||
(Inst.getOperand(AddrBase + 0).getReg() != 0 ||
|
||||
Inst.getOperand(AddrBase + 2).getReg() != 0 ||
|
||||
@ -306,10 +306,10 @@ static void SimplifyShortMoveForm(X86AsmPrinter &Printer, MCInst &Inst,
|
||||
|
||||
void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
||||
OutMI.setOpcode(MI->getOpcode());
|
||||
|
||||
|
||||
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
||||
const MachineOperand &MO = MI->getOperand(i);
|
||||
|
||||
|
||||
MCOperand MCOp;
|
||||
switch (MO.getType()) {
|
||||
default:
|
||||
@ -345,10 +345,10 @@ void X86MCInstLower::Lower(const MachineInstr *MI, MCInst &OutMI) const {
|
||||
// Ignore call clobbers.
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
OutMI.addOperand(MCOp);
|
||||
}
|
||||
|
||||
|
||||
// Handle a few special cases to eliminate operand modifiers.
|
||||
ReSimplify:
|
||||
switch (OutMI.getOpcode()) {
|
||||
@ -425,7 +425,7 @@ ReSimplify:
|
||||
case X86::TAILJMPd:
|
||||
case X86::TAILJMPd64: Opcode = X86::JMP_1; break;
|
||||
}
|
||||
|
||||
|
||||
MCOperand Saved = OutMI.getOperand(0);
|
||||
OutMI = MCInst();
|
||||
OutMI.setOpcode(Opcode);
|
||||
@ -445,7 +445,7 @@ ReSimplify:
|
||||
case X86::ADD16ri8_DB: OutMI.setOpcode(X86::OR16ri8); goto ReSimplify;
|
||||
case X86::ADD32ri8_DB: OutMI.setOpcode(X86::OR32ri8); goto ReSimplify;
|
||||
case X86::ADD64ri8_DB: OutMI.setOpcode(X86::OR64ri8); goto ReSimplify;
|
||||
|
||||
|
||||
// The assembler backend wants to see branches in their small form and relax
|
||||
// them to their large form. The JIT can only handle the large form because
|
||||
// it does not do relaxation. For now, translate the large form to the
|
||||
@ -688,7 +688,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
// call "L1$pb"
|
||||
// "L1$pb":
|
||||
// popl %esi
|
||||
|
||||
|
||||
// Emit the call.
|
||||
MCSymbol *PICBase = MF->getPICBaseSymbol();
|
||||
TmpInst.setOpcode(X86::CALLpcrel32);
|
||||
@ -697,43 +697,43 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
TmpInst.addOperand(MCOperand::CreateExpr(MCSymbolRefExpr::Create(PICBase,
|
||||
OutContext)));
|
||||
OutStreamer.EmitInstruction(TmpInst);
|
||||
|
||||
|
||||
// Emit the label.
|
||||
OutStreamer.EmitLabel(PICBase);
|
||||
|
||||
|
||||
// popl $reg
|
||||
TmpInst.setOpcode(X86::POP32r);
|
||||
TmpInst.getOperand(0) = MCOperand::CreateReg(MI->getOperand(0).getReg());
|
||||
OutStreamer.EmitInstruction(TmpInst);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
case X86::ADD32ri: {
|
||||
// Lower the MO_GOT_ABSOLUTE_ADDRESS form of ADD32ri.
|
||||
if (MI->getOperand(2).getTargetFlags() != X86II::MO_GOT_ABSOLUTE_ADDRESS)
|
||||
break;
|
||||
|
||||
|
||||
// Okay, we have something like:
|
||||
// EAX = ADD32ri EAX, MO_GOT_ABSOLUTE_ADDRESS(@MYGLOBAL)
|
||||
|
||||
|
||||
// For this, we want to print something like:
|
||||
// MYGLOBAL + (. - PICBASE)
|
||||
// However, we can't generate a ".", so just emit a new label here and refer
|
||||
// to it.
|
||||
MCSymbol *DotSym = OutContext.CreateTempSymbol();
|
||||
OutStreamer.EmitLabel(DotSym);
|
||||
|
||||
|
||||
// Now that we have emitted the label, lower the complex operand expression.
|
||||
MCSymbol *OpSym = MCInstLowering.GetSymbolFromOperand(MI->getOperand(2));
|
||||
|
||||
|
||||
const MCExpr *DotExpr = MCSymbolRefExpr::Create(DotSym, OutContext);
|
||||
const MCExpr *PICBase =
|
||||
MCSymbolRefExpr::Create(MF->getPICBaseSymbol(), OutContext);
|
||||
DotExpr = MCBinaryExpr::CreateSub(DotExpr, PICBase, OutContext);
|
||||
|
||||
DotExpr = MCBinaryExpr::CreateAdd(MCSymbolRefExpr::Create(OpSym,OutContext),
|
||||
|
||||
DotExpr = MCBinaryExpr::CreateAdd(MCSymbolRefExpr::Create(OpSym,OutContext),
|
||||
DotExpr, OutContext);
|
||||
|
||||
|
||||
MCInst TmpInst;
|
||||
TmpInst.setOpcode(X86::ADD32ri);
|
||||
TmpInst.addOperand(MCOperand::CreateReg(MI->getOperand(0).getReg()));
|
||||
@ -743,7 +743,7 @@ void X86AsmPrinter::EmitInstruction(const MachineInstr *MI) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MCInst TmpInst;
|
||||
MCInstLowering.Lower(MI, TmpInst);
|
||||
OutStreamer.EmitInstruction(TmpInst);
|
||||
|
@ -25,7 +25,7 @@ namespace llvm {
|
||||
class Mangler;
|
||||
class TargetMachine;
|
||||
class X86AsmPrinter;
|
||||
|
||||
|
||||
/// X86MCInstLower - This class is used to lower an MachineInstr into an MCInst.
|
||||
class LLVM_LIBRARY_VISIBILITY X86MCInstLower {
|
||||
MCContext &Ctx;
|
||||
@ -37,12 +37,12 @@ class LLVM_LIBRARY_VISIBILITY X86MCInstLower {
|
||||
public:
|
||||
X86MCInstLower(Mangler *mang, const MachineFunction &MF,
|
||||
X86AsmPrinter &asmprinter);
|
||||
|
||||
|
||||
void Lower(const MachineInstr *MI, MCInst &OutMI) const;
|
||||
|
||||
MCSymbol *GetSymbolFromOperand(const MachineOperand &MO) const;
|
||||
MCOperand LowerSymbolOperand(const MachineOperand &MO, MCSymbol *Sym) const;
|
||||
|
||||
|
||||
private:
|
||||
MachineModuleInfoMachO &getMachOMMI() const;
|
||||
};
|
||||
|
@ -24,7 +24,7 @@ class X86MachineFunctionInfo : public MachineFunctionInfo {
|
||||
virtual void anchor();
|
||||
|
||||
/// ForceFramePointer - True if the function is required to use of frame
|
||||
/// pointer for reasons other than it containing dynamic allocation or
|
||||
/// pointer for reasons other than it containing dynamic allocation or
|
||||
/// that FP eliminatation is turned off. For example, Cygwin main function
|
||||
/// contains stack pointer re-alignment code which requires FP.
|
||||
bool ForceFramePointer;
|
||||
@ -83,7 +83,7 @@ public:
|
||||
VarArgsFPOffset(0),
|
||||
ArgumentStackSize(0),
|
||||
NumLocalDynamics(0) {}
|
||||
|
||||
|
||||
explicit X86MachineFunctionInfo(MachineFunction &MF)
|
||||
: ForceFramePointer(false),
|
||||
CalleeSavedFrameSize(0),
|
||||
@ -99,7 +99,7 @@ public:
|
||||
ArgumentStackSize(0),
|
||||
NumLocalDynamics(0) {}
|
||||
|
||||
bool getForceFramePointer() const { return ForceFramePointer;}
|
||||
bool getForceFramePointer() const { return ForceFramePointer;}
|
||||
void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; }
|
||||
|
||||
unsigned getCalleeSavedFrameSize() const { return CalleeSavedFrameSize; }
|
||||
|
@ -78,7 +78,7 @@ X86RegisterInfo::X86RegisterInfo(X86TargetMachine &tm,
|
||||
FramePtr = X86::EBP;
|
||||
}
|
||||
// Use a callee-saved register as the base pointer. These registers must
|
||||
// not conflict with any ABI requirements. For example, in 32-bit mode PIC
|
||||
// not conflict with any ABI requirements. For example, in 32-bit mode PIC
|
||||
// requires GOT in the EBX register before function calls via PLT GOT pointer.
|
||||
BasePtr = Is64Bit ? X86::RBX : X86::ESI;
|
||||
}
|
||||
@ -368,7 +368,7 @@ bool X86RegisterInfo::hasBasePointer(const MachineFunction &MF) const {
|
||||
if (!EnableBasePointer)
|
||||
return false;
|
||||
|
||||
// When we need stack realignment and there are dynamic allocas, we can't
|
||||
// When we need stack realignment and there are dynamic allocas, we can't
|
||||
// reference off of the stack pointer, so we reserve a base pointer.
|
||||
if (needsStackRealignment(MF) && MFI->hasVarSizedObjects())
|
||||
return true;
|
||||
|
@ -21,7 +21,7 @@ namespace llvm {
|
||||
/// RelocationType - An enum for the x86 relocation codes. Note that
|
||||
/// the terminology here doesn't follow x86 convention - word means
|
||||
/// 32-bit and dword means 64-bit. The relocations will be treated
|
||||
/// by JIT or ObjectCode emitters, this is transparent to the x86 code
|
||||
/// by JIT or ObjectCode emitters, this is transparent to the x86 code
|
||||
/// emitter but JIT and ObjectCode will treat them differently
|
||||
enum RelocationType {
|
||||
/// reloc_pcrel_word - PC relative relocation, add the relocated value to
|
||||
|
@ -38,7 +38,7 @@ X86SelectionDAGInfo::EmitTargetCodeForMemset(SelectionDAG &DAG, DebugLoc dl,
|
||||
// If to a segment-relative address space, use the default lowering.
|
||||
if (DstPtrInfo.getAddrSpace() >= 256)
|
||||
return SDValue();
|
||||
|
||||
|
||||
// If not DWORD aligned or size is more than the threshold, call the library.
|
||||
// The libc version is likely to be faster for these cases. It can use the
|
||||
// address value and run time information about the CPU.
|
||||
|
@ -39,10 +39,10 @@ unsigned char X86Subtarget::
|
||||
ClassifyBlockAddressReference() const {
|
||||
if (isPICStyleGOT()) // 32-bit ELF targets.
|
||||
return X86II::MO_GOTOFF;
|
||||
|
||||
|
||||
if (isPICStyleStubPIC()) // Darwin/32 in PIC mode.
|
||||
return X86II::MO_PIC_BASE_OFFSET;
|
||||
|
||||
|
||||
// Direct static reference to label.
|
||||
return X86II::MO_NO_FLAG;
|
||||
}
|
||||
@ -69,7 +69,7 @@ ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const {
|
||||
// Large model never uses stubs.
|
||||
if (TM.getCodeModel() == CodeModel::Large)
|
||||
return X86II::MO_NO_FLAG;
|
||||
|
||||
|
||||
if (isTargetDarwin()) {
|
||||
// If symbol visibility is hidden, the extra load is not needed if
|
||||
// target is x86-64 or the symbol is definitely defined in the current
|
||||
@ -87,18 +87,18 @@ ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const {
|
||||
|
||||
return X86II::MO_NO_FLAG;
|
||||
}
|
||||
|
||||
|
||||
if (isPICStyleGOT()) { // 32-bit ELF targets.
|
||||
// Extra load is needed for all externally visible.
|
||||
if (GV->hasLocalLinkage() || GV->hasHiddenVisibility())
|
||||
return X86II::MO_GOTOFF;
|
||||
return X86II::MO_GOT;
|
||||
}
|
||||
|
||||
|
||||
if (isPICStyleStubPIC()) { // Darwin/32 in PIC mode.
|
||||
// Determine whether we have a stub reference and/or whether the reference
|
||||
// is relative to the PIC base or not.
|
||||
|
||||
|
||||
// If this is a strong reference to a definition, it is definitely not
|
||||
// through a stub.
|
||||
if (!isDecl && !GV->isWeakForLinker())
|
||||
@ -108,26 +108,26 @@ ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const {
|
||||
// normal $non_lazy_ptr stub because this symbol might be resolved late.
|
||||
if (!GV->hasHiddenVisibility()) // Non-hidden $non_lazy_ptr reference.
|
||||
return X86II::MO_DARWIN_NONLAZY_PIC_BASE;
|
||||
|
||||
|
||||
// If symbol visibility is hidden, we have a stub for common symbol
|
||||
// references and external declarations.
|
||||
if (isDecl || GV->hasCommonLinkage()) {
|
||||
// Hidden $non_lazy_ptr reference.
|
||||
return X86II::MO_DARWIN_HIDDEN_NONLAZY_PIC_BASE;
|
||||
}
|
||||
|
||||
|
||||
// Otherwise, no stub.
|
||||
return X86II::MO_PIC_BASE_OFFSET;
|
||||
}
|
||||
|
||||
|
||||
if (isPICStyleStubNoDynamic()) { // Darwin/32 in -mdynamic-no-pic mode.
|
||||
// Determine whether we have a stub reference.
|
||||
|
||||
|
||||
// If this is a strong reference to a definition, it is definitely not
|
||||
// through a stub.
|
||||
if (!isDecl && !GV->isWeakForLinker())
|
||||
return X86II::MO_NO_FLAG;
|
||||
|
||||
|
||||
// Unless we have a symbol with hidden visibility, we have to go through a
|
||||
// normal $non_lazy_ptr stub because this symbol might be resolved late.
|
||||
if (!GV->hasHiddenVisibility()) // Non-hidden $non_lazy_ptr reference.
|
||||
@ -136,7 +136,7 @@ ClassifyGlobalReference(const GlobalValue *GV, const TargetMachine &TM) const {
|
||||
// Otherwise, no stub.
|
||||
return X86II::MO_NO_FLAG;
|
||||
}
|
||||
|
||||
|
||||
// Direct static reference to global.
|
||||
return X86II::MO_NO_FLAG;
|
||||
}
|
||||
@ -315,7 +315,7 @@ void X86Subtarget::AutoDetectSubtargetFeatures() {
|
||||
}
|
||||
|
||||
X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
|
||||
const std::string &FS,
|
||||
const std::string &FS,
|
||||
unsigned StackAlignOverride, bool is64Bit)
|
||||
: X86GenSubtargetInfo(TT, CPU, FS)
|
||||
, X86ProcFamily(Others)
|
||||
|
@ -55,7 +55,7 @@ protected:
|
||||
|
||||
/// X86ProcFamily - X86 processor family: Intel Atom, and others
|
||||
X86ProcFamilyEnum X86ProcFamily;
|
||||
|
||||
|
||||
/// PICStyle - Which PIC style to use
|
||||
///
|
||||
PICStyles::Style PICStyle;
|
||||
@ -149,7 +149,7 @@ protected:
|
||||
|
||||
/// TargetTriple - What processor and OS we're targeting.
|
||||
Triple TargetTriple;
|
||||
|
||||
|
||||
/// Instruction itineraries for scheduling
|
||||
InstrItineraryData InstrItins;
|
||||
|
||||
|
@ -222,7 +222,7 @@ bool VZeroUpperInserter::processBasicBlock(MachineFunction &MF,
|
||||
DebugLoc dl = I->getDebugLoc();
|
||||
bool isControlFlow = MI->isCall() || MI->isReturn();
|
||||
|
||||
// Shortcut: don't need to check regular instructions in dirty state.
|
||||
// Shortcut: don't need to check regular instructions in dirty state.
|
||||
if (!isControlFlow && CurState == ST_DIRTY)
|
||||
continue;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user