Do not move any values into registers for a void return (there isn't anything).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Misha Brukman
2004-06-25 19:04:27 +00:00
parent 1cbb3ee75f
commit d47bbf7ce5
2 changed files with 46 additions and 40 deletions

View File

@@ -1062,6 +1062,8 @@ void ISel::promote32(unsigned targetReg, const ValueRecord &VR) {
/// visitReturnInst - implemented with BLR
///
void ISel::visitReturnInst(ReturnInst &I) {
// Only do the processing if this is a non-void return
if (I.getNumOperands() > 0) {
Value *RetVal = I.getOperand(0);
switch (getClassB(RetVal->getType())) {
case cByte: // integral return values: extend or move into r3 and return
@@ -1083,6 +1085,7 @@ void ISel::visitReturnInst(ReturnInst &I) {
default:
visitInstruction(I);
}
}
BuildMI(BB, PPC32::BLR, 1).addImm(0);
}

View File

@@ -1062,6 +1062,8 @@ void ISel::promote32(unsigned targetReg, const ValueRecord &VR) {
/// visitReturnInst - implemented with BLR
///
void ISel::visitReturnInst(ReturnInst &I) {
// Only do the processing if this is a non-void return
if (I.getNumOperands() > 0) {
Value *RetVal = I.getOperand(0);
switch (getClassB(RetVal->getType())) {
case cByte: // integral return values: extend or move into r3 and return
@@ -1083,6 +1085,7 @@ void ISel::visitReturnInst(ReturnInst &I) {
default:
visitInstruction(I);
}
}
BuildMI(BB, PPC32::BLR, 1).addImm(0);
}