Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(615)

Side by Side Diff: lib/Target/ARM/ARMBaseRegisterInfo.cpp

Issue 1154253004: Use R0/R1 instead of R4/R5 for ARM eh_return return values (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-llvm.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/Target/ARM/ARMCallingConv.td » ('j') | lib/Target/ARM/ARMCallingConv.td » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- ARMBaseRegisterInfo.cpp - ARM Register Information ----------------===// 1 //===-- ARMBaseRegisterInfo.cpp - ARM Register Information ----------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file contains the base ARM implementation of TargetRegisterInfo class. 10 // This file contains the base ARM implementation of TargetRegisterInfo class.
11 // 11 //
12 //===----------------------------------------------------------------------===// 12 //===----------------------------------------------------------------------===//
13 13
14 #include "ARMBaseRegisterInfo.h" 14 #include "ARMBaseRegisterInfo.h"
15 #include "ARM.h" 15 #include "ARM.h"
16 #include "ARMBaseInstrInfo.h" 16 #include "ARMBaseInstrInfo.h"
17 #include "ARMFrameLowering.h" 17 #include "ARMFrameLowering.h"
18 #include "ARMMachineFunctionInfo.h" 18 #include "ARMMachineFunctionInfo.h"
19 #include "ARMSubtarget.h" 19 #include "ARMSubtarget.h"
20 #include "MCTargetDesc/ARMAddressingModes.h" 20 #include "MCTargetDesc/ARMAddressingModes.h"
21 #include "llvm/ADT/BitVector.h" 21 #include "llvm/ADT/BitVector.h"
22 #include "llvm/ADT/SmallVector.h" 22 #include "llvm/ADT/SmallVector.h"
23 #include "llvm/CodeGen/MachineConstantPool.h" 23 #include "llvm/CodeGen/MachineConstantPool.h"
24 #include "llvm/CodeGen/MachineFrameInfo.h" 24 #include "llvm/CodeGen/MachineFrameInfo.h"
25 #include "llvm/CodeGen/MachineFunction.h" 25 #include "llvm/CodeGen/MachineFunction.h"
26 #include "llvm/CodeGen/MachineInstrBuilder.h" 26 #include "llvm/CodeGen/MachineInstrBuilder.h"
27 #include "llvm/CodeGen/MachineModuleInfo.h" // @LOCALMOD
27 #include "llvm/CodeGen/MachineRegisterInfo.h" 28 #include "llvm/CodeGen/MachineRegisterInfo.h"
28 #include "llvm/CodeGen/RegisterScavenging.h" 29 #include "llvm/CodeGen/RegisterScavenging.h"
29 #include "llvm/CodeGen/VirtRegMap.h" 30 #include "llvm/CodeGen/VirtRegMap.h"
30 #include "llvm/IR/Constants.h" 31 #include "llvm/IR/Constants.h"
31 #include "llvm/IR/DerivedTypes.h" 32 #include "llvm/IR/DerivedTypes.h"
32 #include "llvm/IR/Function.h" 33 #include "llvm/IR/Function.h"
33 #include "llvm/IR/LLVMContext.h" 34 #include "llvm/IR/LLVMContext.h"
34 #include "llvm/Support/Debug.h" 35 #include "llvm/Support/Debug.h"
35 #include "llvm/Support/ErrorHandling.h" 36 #include "llvm/Support/ErrorHandling.h"
36 #include "llvm/Support/raw_ostream.h" 37 #include "llvm/Support/raw_ostream.h"
(...skipping 19 matching lines...) Expand all
56 return ARM::R11; 57 return ARM::R11;
57 } else if (STI.isTargetWindows()) 58 } else if (STI.isTargetWindows())
58 return ARM::R11; 59 return ARM::R11;
59 else // ARM EABI 60 else // ARM EABI
60 return STI.isThumb() ? ARM::R7 : ARM::R11; 61 return STI.isThumb() ? ARM::R7 : ARM::R11;
61 } 62 }
62 63
63 const MCPhysReg* 64 const MCPhysReg*
64 ARMBaseRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const { 65 ARMBaseRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
65 const ARMSubtarget &STI = MF->getSubtarget<ARMSubtarget>(); 66 const ARMSubtarget &STI = MF->getSubtarget<ARMSubtarget>();
66 if (STI.isTargetNaCl()) return CSR_NaCl_SaveList; // @LOCALMOD 67 // @LOCALMOD-START
jvoung (off chromium) 2015/06/03 17:19:38 Leave a note that we aren't supporting the other C
Derek Schuff 2015/06/03 20:50:56 Done.
68 if (STI.isTargetNaCl()) {
69 if (MF->getMMI().callsEHReturn())
70 return CSR_NaCl_EHRet_SaveList;
71 return CSR_NaCl_SaveList;
72 }
73 // @LOCALMOD-END
67 74
68 const MCPhysReg *RegList = 75 const MCPhysReg *RegList =
69 STI.isTargetDarwin() ? CSR_iOS_SaveList : CSR_AAPCS_SaveList; 76 STI.isTargetDarwin() ? CSR_iOS_SaveList : CSR_AAPCS_SaveList;
70 77
71 const Function *F = MF->getFunction(); 78 const Function *F = MF->getFunction();
72 if (F->getCallingConv() == CallingConv::GHC) { 79 if (F->getCallingConv() == CallingConv::GHC) {
73 // GHC set of callee saved regs is empty as all those regs are 80 // GHC set of callee saved regs is empty as all those regs are
74 // used for passing STG regs around 81 // used for passing STG regs around
75 return CSR_NoRegs_SaveList; 82 return CSR_NoRegs_SaveList;
76 } else if (F->hasFnAttribute("interrupt")) { 83 } else if (F->hasFnAttribute("interrupt")) {
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 // In practice the SizeMultiplier will only factor in for straight line code 822 // In practice the SizeMultiplier will only factor in for straight line code
816 // that uses a lot of NEON vectors, which isn't terribly common. 823 // that uses a lot of NEON vectors, which isn't terribly common.
817 unsigned SizeMultiplier = MBB->size()/100; 824 unsigned SizeMultiplier = MBB->size()/100;
818 SizeMultiplier = SizeMultiplier ? SizeMultiplier : 1; 825 SizeMultiplier = SizeMultiplier ? SizeMultiplier : 1;
819 if (It->second < NewRCWeight.WeightLimit * SizeMultiplier) { 826 if (It->second < NewRCWeight.WeightLimit * SizeMultiplier) {
820 It->second += NewRCWeight.RegWeight; 827 It->second += NewRCWeight.RegWeight;
821 return true; 828 return true;
822 } 829 }
823 return false; 830 return false;
824 } 831 }
OLDNEW
« no previous file with comments | « no previous file | lib/Target/ARM/ARMCallingConv.td » ('j') | lib/Target/ARM/ARMCallingConv.td » ('J')

Powered by Google App Engine
This is Rietveld 408576698