From 3b91807da740b76f05024c64d98f0f1a3c0bd0e7 Mon Sep 17 00:00:00 2001 From: Andrew Lenharth Date: Mon, 27 Jun 2005 15:36:48 +0000 Subject: [PATCH] who said we had to use the return address in the return address register. Might save a move in many cases git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22293 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/Alpha/AlphaISelPattern.cpp | 7 +++++-- lib/Target/Alpha/AlphaRegisterInfo.td | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/Target/Alpha/AlphaISelPattern.cpp b/lib/Target/Alpha/AlphaISelPattern.cpp index e2610c44064..9c9b3d6db08 100644 --- a/lib/Target/Alpha/AlphaISelPattern.cpp +++ b/lib/Target/Alpha/AlphaISelPattern.cpp @@ -179,6 +179,10 @@ namespace { { BuildMI(BB, Alpha::BIS, 2, Alpha::R26).addReg(RA).addReg(RA); } + unsigned getRA() + { + return RA; + } }; } @@ -2310,8 +2314,7 @@ void AlphaISel::Select(SDOperand N) { Select(N.getOperand(0)); break; } - AlphaLowering.restoreRA(BB); - BuildMI(BB, Alpha::RET, 1, Alpha::R31).addReg(Alpha::R26); // Just emit a 'ret' instruction + BuildMI(BB, Alpha::RET, 1, Alpha::R31).addReg(AlphaLowering.getRA()); // Just emit a 'ret' instruction return; case ISD::TRUNCSTORE: diff --git a/lib/Target/Alpha/AlphaRegisterInfo.td b/lib/Target/Alpha/AlphaRegisterInfo.td index 7957bedbf74..8ead9760f89 100644 --- a/lib/Target/Alpha/AlphaRegisterInfo.td +++ b/lib/Target/Alpha/AlphaRegisterInfo.td @@ -78,14 +78,14 @@ def F30 : FPR<30, "$f30">; def F31 : FPR<31, "$f31">; // $28 is undefined after any and all calls /// Register classes +// Don't allocate 15, 28, 30, 31 def GPRC : RegisterClass; + R9, R10, R11, R12, R13, R14, R29 ]>; // Note: R28 is reserved for the assembler - //leave FP alone // Don't allocate 15, 29, 30, 31 // Allocation volatiles only for now -- 2.11.0