Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Target/PowerPC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ add_llvm_target(PowerPCCodeGen
PPCTargetTransformInfo.cpp
PPCTOCRegDeps.cpp
PPCTLSDynamicCall.cpp
PPCVSXCopy.cpp
PPCVSXWACCCopy.cpp
PPCReduceCRLogicals.cpp
PPCVSXFMAMutate.cpp
PPCVSXSwapRemoval.cpp
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/PowerPC/PPC.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ModulePass;
FunctionPass *createPPCLoopInstrFormPrepPass(PPCTargetMachine &TM);
FunctionPass *createPPCTOCRegDepsPass();
FunctionPass *createPPCEarlyReturnPass();
FunctionPass *createPPCVSXCopyPass();
FunctionPass *createPPCVSXWACCCopyPass();
FunctionPass *createPPCVSXFMAMutatePass();
FunctionPass *createPPCVSXSwapRemovalPass();
FunctionPass *createPPCReduceCRLogicalsPass();
Expand All @@ -64,7 +64,7 @@ class ModulePass;
void initializePPCLoopInstrFormPrepPass(PassRegistry&);
void initializePPCTOCRegDepsPass(PassRegistry&);
void initializePPCEarlyReturnPass(PassRegistry&);
void initializePPCVSXCopyPass(PassRegistry&);
void initializePPCVSXWACCCopyPass(PassRegistry &);
void initializePPCVSXFMAMutatePass(PassRegistry&);
void initializePPCVSXSwapRemovalPass(PassRegistry&);
void initializePPCReduceCRLogicalsPass(PassRegistry&);
Expand Down
43 changes: 43 additions & 0 deletions llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "llvm/CodeGen/PseudoSourceValue.h"
#include "llvm/CodeGen/RegisterClassInfo.h"
#include "llvm/CodeGen/RegisterPressure.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/CodeGen/ScheduleDAG.h"
#include "llvm/CodeGen/SlotIndexes.h"
#include "llvm/CodeGen/StackMaps.h"
Expand Down Expand Up @@ -1863,6 +1864,48 @@ void PPCInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
.addReg(SrcRegSub1)
.addReg(SrcRegSub1, getKillRegState(KillSrc));
return;
} else if ((PPC::WACCRCRegClass.contains(DestReg) ||
PPC::WACC_HIRCRegClass.contains(DestReg)) &&
(PPC::WACCRCRegClass.contains(SrcReg) ||
PPC::WACC_HIRCRegClass.contains(SrcReg))) {

Opc = PPC::WACCRCRegClass.contains(SrcReg) ? PPC::DMXXEXTFDMR512
: PPC::DMXXEXTFDMR512_HI;

RegScavenger RS;
RS.enterBasicBlockEnd(MBB);
RS.backward(std::next(I));

Register TmpReg1 = RS.scavengeRegisterBackwards(PPC::VSRpRCRegClass, I,
/* RestoreAfter */ false, 0,
/* AllowSpill */ false);

RS.setRegUsed(TmpReg1);
Register TmpReg2 = RS.scavengeRegisterBackwards(PPC::VSRpRCRegClass, I,
/* RestoreAfter */ false, 0,
/* AllowSpill */ false);

BuildMI(MBB, I, DL, get(Opc))
.addReg(TmpReg1, RegState::Define)
.addReg(TmpReg2, RegState::Define)
.addReg(SrcReg, getKillRegState(KillSrc));

Opc = PPC::WACCRCRegClass.contains(DestReg) ? PPC::DMXXINSTDMR512
: PPC::DMXXINSTDMR512_HI;

BuildMI(MBB, I, DL, get(Opc), DestReg)
.addReg(TmpReg1, RegState::Kill)
.addReg(TmpReg2, RegState::Kill);

return;
} else if (PPC::DMRRCRegClass.contains(DestReg) &&
PPC::DMRRCRegClass.contains(SrcReg)) {

BuildMI(MBB, I, DL, get(PPC::DMMR), DestReg)
.addReg(SrcReg, getKillRegState(KillSrc));

return;

} else
llvm_unreachable("Impossible reg-to-reg copy");

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ LLVMInitializePowerPCTarget() {
initializePPCLoopInstrFormPrepPass(PR);
initializePPCTOCRegDepsPass(PR);
initializePPCEarlyReturnPass(PR);
initializePPCVSXCopyPass(PR);
initializePPCVSXWACCCopyPass(PR);
initializePPCVSXFMAMutatePass(PR);
initializePPCVSXSwapRemovalPass(PR);
initializePPCReduceCRLogicalsPass(PR);
Expand Down Expand Up @@ -528,7 +528,7 @@ bool PPCPassConfig::addInstSelector() {
addPass(createPPCCTRLoopsVerify());
#endif

addPass(createPPCVSXCopyPass());
addPass(createPPCVSXWACCCopyPass());
return false;
}

Expand Down
159 changes: 0 additions & 159 deletions llvm/lib/Target/PowerPC/PPCVSXCopy.cpp

This file was deleted.

Loading
Loading