mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Move FP_REG_KILL closer to the actual branch instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10563 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e0bb3e766d
commit
9abc81790e
@ -883,11 +883,12 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
|
||||
///
|
||||
void ISel::visitBranchInst(BranchInst &BI) {
|
||||
BasicBlock *NextBB = getBlockAfter(BI.getParent()); // BB after current one
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
|
||||
if (!BI.isConditional()) { // Unconditional branch?
|
||||
if (BI.getSuccessor(0) != NextBB)
|
||||
if (BI.getSuccessor(0) != NextBB) {
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
BuildMI(BB, X86::JMP, 1).addPCDisp(BI.getSuccessor(0));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -898,6 +899,7 @@ void ISel::visitBranchInst(BranchInst &BI) {
|
||||
// computed some other way...
|
||||
unsigned condReg = getReg(BI.getCondition());
|
||||
BuildMI(BB, X86::CMPri8, 2).addReg(condReg).addZImm(0);
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
if (BI.getSuccessor(1) == NextBB) {
|
||||
if (BI.getSuccessor(0) != NextBB)
|
||||
BuildMI(BB, X86::JNE, 1).addPCDisp(BI.getSuccessor(0));
|
||||
@ -936,6 +938,7 @@ void ISel::visitBranchInst(BranchInst &BI) {
|
||||
X86::JS, X86::JNS },
|
||||
};
|
||||
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
if (BI.getSuccessor(0) != NextBB) {
|
||||
BuildMI(BB, OpcodeTab[isSigned][OpNum], 1).addPCDisp(BI.getSuccessor(0));
|
||||
if (BI.getSuccessor(1) != NextBB)
|
||||
|
@ -883,11 +883,12 @@ static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
|
||||
///
|
||||
void ISel::visitBranchInst(BranchInst &BI) {
|
||||
BasicBlock *NextBB = getBlockAfter(BI.getParent()); // BB after current one
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
|
||||
if (!BI.isConditional()) { // Unconditional branch?
|
||||
if (BI.getSuccessor(0) != NextBB)
|
||||
if (BI.getSuccessor(0) != NextBB) {
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
BuildMI(BB, X86::JMP, 1).addPCDisp(BI.getSuccessor(0));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -898,6 +899,7 @@ void ISel::visitBranchInst(BranchInst &BI) {
|
||||
// computed some other way...
|
||||
unsigned condReg = getReg(BI.getCondition());
|
||||
BuildMI(BB, X86::CMPri8, 2).addReg(condReg).addZImm(0);
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
if (BI.getSuccessor(1) == NextBB) {
|
||||
if (BI.getSuccessor(0) != NextBB)
|
||||
BuildMI(BB, X86::JNE, 1).addPCDisp(BI.getSuccessor(0));
|
||||
@ -936,6 +938,7 @@ void ISel::visitBranchInst(BranchInst &BI) {
|
||||
X86::JS, X86::JNS },
|
||||
};
|
||||
|
||||
BuildMI(BB, X86::FP_REG_KILL, 0);
|
||||
if (BI.getSuccessor(0) != NextBB) {
|
||||
BuildMI(BB, OpcodeTab[isSigned][OpNum], 1).addPCDisp(BI.getSuccessor(0));
|
||||
if (BI.getSuccessor(1) != NextBB)
|
||||
|
Loading…
Reference in New Issue
Block a user