mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Get rid of the EdgeMapping map. Instead, just check for BasicBlock
changes before doing phi lowering for switches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102809 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0456b06191
commit
af1d8ca44a
@ -477,8 +477,7 @@ namespace llvm {
|
|||||||
/// EmitSchedule - Insert MachineInstrs into the MachineBasicBlock
|
/// EmitSchedule - Insert MachineInstrs into the MachineBasicBlock
|
||||||
/// according to the order specified in Sequence.
|
/// according to the order specified in Sequence.
|
||||||
///
|
///
|
||||||
virtual MachineBasicBlock*
|
virtual MachineBasicBlock *EmitSchedule() = 0;
|
||||||
EmitSchedule(DenseMap<MachineBasicBlock*, MachineBasicBlock*>*) = 0;
|
|
||||||
|
|
||||||
void dumpSchedule() const;
|
void dumpSchedule() const;
|
||||||
|
|
||||||
|
@ -1427,12 +1427,8 @@ public:
|
|||||||
// insert. The specified MachineInstr is created but not inserted into any
|
// insert. The specified MachineInstr is created but not inserted into any
|
||||||
// basic blocks, and this method is called to expand it into a sequence of
|
// basic blocks, and this method is called to expand it into a sequence of
|
||||||
// instructions, potentially also creating new basic blocks and control flow.
|
// instructions, potentially also creating new basic blocks and control flow.
|
||||||
// When new basic blocks are inserted and the edges from MBB to its successors
|
virtual MachineBasicBlock *
|
||||||
// are modified, the method should insert pairs of <OldSucc, NewSucc> into the
|
EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *MBB) const;
|
||||||
// DenseMap.
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
|
||||||
MachineBasicBlock *MBB,
|
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
// Addressing mode description hooks (used by LSR etc).
|
// Addressing mode description hooks (used by LSR etc).
|
||||||
|
@ -284,7 +284,7 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
MachineInstr *MI = prior(I);
|
MachineInstr *MI = prior(I);
|
||||||
if (isSchedulingBoundary(MI, Fn)) {
|
if (isSchedulingBoundary(MI, Fn)) {
|
||||||
Scheduler.Run(MBB, I, Current, CurrentCount);
|
Scheduler.Run(MBB, I, Current, CurrentCount);
|
||||||
Scheduler.EmitSchedule(0);
|
Scheduler.EmitSchedule();
|
||||||
Current = MI;
|
Current = MI;
|
||||||
CurrentCount = Count - 1;
|
CurrentCount = Count - 1;
|
||||||
Scheduler.Observe(MI, CurrentCount);
|
Scheduler.Observe(MI, CurrentCount);
|
||||||
@ -296,7 +296,7 @@ bool PostRAScheduler::runOnMachineFunction(MachineFunction &Fn) {
|
|||||||
assert((MBB->begin() == Current || CurrentCount != 0) &&
|
assert((MBB->begin() == Current || CurrentCount != 0) &&
|
||||||
"Instruction count mismatch!");
|
"Instruction count mismatch!");
|
||||||
Scheduler.Run(MBB, MBB->begin(), Current, CurrentCount);
|
Scheduler.Run(MBB, MBB->begin(), Current, CurrentCount);
|
||||||
Scheduler.EmitSchedule(0);
|
Scheduler.EmitSchedule();
|
||||||
|
|
||||||
// Clean up register live-range state.
|
// Clean up register live-range state.
|
||||||
Scheduler.FinishBlock();
|
Scheduler.FinishBlock();
|
||||||
|
@ -572,8 +572,7 @@ std::string ScheduleDAGInstrs::getGraphNodeLabel(const SUnit *SU) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// EmitSchedule - Emit the machine code in scheduled order.
|
// EmitSchedule - Emit the machine code in scheduled order.
|
||||||
MachineBasicBlock *ScheduleDAGInstrs::
|
MachineBasicBlock *ScheduleDAGInstrs::EmitSchedule() {
|
||||||
EmitSchedule(DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) {
|
|
||||||
// For MachineInstr-based scheduling, we're rescheduling the instructions in
|
// For MachineInstr-based scheduling, we're rescheduling the instructions in
|
||||||
// the block, so start by removing them from the block.
|
// the block, so start by removing them from the block.
|
||||||
while (Begin != InsertPos) {
|
while (Begin != InsertPos) {
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#include "llvm/CodeGen/ScheduleDAG.h"
|
#include "llvm/CodeGen/ScheduleDAG.h"
|
||||||
#include "llvm/Support/Compiler.h"
|
#include "llvm/Support/Compiler.h"
|
||||||
#include "llvm/Target/TargetRegisterInfo.h"
|
#include "llvm/Target/TargetRegisterInfo.h"
|
||||||
#include "llvm/ADT/DenseMap.h"
|
|
||||||
#include "llvm/ADT/SmallSet.h"
|
#include "llvm/ADT/SmallSet.h"
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
@ -171,8 +170,7 @@ namespace llvm {
|
|||||||
virtual void ComputeOperandLatency(SUnit *Def, SUnit *Use,
|
virtual void ComputeOperandLatency(SUnit *Def, SUnit *Use,
|
||||||
SDep& dep) const;
|
SDep& dep) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock*
|
virtual MachineBasicBlock *EmitSchedule();
|
||||||
EmitSchedule(DenseMap<MachineBasicBlock*, MachineBasicBlock*>*);
|
|
||||||
|
|
||||||
/// StartBlock - Prepare to perform scheduling in the given block.
|
/// StartBlock - Prepare to perform scheduling in the given block.
|
||||||
///
|
///
|
||||||
|
@ -576,8 +576,7 @@ InstrEmitter::EmitDbgValue(SDDbgValue *SD,
|
|||||||
///
|
///
|
||||||
void InstrEmitter::
|
void InstrEmitter::
|
||||||
EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
|
EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
|
||||||
DenseMap<SDValue, unsigned> &VRBaseMap,
|
DenseMap<SDValue, unsigned> &VRBaseMap) {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) {
|
|
||||||
unsigned Opc = Node->getMachineOpcode();
|
unsigned Opc = Node->getMachineOpcode();
|
||||||
|
|
||||||
// Handle subreg insert/extract specially
|
// Handle subreg insert/extract specially
|
||||||
@ -638,7 +637,7 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
|
|||||||
if (II.usesCustomInsertionHook()) {
|
if (II.usesCustomInsertionHook()) {
|
||||||
// Insert this instruction into the basic block using a target
|
// Insert this instruction into the basic block using a target
|
||||||
// specific inserter which may returns a new basic block.
|
// specific inserter which may returns a new basic block.
|
||||||
MBB = TLI->EmitInstrWithCustomInserter(MI, MBB, EM);
|
MBB = TLI->EmitInstrWithCustomInserter(MI, MBB);
|
||||||
InsertPos = MBB->end();
|
InsertPos = MBB->end();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -108,10 +108,9 @@ public:
|
|||||||
/// EmitNode - Generate machine code for a node and needed dependencies.
|
/// EmitNode - Generate machine code for a node and needed dependencies.
|
||||||
///
|
///
|
||||||
void EmitNode(SDNode *Node, bool IsClone, bool IsCloned,
|
void EmitNode(SDNode *Node, bool IsClone, bool IsCloned,
|
||||||
DenseMap<SDValue, unsigned> &VRBaseMap,
|
DenseMap<SDValue, unsigned> &VRBaseMap) {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) {
|
|
||||||
if (Node->isMachineOpcode())
|
if (Node->isMachineOpcode())
|
||||||
EmitMachineNode(Node, IsClone, IsCloned, VRBaseMap, EM);
|
EmitMachineNode(Node, IsClone, IsCloned, VRBaseMap);
|
||||||
else
|
else
|
||||||
EmitSpecialNode(Node, IsClone, IsCloned, VRBaseMap);
|
EmitSpecialNode(Node, IsClone, IsCloned, VRBaseMap);
|
||||||
}
|
}
|
||||||
@ -128,8 +127,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
|
void EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
|
||||||
DenseMap<SDValue, unsigned> &VRBaseMap,
|
DenseMap<SDValue, unsigned> &VRBaseMap);
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM);
|
|
||||||
void EmitSpecialNode(SDNode *Node, bool IsClone, bool IsCloned,
|
void EmitSpecialNode(SDNode *Node, bool IsClone, bool IsCloned,
|
||||||
DenseMap<SDValue, unsigned> &VRBaseMap);
|
DenseMap<SDValue, unsigned> &VRBaseMap);
|
||||||
};
|
};
|
||||||
|
@ -460,8 +460,7 @@ static void ProcessSourceNode(SDNode *N, SelectionDAG *DAG,
|
|||||||
|
|
||||||
|
|
||||||
/// EmitSchedule - Emit the machine code in scheduled order.
|
/// EmitSchedule - Emit the machine code in scheduled order.
|
||||||
MachineBasicBlock *ScheduleDAGSDNodes::
|
MachineBasicBlock *ScheduleDAGSDNodes::EmitSchedule() {
|
||||||
EmitSchedule(DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) {
|
|
||||||
InstrEmitter Emitter(BB, InsertPos);
|
InstrEmitter Emitter(BB, InsertPos);
|
||||||
DenseMap<SDValue, unsigned> VRBaseMap;
|
DenseMap<SDValue, unsigned> VRBaseMap;
|
||||||
DenseMap<SUnit*, unsigned> CopyVRBaseMap;
|
DenseMap<SUnit*, unsigned> CopyVRBaseMap;
|
||||||
@ -503,14 +502,14 @@ EmitSchedule(DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) {
|
|||||||
while (!FlaggedNodes.empty()) {
|
while (!FlaggedNodes.empty()) {
|
||||||
SDNode *N = FlaggedNodes.back();
|
SDNode *N = FlaggedNodes.back();
|
||||||
Emitter.EmitNode(FlaggedNodes.back(), SU->OrigNode != SU, SU->isCloned,
|
Emitter.EmitNode(FlaggedNodes.back(), SU->OrigNode != SU, SU->isCloned,
|
||||||
VRBaseMap, EM);
|
VRBaseMap);
|
||||||
// Remember the source order of the inserted instruction.
|
// Remember the source order of the inserted instruction.
|
||||||
if (HasDbg)
|
if (HasDbg)
|
||||||
ProcessSourceNode(N, DAG, Emitter, VRBaseMap, Orders, Seen);
|
ProcessSourceNode(N, DAG, Emitter, VRBaseMap, Orders, Seen);
|
||||||
FlaggedNodes.pop_back();
|
FlaggedNodes.pop_back();
|
||||||
}
|
}
|
||||||
Emitter.EmitNode(SU->getNode(), SU->OrigNode != SU, SU->isCloned,
|
Emitter.EmitNode(SU->getNode(), SU->OrigNode != SU, SU->isCloned,
|
||||||
VRBaseMap, EM);
|
VRBaseMap);
|
||||||
// Remember the source order of the inserted instruction.
|
// Remember the source order of the inserted instruction.
|
||||||
if (HasDbg)
|
if (HasDbg)
|
||||||
ProcessSourceNode(SU->getNode(), DAG, Emitter, VRBaseMap, Orders,
|
ProcessSourceNode(SU->getNode(), DAG, Emitter, VRBaseMap, Orders,
|
||||||
|
@ -94,8 +94,7 @@ namespace llvm {
|
|||||||
///
|
///
|
||||||
virtual void ComputeLatency(SUnit *SU);
|
virtual void ComputeLatency(SUnit *SU);
|
||||||
|
|
||||||
virtual MachineBasicBlock *
|
virtual MachineBasicBlock *EmitSchedule();
|
||||||
EmitSchedule(DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM);
|
|
||||||
|
|
||||||
/// Schedule - Order nodes according to selected style, filling
|
/// Schedule - Order nodes according to selected style, filling
|
||||||
/// in the Sequence member.
|
/// in the Sequence member.
|
||||||
|
@ -148,9 +148,9 @@ namespace llvm {
|
|||||||
// When new basic blocks are inserted and the edges from MBB to its successors
|
// When new basic blocks are inserted and the edges from MBB to its successors
|
||||||
// are modified, the method should insert pairs of <OldSucc, NewSucc> into the
|
// are modified, the method should insert pairs of <OldSucc, NewSucc> into the
|
||||||
// DenseMap.
|
// DenseMap.
|
||||||
MachineBasicBlock *TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
MachineBasicBlock *MBB) const {
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
dbgs() << "If a target marks an instruction with "
|
dbgs() << "If a target marks an instruction with "
|
||||||
"'usesCustomInserter', it must implement "
|
"'usesCustomInserter', it must implement "
|
||||||
@ -592,9 +592,9 @@ MachineBasicBlock *SelectionDAGISel::CodeGenAndEmitDAG(MachineBasicBlock *BB) {
|
|||||||
// inserted into.
|
// inserted into.
|
||||||
if (TimePassesIsEnabled) {
|
if (TimePassesIsEnabled) {
|
||||||
NamedRegionTimer T("Instruction Creation", GroupName);
|
NamedRegionTimer T("Instruction Creation", GroupName);
|
||||||
BB = Scheduler->EmitSchedule(&SDB->EdgeMapping);
|
BB = Scheduler->EmitSchedule();
|
||||||
} else {
|
} else {
|
||||||
BB = Scheduler->EmitSchedule(&SDB->EdgeMapping);
|
BB = Scheduler->EmitSchedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Free the scheduler state.
|
// Free the scheduler state.
|
||||||
@ -998,21 +998,13 @@ SelectionDAGISel::FinishBasicBlock(MachineBasicBlock *BB) {
|
|||||||
// Emit the code
|
// Emit the code
|
||||||
SDB->visitSwitchCase(SDB->SwitchCases[i], BB);
|
SDB->visitSwitchCase(SDB->SwitchCases[i], BB);
|
||||||
CurDAG->setRoot(SDB->getRoot());
|
CurDAG->setRoot(SDB->getRoot());
|
||||||
BB = CodeGenAndEmitDAG(BB);
|
ThisBB = CodeGenAndEmitDAG(BB);
|
||||||
|
|
||||||
// Handle any PHI nodes in successors of this chunk, as if we were coming
|
// Handle any PHI nodes in successors of this chunk, as if we were coming
|
||||||
// from the original BB before switch expansion. Note that PHI nodes can
|
// from the original BB before switch expansion. Note that PHI nodes can
|
||||||
// occur multiple times in PHINodesToUpdate. We have to be very careful to
|
// occur multiple times in PHINodesToUpdate. We have to be very careful to
|
||||||
// handle them the right number of times.
|
// handle them the right number of times.
|
||||||
while ((BB = SDB->SwitchCases[i].TrueBB)) { // Handle LHS and RHS.
|
while ((BB = SDB->SwitchCases[i].TrueBB)) { // Handle LHS and RHS.
|
||||||
// If new BB's are created during scheduling, the edges may have been
|
|
||||||
// updated. That is, the edge from ThisBB to BB may have been split and
|
|
||||||
// BB's predecessor is now another block.
|
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*>::iterator EI =
|
|
||||||
SDB->EdgeMapping.find(BB);
|
|
||||||
if (EI != SDB->EdgeMapping.end())
|
|
||||||
ThisBB = EI->second;
|
|
||||||
|
|
||||||
// BB may have been removed from the CFG if a branch was constant folded.
|
// BB may have been removed from the CFG if a branch was constant folded.
|
||||||
if (ThisBB->isSuccessor(BB)) {
|
if (ThisBB->isSuccessor(BB)) {
|
||||||
for (MachineBasicBlock::iterator Phi = BB->begin();
|
for (MachineBasicBlock::iterator Phi = BB->begin();
|
||||||
|
@ -3381,8 +3381,7 @@ ARMTargetLowering::EmitAtomicBinary(MachineInstr *MI, MachineBasicBlock *BB,
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
bool isThumb2 = Subtarget->isThumb2();
|
bool isThumb2 = Subtarget->isThumb2();
|
||||||
@ -3466,12 +3465,9 @@ ARMTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
F->insert(It, sinkMBB);
|
F->insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
||||||
E = BB->succ_end(); I != E; ++I) {
|
E = BB->succ_end(); I != E; ++I)
|
||||||
EM->insert(std::make_pair(*I, sinkMBB));
|
|
||||||
sinkMBB->addSuccessor(*I);
|
sinkMBB->addSuccessor(*I);
|
||||||
}
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
while (!BB->succ_empty())
|
while (!BB->succ_empty())
|
||||||
|
@ -174,9 +174,9 @@ namespace llvm {
|
|||||||
|
|
||||||
virtual const char *getTargetNodeName(unsigned Opcode) const;
|
virtual const char *getTargetNodeName(unsigned Opcode) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*>*) const;
|
MachineBasicBlock *MBB) const;
|
||||||
|
|
||||||
/// allowsUnalignedMemoryAccesses - Returns true if the target allows
|
/// allowsUnalignedMemoryAccesses - Returns true if the target allows
|
||||||
/// unaligned memory accesses. of the specified type.
|
/// unaligned memory accesses. of the specified type.
|
||||||
|
@ -832,8 +832,7 @@ getRegClassForInlineAsmConstraint(const std::string &Constraint,
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
AlphaTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
AlphaTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||||
assert((MI->getOpcode() == Alpha::CAS32 ||
|
assert((MI->getOpcode() == Alpha::CAS32 ||
|
||||||
MI->getOpcode() == Alpha::CAS64 ||
|
MI->getOpcode() == Alpha::CAS64 ||
|
||||||
@ -864,11 +863,6 @@ AlphaTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
MachineBasicBlock *llscMBB = F->CreateMachineBasicBlock(LLVM_BB);
|
MachineBasicBlock *llscMBB = F->CreateMachineBasicBlock(LLVM_BB);
|
||||||
MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB);
|
MachineBasicBlock *sinkMBB = F->CreateMachineBasicBlock(LLVM_BB);
|
||||||
|
|
||||||
// Inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
|
||||||
E = BB->succ_end(); I != E; ++I)
|
|
||||||
EM->insert(std::make_pair(*I, sinkMBB));
|
|
||||||
|
|
||||||
sinkMBB->transferSuccessors(thisMBB);
|
sinkMBB->transferSuccessors(thisMBB);
|
||||||
|
|
||||||
F->insert(It, llscMBB);
|
F->insert(It, llscMBB);
|
||||||
|
@ -91,9 +91,9 @@ namespace llvm {
|
|||||||
getRegClassForInlineAsmConstraint(const std::string &Constraint,
|
getRegClassForInlineAsmConstraint(const std::string &Constraint,
|
||||||
EVT VT) const;
|
EVT VT) const;
|
||||||
|
|
||||||
MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
MachineBasicBlock *
|
||||||
MachineBasicBlock *BB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *BB) const;
|
||||||
|
|
||||||
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
|
virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
|
||||||
|
|
||||||
|
@ -202,10 +202,9 @@ SDValue MBlazeTargetLowering::LowerOperation(SDValue Op,
|
|||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// Lower helper functions
|
// Lower helper functions
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
MachineBasicBlock* MBlazeTargetLowering::
|
MachineBasicBlock*
|
||||||
EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *BB,
|
MBlazeTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*,
|
MachineBasicBlock *BB) const {
|
||||||
MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
|
|
||||||
@ -255,12 +254,9 @@ EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *BB,
|
|||||||
|
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
||||||
e = BB->succ_end(); i != e; ++i) {
|
e = BB->succ_end(); i != e; ++i)
|
||||||
EM->insert(std::make_pair(*i, finish));
|
|
||||||
finish->addSuccessor(*i);
|
finish->addSuccessor(*i);
|
||||||
}
|
|
||||||
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
@ -351,12 +347,9 @@ EmitInstrWithCustomInserter(MachineInstr *MI, MachineBasicBlock *BB,
|
|||||||
|
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
||||||
e = BB->succ_end(); i != e; ++i) {
|
e = BB->succ_end(); i != e; ++i)
|
||||||
EM->insert(std::make_pair(*i, dneBB));
|
|
||||||
dneBB->addSuccessor(*i);
|
dneBB->addSuccessor(*i);
|
||||||
}
|
|
||||||
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
|
@ -119,9 +119,9 @@ namespace llvm {
|
|||||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||||
DebugLoc dl, SelectionDAG &DAG) const;
|
DebugLoc dl, SelectionDAG &DAG) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *MBB) const;
|
||||||
|
|
||||||
// Inline asm support
|
// Inline asm support
|
||||||
ConstraintType getConstraintType(const std::string &Constraint) const;
|
ConstraintType getConstraintType(const std::string &Constraint) const;
|
||||||
|
@ -1007,8 +1007,7 @@ bool MSP430TargetLowering::isZExtFree(EVT VT1, EVT VT2) const {
|
|||||||
|
|
||||||
MachineBasicBlock*
|
MachineBasicBlock*
|
||||||
MSP430TargetLowering::EmitShiftInstr(MachineInstr *MI,
|
MSP430TargetLowering::EmitShiftInstr(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
MachineFunction *F = BB->getParent();
|
MachineFunction *F = BB->getParent();
|
||||||
MachineRegisterInfo &RI = F->getRegInfo();
|
MachineRegisterInfo &RI = F->getRegInfo();
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
@ -1060,11 +1059,6 @@ MSP430TargetLowering::EmitShiftInstr(MachineInstr *MI,
|
|||||||
// block to the block containing instructions after shift.
|
// block to the block containing instructions after shift.
|
||||||
RemBB->transferSuccessors(BB);
|
RemBB->transferSuccessors(BB);
|
||||||
|
|
||||||
// Inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
|
|
||||||
SE = BB->succ_end(); SI != SE; ++SI)
|
|
||||||
EM->insert(std::make_pair(*SI, RemBB));
|
|
||||||
|
|
||||||
// Add adges BB => LoopBB => RemBB, BB => RemBB, LoopBB => LoopBB
|
// Add adges BB => LoopBB => RemBB, BB => RemBB, LoopBB => LoopBB
|
||||||
BB->addSuccessor(LoopBB);
|
BB->addSuccessor(LoopBB);
|
||||||
BB->addSuccessor(RemBB);
|
BB->addSuccessor(RemBB);
|
||||||
@ -1119,14 +1113,13 @@ MSP430TargetLowering::EmitShiftInstr(MachineInstr *MI,
|
|||||||
|
|
||||||
MachineBasicBlock*
|
MachineBasicBlock*
|
||||||
MSP430TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
MSP430TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
unsigned Opc = MI->getOpcode();
|
unsigned Opc = MI->getOpcode();
|
||||||
|
|
||||||
if (Opc == MSP430::Shl8 || Opc == MSP430::Shl16 ||
|
if (Opc == MSP430::Shl8 || Opc == MSP430::Shl16 ||
|
||||||
Opc == MSP430::Sra8 || Opc == MSP430::Sra16 ||
|
Opc == MSP430::Sra8 || Opc == MSP430::Sra16 ||
|
||||||
Opc == MSP430::Srl8 || Opc == MSP430::Srl16)
|
Opc == MSP430::Srl8 || Opc == MSP430::Srl16)
|
||||||
return EmitShiftInstr(MI, BB, EM);
|
return EmitShiftInstr(MI, BB);
|
||||||
|
|
||||||
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
@ -1157,10 +1150,6 @@ MSP430TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
.addImm(MI->getOperand(3).getImm());
|
.addImm(MI->getOperand(3).getImm());
|
||||||
F->insert(I, copy0MBB);
|
F->insert(I, copy0MBB);
|
||||||
F->insert(I, copy1MBB);
|
F->insert(I, copy1MBB);
|
||||||
// Inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
|
|
||||||
SE = BB->succ_end(); SI != SE; ++SI)
|
|
||||||
EM->insert(std::make_pair(*SI, copy1MBB));
|
|
||||||
// Update machine-CFG edges by transferring all successors of the current
|
// Update machine-CFG edges by transferring all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
copy1MBB->transferSuccessors(BB);
|
copy1MBB->transferSuccessors(BB);
|
||||||
|
@ -117,11 +117,9 @@ namespace llvm {
|
|||||||
virtual bool isZExtFree(EVT VT1, EVT VT2) const;
|
virtual bool isZExtFree(EVT VT1, EVT VT2) const;
|
||||||
|
|
||||||
MachineBasicBlock* EmitInstrWithCustomInserter(MachineInstr *MI,
|
MachineBasicBlock* EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const;
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
|
||||||
MachineBasicBlock* EmitShiftInstr(MachineInstr *MI,
|
MachineBasicBlock* EmitShiftInstr(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const;
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SDValue LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
SDValue LowerCCCCallTo(SDValue Chain, SDValue Callee,
|
||||||
|
@ -252,8 +252,7 @@ static Mips::CondCode FPCondCCodeToFCC(ISD::CondCode CC) {
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||||
bool isFPCmp = false;
|
bool isFPCmp = false;
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
@ -301,12 +300,9 @@ MipsTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
F->insert(It, sinkMBB);
|
F->insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
||||||
e = BB->succ_end(); i != e; ++i) {
|
e = BB->succ_end(); i != e; ++i)
|
||||||
EM->insert(std::make_pair(*i, sinkMBB));
|
|
||||||
sinkMBB->addSuccessor(*i);
|
sinkMBB->addSuccessor(*i);
|
||||||
}
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
while(!BB->succ_empty())
|
while(!BB->succ_empty())
|
||||||
|
@ -130,9 +130,9 @@ namespace llvm {
|
|||||||
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
const SmallVectorImpl<ISD::OutputArg> &Outs,
|
||||||
DebugLoc dl, SelectionDAG &DAG) const;
|
DebugLoc dl, SelectionDAG &DAG) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *MBB) const;
|
||||||
|
|
||||||
// Inline asm support
|
// Inline asm support
|
||||||
ConstraintType getConstraintType(const std::string &Constraint) const;
|
ConstraintType getConstraintType(const std::string &Constraint) const;
|
||||||
|
@ -1902,8 +1902,7 @@ SDValue PIC16TargetLowering::LowerSELECT_CC(SDValue Op,
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
PIC16TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
PIC16TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
||||||
unsigned CC = (PIC16CC::CondCodes)MI->getOperand(3).getImm();
|
unsigned CC = (PIC16CC::CondCodes)MI->getOperand(3).getImm();
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
@ -1931,12 +1930,9 @@ PIC16TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
|
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
||||||
E = BB->succ_end(); I != E; ++I) {
|
E = BB->succ_end(); I != E; ++I)
|
||||||
EM->insert(std::make_pair(*I, sinkMBB));
|
|
||||||
sinkMBB->addSuccessor(*I);
|
sinkMBB->addSuccessor(*I);
|
||||||
}
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
while (!BB->succ_empty())
|
while (!BB->succ_empty())
|
||||||
|
@ -119,10 +119,9 @@ namespace llvm {
|
|||||||
SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
|
SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
|
||||||
SDValue getPIC16Cmp(SDValue LHS, SDValue RHS, unsigned OrigCC, SDValue &CC,
|
SDValue getPIC16Cmp(SDValue LHS, SDValue RHS, unsigned OrigCC, SDValue &CC,
|
||||||
SelectionDAG &DAG, DebugLoc dl) const;
|
SelectionDAG &DAG, DebugLoc dl) const;
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *MBB) const;
|
||||||
|
|
||||||
|
|
||||||
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
|
||||||
virtual void ReplaceNodeResults(SDNode *N,
|
virtual void ReplaceNodeResults(SDNode *N,
|
||||||
|
@ -4684,8 +4684,7 @@ PPCTargetLowering::EmitPartwordAtomicBinary(MachineInstr *MI,
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||||
|
|
||||||
// To "insert" these instructions we actually have to insert their
|
// To "insert" these instructions we actually have to insert their
|
||||||
@ -4723,12 +4722,9 @@ PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
F->insert(It, sinkMBB);
|
F->insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
||||||
E = BB->succ_end(); I != E; ++I) {
|
E = BB->succ_end(); I != E; ++I)
|
||||||
EM->insert(std::make_pair(*I, sinkMBB));
|
|
||||||
sinkMBB->addSuccessor(*I);
|
sinkMBB->addSuccessor(*I);
|
||||||
}
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
while (!BB->succ_empty())
|
while (!BB->succ_empty())
|
||||||
|
@ -296,9 +296,9 @@ namespace llvm {
|
|||||||
const SelectionDAG &DAG,
|
const SelectionDAG &DAG,
|
||||||
unsigned Depth = 0) const;
|
unsigned Depth = 0) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *MBB) const;
|
||||||
MachineBasicBlock *EmitAtomicBinary(MachineInstr *MI,
|
MachineBasicBlock *EmitAtomicBinary(MachineInstr *MI,
|
||||||
MachineBasicBlock *MBB, bool is64Bit,
|
MachineBasicBlock *MBB, bool is64Bit,
|
||||||
unsigned BinOpcode) const;
|
unsigned BinOpcode) const;
|
||||||
|
@ -968,8 +968,7 @@ LowerOperation(SDValue Op, SelectionDAG &DAG) const {
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
SparcTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
SparcTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
||||||
unsigned BROpcode;
|
unsigned BROpcode;
|
||||||
unsigned CC;
|
unsigned CC;
|
||||||
@ -1013,12 +1012,9 @@ SparcTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
F->insert(It, sinkMBB);
|
F->insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
||||||
E = BB->succ_end(); I != E; ++I) {
|
E = BB->succ_end(); I != E; ++I)
|
||||||
EM->insert(std::make_pair(*I, sinkMBB));
|
|
||||||
sinkMBB->addSuccessor(*I);
|
sinkMBB->addSuccessor(*I);
|
||||||
}
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
while (!BB->succ_empty())
|
while (!BB->succ_empty())
|
||||||
|
@ -55,9 +55,9 @@ namespace llvm {
|
|||||||
const SelectionDAG &DAG,
|
const SelectionDAG &DAG,
|
||||||
unsigned Depth = 0) const;
|
unsigned Depth = 0) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *MBB) const;
|
||||||
|
|
||||||
virtual const char *getTargetNodeName(unsigned Opcode) const;
|
virtual const char *getTargetNodeName(unsigned Opcode) const;
|
||||||
|
|
||||||
|
@ -799,8 +799,7 @@ const char *SystemZTargetLowering::getTargetNodeName(unsigned Opcode) const {
|
|||||||
|
|
||||||
MachineBasicBlock*
|
MachineBasicBlock*
|
||||||
SystemZTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
SystemZTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const SystemZInstrInfo &TII = *TM.getInstrInfo();
|
const SystemZInstrInfo &TII = *TM.getInstrInfo();
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
assert((MI->getOpcode() == SystemZ::Select32 ||
|
assert((MI->getOpcode() == SystemZ::Select32 ||
|
||||||
@ -831,10 +830,6 @@ SystemZTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB);
|
BuildMI(BB, dl, TII.getBrCond(CC)).addMBB(copy1MBB);
|
||||||
F->insert(I, copy0MBB);
|
F->insert(I, copy0MBB);
|
||||||
F->insert(I, copy1MBB);
|
F->insert(I, copy1MBB);
|
||||||
// Inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator SI = BB->succ_begin(),
|
|
||||||
SE = BB->succ_end(); SI != SE; ++SI)
|
|
||||||
EM->insert(std::make_pair(*SI, copy1MBB));
|
|
||||||
// Update machine-CFG edges by transferring all successors of the current
|
// Update machine-CFG edges by transferring all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
copy1MBB->transferSuccessors(BB);
|
copy1MBB->transferSuccessors(BB);
|
||||||
|
@ -86,8 +86,7 @@ namespace llvm {
|
|||||||
|
|
||||||
|
|
||||||
MachineBasicBlock* EmitInstrWithCustomInserter(MachineInstr *MI,
|
MachineBasicBlock* EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const;
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
|
||||||
|
|
||||||
/// isFPImmLegal - Returns true if the target can instruction select the
|
/// isFPImmLegal - Returns true if the target can instruction select the
|
||||||
/// specified FP immediate natively. If false, the legalizer will
|
/// specified FP immediate natively. If false, the legalizer will
|
||||||
|
@ -8509,8 +8509,7 @@ X86TargetLowering::EmitVAStartSaveXMMRegsWithCustomInserter(
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
X86TargetLowering::EmitLoweredSelect(MachineInstr *MI,
|
X86TargetLowering::EmitLoweredSelect(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||||
DebugLoc DL = MI->getDebugLoc();
|
DebugLoc DL = MI->getDebugLoc();
|
||||||
|
|
||||||
@ -8539,12 +8538,9 @@ X86TargetLowering::EmitLoweredSelect(MachineInstr *MI,
|
|||||||
F->insert(It, sinkMBB);
|
F->insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
||||||
E = BB->succ_end(); I != E; ++I) {
|
E = BB->succ_end(); I != E; ++I)
|
||||||
EM->insert(std::make_pair(*I, sinkMBB));
|
|
||||||
sinkMBB->addSuccessor(*I);
|
sinkMBB->addSuccessor(*I);
|
||||||
}
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
while (!BB->succ_empty())
|
while (!BB->succ_empty())
|
||||||
@ -8571,8 +8567,7 @@ X86TargetLowering::EmitLoweredSelect(MachineInstr *MI,
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
X86TargetLowering::EmitLoweredMingwAlloca(MachineInstr *MI,
|
X86TargetLowering::EmitLoweredMingwAlloca(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
const TargetInstrInfo *TII = getTargetMachine().getInstrInfo();
|
||||||
DebugLoc DL = MI->getDebugLoc();
|
DebugLoc DL = MI->getDebugLoc();
|
||||||
MachineFunction *F = BB->getParent();
|
MachineFunction *F = BB->getParent();
|
||||||
@ -8595,12 +8590,11 @@ X86TargetLowering::EmitLoweredMingwAlloca(MachineInstr *MI,
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
switch (MI->getOpcode()) {
|
switch (MI->getOpcode()) {
|
||||||
default: assert(false && "Unexpected instr type to insert");
|
default: assert(false && "Unexpected instr type to insert");
|
||||||
case X86::MINGW_ALLOCA:
|
case X86::MINGW_ALLOCA:
|
||||||
return EmitLoweredMingwAlloca(MI, BB, EM);
|
return EmitLoweredMingwAlloca(MI, BB);
|
||||||
case X86::CMOV_GR8:
|
case X86::CMOV_GR8:
|
||||||
case X86::CMOV_V1I64:
|
case X86::CMOV_V1I64:
|
||||||
case X86::CMOV_FR32:
|
case X86::CMOV_FR32:
|
||||||
@ -8613,7 +8607,7 @@ X86TargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
case X86::CMOV_RFP32:
|
case X86::CMOV_RFP32:
|
||||||
case X86::CMOV_RFP64:
|
case X86::CMOV_RFP64:
|
||||||
case X86::CMOV_RFP80:
|
case X86::CMOV_RFP80:
|
||||||
return EmitLoweredSelect(MI, BB, EM);
|
return EmitLoweredSelect(MI, BB);
|
||||||
|
|
||||||
case X86::FP32_TO_INT16_IN_MEM:
|
case X86::FP32_TO_INT16_IN_MEM:
|
||||||
case X86::FP32_TO_INT32_IN_MEM:
|
case X86::FP32_TO_INT32_IN_MEM:
|
||||||
|
@ -453,9 +453,9 @@ namespace llvm {
|
|||||||
/// and some i16 instructions are slow.
|
/// and some i16 instructions are slow.
|
||||||
virtual bool IsDesirableToPromoteOp(SDValue Op, EVT &PVT) const;
|
virtual bool IsDesirableToPromoteOp(SDValue Op, EVT &PVT) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *MBB) const;
|
||||||
|
|
||||||
|
|
||||||
/// getTargetNodeName - This method returns the name of a target specific
|
/// getTargetNodeName - This method returns the name of a target specific
|
||||||
@ -806,12 +806,10 @@ namespace llvm {
|
|||||||
MachineBasicBlock *BB) const;
|
MachineBasicBlock *BB) const;
|
||||||
|
|
||||||
MachineBasicBlock *EmitLoweredSelect(MachineInstr *I,
|
MachineBasicBlock *EmitLoweredSelect(MachineInstr *I,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const;
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
|
||||||
|
|
||||||
MachineBasicBlock *EmitLoweredMingwAlloca(MachineInstr *MI,
|
MachineBasicBlock *EmitLoweredMingwAlloca(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const;
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
|
||||||
|
|
||||||
/// Emit nodes that will be selected as "test Op0,Op0", or something
|
/// Emit nodes that will be selected as "test Op0,Op0", or something
|
||||||
/// equivalent, for use with the given x86 condition code.
|
/// equivalent, for use with the given x86 condition code.
|
||||||
|
@ -1197,8 +1197,7 @@ XCoreTargetLowering::LowerReturn(SDValue Chain,
|
|||||||
|
|
||||||
MachineBasicBlock *
|
MachineBasicBlock *
|
||||||
XCoreTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
XCoreTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
MachineBasicBlock *BB,
|
MachineBasicBlock *BB) const {
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const {
|
|
||||||
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
const TargetInstrInfo &TII = *getTargetMachine().getInstrInfo();
|
||||||
DebugLoc dl = MI->getDebugLoc();
|
DebugLoc dl = MI->getDebugLoc();
|
||||||
assert((MI->getOpcode() == XCore::SELECT_CC) &&
|
assert((MI->getOpcode() == XCore::SELECT_CC) &&
|
||||||
@ -1228,12 +1227,9 @@ XCoreTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
F->insert(It, sinkMBB);
|
F->insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by first adding all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
// Also inform sdisel of the edge changes.
|
|
||||||
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
for (MachineBasicBlock::succ_iterator I = BB->succ_begin(),
|
||||||
E = BB->succ_end(); I != E; ++I) {
|
E = BB->succ_end(); I != E; ++I)
|
||||||
EM->insert(std::make_pair(*I, sinkMBB));
|
|
||||||
sinkMBB->addSuccessor(*I);
|
sinkMBB->addSuccessor(*I);
|
||||||
}
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
// Next, remove all successors of the current block, and add the true
|
||||||
// and fallthrough blocks as its successors.
|
// and fallthrough blocks as its successors.
|
||||||
while (!BB->succ_empty())
|
while (!BB->succ_empty())
|
||||||
|
@ -95,9 +95,9 @@ namespace llvm {
|
|||||||
// DAG node.
|
// DAG node.
|
||||||
virtual const char *getTargetNodeName(unsigned Opcode) const;
|
virtual const char *getTargetNodeName(unsigned Opcode) const;
|
||||||
|
|
||||||
virtual MachineBasicBlock *EmitInstrWithCustomInserter(MachineInstr *MI,
|
virtual MachineBasicBlock *
|
||||||
MachineBasicBlock *MBB,
|
EmitInstrWithCustomInserter(MachineInstr *MI,
|
||||||
DenseMap<MachineBasicBlock*, MachineBasicBlock*> *EM) const;
|
MachineBasicBlock *MBB) const;
|
||||||
|
|
||||||
virtual bool isLegalAddressingMode(const AddrMode &AM,
|
virtual bool isLegalAddressingMode(const AddrMode &AM,
|
||||||
const Type *Ty) const;
|
const Type *Ty) const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user