<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Mar 12, 2015 at 6:27 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><span>On Thu, Mar 12, 2015 at 5:31 PM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote">On Thu, Mar 12, 2015 at 5:20 PM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote">On Thu, Mar 12, 2015 at 5:07 PM Akira Hatanaka <<a href="mailto:ahatanak@gmail.com" target="_blank">ahatanak@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 11, 2015 at 3:50 PM, Eric Christopher <span dir="ltr"><<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr">In case anyone is wondering what's going on here, the rough idea:<br><br>TargetRegisterInfo depends on MCRegisterInfo which is not, in fact, subtarget dependent. TargetRegisterInfo is, in general, just a bunch of layering APIs on top of MCRegisterInfo and nearly all of them already take a MachineFunction anyhow. Extend this slightly and just have TRI be an API layer that's subtarget independent and we can move it to the TargetMachine level. Prompting this is the desire to have the MC layer not be subtarget dependent as much as possible - and not during configuration if possible.<span><font color="#888888"><div><br></div></font></span></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If MCRegisterInfo is subtarget independent, meaning you'll always get the same MCRegisterInfo object regardless of what subtarget you have as long as the target is the same, why does moving TargetRegisterInfo </div></div></div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>It's not making the MC layer less subtarget dependent, it's how we access the MC layer. See things like LLVMTargetMachine.cpp for an illustration.</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>to TargetMachine make the MC layer less subtarget dependent?  Also, this will make it impossible for targets to have different subclasses of TargetRegisterInfo, which might make the design less clean.</div><div><br></div></div></div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>This is trivial to fix, you can see what I've been doing there.</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div>Perhaps I'm just not understanding your long term plan to fix the MC layer. Could you elaborate?<br></div></div></div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>It's not a fix for the MC layer it's a fix for the layer above it. Basically right now TRI has an is-a relationship with MCRegisterInfo - it should have a has-a relationship as should anything that determines overall module layout. The rest of asm info depends on MCRegisterInfo and so I'm moving this up because it's relatively simple to do and fixes the problem without having to change the TRI->MRI relationship.</div></div></div><div dir="ltr"><div class="gmail_quote"><div><br></div></div></div></blockquote><div><br></div></div></div><div dir="ltr"><div class="gmail_quote"><div>To be clear here I'm not saying that this is the only way forward. Other options involve having the TargetMachine own a particular set of MC level bits that involve module writing and separate that out from the various subtarget specific things that asm and mcinst printing need at the function level. (Yes, sadly these things are different because of various annoyances with instruction encoding and subtargets).</div><div><br></div><div>All of LLVMTargetMachine::addPassesToEmitFile are going to need to change ultimately.</div></div></div><div dir="ltr"><div class="gmail_quote"><div><br></div></div></div></blockquote><div><br></div></span><div>I'll look more into the separation I was talking about above (is-a -> has-a) and go a bit deeper into that before continuing with the change to move things. That said, I'm going to leave the TRI changes I've already got (minus the AArch64 if I decide to go otherwise) because they're pretty nice cleanups IMO. :)</div><span><font color="#888888"><div><br></div></font></span></div></div></blockquote><div><br></div><div>Changing TargetRegisterInfo to own MCRegisterInfo doesn't look too complicated, if you decide to go down that route.</div><div><br></div><div>Is this something that is needed to enable subtarget switching at the MC level or just a clean-up? I seems to me that you've already made most of the necessary changes in AsmPrinter and other places to use the subtarget owned by MachineFunction rather than the one owned by TargetMachine. What else is needed to enable function multi-versioning other than initializing MachineFunction's constructor with the per-function subtarget (by calling getSubtargetImpl(const Function&)) and changing clang to embed function attributes "target-cpu" and "target-features" in the IR?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span><font color="#888888"><div></div><div>-eric</div></font></span><div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><div>-eric</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div></div><div>-eric</div></div></div><div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><span><font color="#888888"><div></div><div>-eric</div></font></span></div><div><div><br><div class="gmail_quote">On Wed, Mar 11, 2015 at 3:46 PM Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank">echristo@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: echristo<br>
Date: Wed Mar 11 17:42:13 2015<br>
New Revision: 231979<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=231979&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject?rev=231979&view=rev</a><br>
Log:<br>
Have getCallPreservedMask and getThisCallPreservedMask take a<br>
MachineFunction argument so that we can grab subtarget specific<br>
features off of it.<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/<u></u>Target<u></u><u></u>/TargetRegisterInfo.h<br>
    llvm/trunk/lib/CodeGen/<u></u>Selecti<u></u><u></u>onDAG/FastISel.cpp<br>
    llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64FastISel.cpp<br>
    llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64ISelLowering.cpp<br>
    llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.cpp<br>
    llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.h<br>
    llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.cpp<br>
    llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.h<br>
    llvm/trunk/lib/Target/ARM/<u></u>ARMF<u></u><u></u>astISel.cpp<br>
    llvm/trunk/lib/Target/ARM/<u></u>ARMI<u></u><u></u>SelLowering.cpp<br>
    llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sFastISel.cpp<br>
    llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sISelLowering.cpp<br>
    llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.cpp<br>
    llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.h<br>
    llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCFastISel.cpp<br>
    llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCISelLowering.cpp<br>
    llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.cpp<br>
    llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.h<br>
    llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcISelLowering.cpp<br>
    llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.cpp<br>
    llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.h<br>
    llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZISelLowering.cpp<br>
    llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.cpp<br>
    llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.h<br>
    llvm/trunk/lib/Target/X86/<u></u>X86F<u></u><u></u>astISel.cpp<br>
    llvm/trunk/lib/Target/X86/<u></u>X86I<u></u><u></u>SelLowering.cpp<br>
    llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.cpp<br>
    llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.h<br>
<br>
Modified: llvm/trunk/include/llvm/<u></u>Target<u></u><u></u>/TargetRegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/include/<u></u>llvm/<u></u><u></u>Target/<u></u>TargetRegisterInfo.h?<u></u>re<u></u>v=<u></u>231979&r1=231978&r2=<u></u>231979&<u></u>v<u></u>iew=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/include/llvm/<u></u>Target<u></u><u></u>/TargetRegisterInfo.h (original)<br>
+++ llvm/trunk/include/llvm/<u></u>Target<u></u><u></u>/TargetRegisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -428,7 +428,7 @@ public:<br>
   getCalleeSavedRegs(const MachineFunction *MF) const = 0;<br>
<br>
   /// getCallPreservedMask - Return a mask of call-preserved registers for the<br>
-  /// given calling convention on the current sub-target.  The mask should<br>
+  /// given calling convention on the current function.  The mask should<br>
   /// include all call-preserved aliases.  This is used by the register<br>
   /// allocator to determine which registers can be live across a call.<br>
   ///<br>
@@ -445,7 +445,8 @@ public:<br>
   /// instructions should use implicit-def operands to indicate call clobbered<br>
   /// registers.<br>
   ///<br>
-  virtual const uint32_t *getCallPreservedMask(<u></u>CallingC<u></u><u></u>onv::ID) const {<br>
+  virtual const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                               CallingConv::ID) const {<br>
     // The default mask clobbers everything.  All targets should override.<br>
     return nullptr;<br>
   }<br>
<br>
Modified: llvm/trunk/lib/CodeGen/<u></u>Selecti<u></u><u></u>onDAG/FastISel.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/<u></u>CodeGen/<u></u>S<u></u>electionDAG/FastISel.<u></u>cpp?rev=<u></u>2<u></u>31979&r1=231978&r2=<u></u>231979&<u></u>view<u></u>=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/CodeGen/<u></u>Selecti<u></u><u></u>onDAG/FastISel.cpp (original)<br>
+++ llvm/trunk/lib/CodeGen/<u></u>Selecti<u></u><u></u>onDAG/FastISel.cpp Wed Mar 11 17:42:13 2015<br>
@@ -801,7 +801,8 @@ bool FastISel::selectPatchpoint(<u></u>con<u></u><u></u>st Ca<br>
     return false;<br>
<br>
   // Push the register mask info.<br>
-  Ops.push_back(MachineOperand::<u></u><u></u><u></u>CreateRegMask(TRI.<u></u>getCallPrese<u></u><u></u>rvedMask(CC)));<br>
+  Ops.push_back(MachineOperand::<u></u><u></u><u></u>CreateRegMask(<br>
+      TRI.getCallPreservedMask(*<u></u>Func<u></u><u></u>Info.MF, CC)));<br>
<br>
   // Add scratch registers as implicit def and early clobber.<br>
   const MCPhysReg *ScratchRegs = TLI.getScratchRegisters(CC);<br>
<br>
Modified: llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64FastISel.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FastISel.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AA<u></u><u></u>rch64/AArch64FastISel.cpp?<u></u>rev=<u></u><u></u>231979&r1=231978&r2=<u></u>231979&<u></u>vie<u></u>w=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64FastISel.cpp (original)<br>
+++ llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64FastISel.cpp Wed Mar 11 17:42:13 2015<br>
@@ -3158,7 +3158,7 @@ bool AArch64FastISel::<u></u>fastLowerCall<u></u><u></u>(Call<br>
<br>
   // Add a register mask with the call-preserved registers.<br>
   // Proper defs for return values will be added by setPhysRegsDeadExcept().<br>
-  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(CC));<br>
+  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(*<u></u>FuncInfo.MF, CC));<br>
<br>
   CLI.Call = MIB;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64ISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64ISelLowering.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AA<u></u><u></u>rch64/AArch64ISelLowering.<u></u>cpp?<u></u><u></u>rev=231979&r1=231978&r2=<u></u>231979<u></u><u></u>&view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64ISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64ISelLowering.cpp Wed Mar 11 17:42:13 2015<br>
@@ -2794,13 +2794,13 @@ AArch64TargetLowering::<u></u>LowerCa<u></u><u></u>ll(CallLow<br>
   const AArch64RegisterInfo *TRI = Subtarget->getRegisterInfo();<br>
   if (IsThisReturn) {<br>
     // For 'this' returns, use the X0-preserving mask if applicable<br>
-    Mask = TRI-><u></u>getThisReturnPreservedMas<u></u><u></u>k(<u></u>CallConv);<br>
+    Mask = TRI-><u></u>getThisReturnPreservedMas<u></u><u></u>k(MF, CallConv);<br>
     if (!Mask) {<br>
       IsThisReturn = false;<br>
-      Mask = TRI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv);<br>
+      Mask = TRI->getCallPreservedMask(MF, CallConv);<br>
     }<br>
   } else<br>
-    Mask = TRI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv);<br>
+    Mask = TRI->getCallPreservedMask(MF, CallConv);<br>
<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
Modified: llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AA<u></u><u></u>rch64/AArch64RegisterInfo.<u></u>cpp?<u></u><u></u>rev=231979&r1=231978&r2=<u></u>231979<u></u><u></u>&view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.cpp Wed Mar 11 17:42:13 2015<br>
@@ -55,7 +55,8 @@ AArch64RegisterInfo::<u></u>getCallee<u></u><u></u>SavedRegs(<br>
 }<br>
<br>
 const uint32_t *<br>
-AArch64RegisterInfo::<u></u>getCallP<u></u><u></u>reservedMask(<u></u>CallingConv::ID CC) const {<br>
+AArch64RegisterInfo::<u></u>getCallP<u></u><u></u>reservedMask(const MachineFunction &MF,<br>
+                                          CallingConv::ID CC) const {<br>
   if (CC == CallingConv::GHC)<br>
     // This is academic becase all GHC calls are (supposed to be) tail calls<br>
     return CSR_AArch64_NoRegs_RegMask;<br>
@@ -74,7 +75,8 @@ const uint32_t *AArch64RegisterInfo::get<br>
 }<br>
<br>
 const uint32_t *<br>
-AArch64RegisterInfo::<u></u>getThisR<u></u><u></u>eturnPreservedMask(<u></u>CallingConv<u></u><u></u>::ID CC) const {<br>
+AArch64RegisterInfo::<u></u>getThisR<u></u><u></u>eturnPreservedMask(<u></u>const MachineFunction &MF,<br>
+                                                CallingConv::ID CC) const {<br>
   // This should return a register mask that is the same as that returned by<br>
   // getCallPreservedMask but that additionally preserves the register used for<br>
   // the first i64 argument (which must also be the register used to return a<br>
<br>
Modified: llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AA<u></u><u></u>rch64/AArch64RegisterInfo.h?<u></u>re<u></u><u></u>v=231979&r1=231978&r2=<u></u>231979&<u></u>v<u></u>iew=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.h (original)<br>
+++ llvm/trunk/lib/Target/AArch64/<u></u><u></u><u></u>AArch64RegisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -37,7 +37,8 @@ public:<br>
<br>
   /// Code Generation virtual methods...<br>
   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;<br>
-  const uint32_t *getCallPreservedMask(<u></u>CallingC<u></u><u></u>onv::ID) const override;<br>
+  const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID) const override;<br>
<br>
   unsigned getCSRFirstUseCost() const override {<br>
     // The cost will be compared against BlockFrequency where entry has the<br>
@@ -58,7 +59,8 @@ public:<br>
   ///<br>
   /// Should return NULL in the case that the calling convention does not have<br>
   /// this property<br>
-  const uint32_t *getThisReturnPreservedMask(<u></u>Ca<u></u><u></u>llingConv::ID) const;<br>
+  const uint32_t *getThisReturnPreservedMask(<u></u>co<u></u><u></u>nst MachineFunction &MF,<br>
+                                             CallingConv::ID) const;<br>
<br>
   BitVector getReservedRegs(const MachineFunction &MF) const override;<br>
   const TargetRegisterClass *<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AR<u></u><u></u>M/ARMBaseRegisterInfo.cpp?<u></u>rev=<u></u><u></u>231979&r1=231978&r2=<u></u>231979&<u></u>vie<u></u>w=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.cpp Wed Mar 11 17:42:13 2015<br>
@@ -87,8 +87,9 @@ ARMBaseRegisterInfo::<u></u>getCallee<u></u><u></u>SavedRegs(<br>
   return RegList;<br>
 }<br>
<br>
-const uint32_t*<br>
-ARMBaseRegisterInfo::<u></u>getCallP<u></u><u></u>reservedMask(<u></u>CallingConv::ID CC) const {<br>
+const uint32_t *<br>
+ARMBaseRegisterInfo::<u></u>getCallP<u></u><u></u>reservedMask(const MachineFunction &MF,<br>
+                                          CallingConv::ID CC) const {<br>
   if (CC == CallingConv::GHC)<br>
     // This is academic becase all GHC calls are (supposed to be) tail calls<br>
     return CSR_NoRegs_RegMask;<br>
@@ -100,8 +101,9 @@ ARMBaseRegisterInfo::<u></u>getNoPres<u></u><u></u>ervedMask(<br>
   return CSR_NoRegs_RegMask;<br>
 }<br>
<br>
-const uint32_t*<br>
-ARMBaseRegisterInfo::<u></u>getThisR<u></u><u></u>eturnPreservedMask(<u></u>CallingConv<u></u><u></u>::ID CC) const {<br>
+const uint32_t *<br>
+ARMBaseRegisterInfo::<u></u>getThisR<u></u><u></u>eturnPreservedMask(<u></u>const MachineFunction &MF,<br>
+                                                CallingConv::ID CC) const {<br>
   // This should return a register mask that is the same as that returned by<br>
   // getCallPreservedMask but that additionally preserves the register used for<br>
   // the first i32 argument (which must also be the register used to return a<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AR<u></u><u></u>M/ARMBaseRegisterInfo.h?rev=<u></u>23<u></u><u></u>1979&r1=231978&r2=231979&<u></u>view=<u></u><u></u>diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.h (original)<br>
+++ llvm/trunk/lib/Target/ARM/<u></u>ARMB<u></u><u></u>aseRegisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -101,7 +101,8 @@ protected:<br>
 public:<br>
   /// Code Generation virtual methods...<br>
   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;<br>
-  const uint32_t *getCallPreservedMask(<u></u>CallingC<u></u><u></u>onv::ID) const override;<br>
+  const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID) const override;<br>
   const uint32_t *getNoPreservedMask() const;<br>
<br>
   /// getThisReturnPreservedMask - Returns a call preserved mask specific to the<br>
@@ -112,7 +113,8 @@ public:<br>
   ///<br>
   /// Should return NULL in the case that the calling convention does not have<br>
   /// this property<br>
-  const uint32_t *getThisReturnPreservedMask(<u></u>Ca<u></u><u></u>llingConv::ID) const;<br>
+  const uint32_t *getThisReturnPreservedMask(<u></u>co<u></u><u></u>nst MachineFunction &MF,<br>
+                                             CallingConv::ID) const;<br>
<br>
   BitVector getReservedRegs(const MachineFunction &MF) const override;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/<u></u>ARMF<u></u><u></u>astISel.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFastISel.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AR<u></u><u></u>M/ARMFastISel.cpp?rev=<u></u>231979&<u></u>r<u></u>1=231978&r2=231979&<u></u>view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/ARM/<u></u>ARMF<u></u><u></u>astISel.cpp (original)<br>
+++ llvm/trunk/lib/Target/ARM/<u></u>ARMF<u></u><u></u>astISel.cpp Wed Mar 11 17:42:13 2015<br>
@@ -2265,7 +2265,7 @@ bool ARMFastISel::ARMEmitLibcall(<u></u>co<u></u><u></u>nst I<br>
<br>
   // Add a register mask with the call-preserved registers.<br>
   // Proper defs for return values will be added by setPhysRegsDeadExcept().<br>
-  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(CC));<br>
+  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(*<u></u>FuncInfo.MF, CC));<br>
<br>
   // Finish off the call including any return values.<br>
   SmallVector<unsigned, 4> UsedRegs;<br>
@@ -2416,7 +2416,7 @@ bool ARMFastISel::SelectCall(const Instr<br>
<br>
   // Add a register mask with the call-preserved registers.<br>
   // Proper defs for return values will be added by setPhysRegsDeadExcept().<br>
-  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(CC));<br>
+  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(*<u></u>FuncInfo.MF, CC));<br>
<br>
   // Finish off the call including any return values.<br>
   SmallVector<unsigned, 4> UsedRegs;<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/<u></u>ARMI<u></u><u></u>SelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>AR<u></u><u></u>M/ARMISelLowering.cpp?rev=<u></u>2319<u></u><u></u>79&r1=231978&r2=231979&<u></u>view=<u></u>di<u></u>ff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/ARM/<u></u>ARMI<u></u><u></u>SelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/ARM/<u></u>ARMI<u></u><u></u>SelLowering.cpp Wed Mar 11 17:42:13 2015<br>
@@ -1814,16 +1814,16 @@ ARMTargetLowering::LowerCall(<u></u>T<u></u><u></u>argetLower<br>
     const ARMBaseRegisterInfo *ARI = Subtarget->getRegisterInfo();<br>
     if (isThisReturn) {<br>
       // For 'this' returns, use the R0-preserving mask if applicable<br>
-      Mask = ARI-><u></u>getThisReturnPreservedMas<u></u><u></u>k(<u></u>CallConv);<br>
+      Mask = ARI-><u></u>getThisReturnPreservedMas<u></u><u></u>k(MF, CallConv);<br>
       if (!Mask) {<br>
         // Set isThisReturn to false if the calling convention is not one that<br>
         // allows 'returned' to be modeled in this way, so LowerCallResult does<br>
         // not try to pass 'this' straight through<br>
         isThisReturn = false;<br>
-        Mask = ARI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv);<br>
+        Mask = ARI->getCallPreservedMask(MF, CallConv);<br>
       }<br>
     } else<br>
-      Mask = ARI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv);<br>
+      Mask = ARI->getCallPreservedMask(MF, CallConv);<br>
<br>
     assert(Mask && "Missing call preserved mask for calling convention");<br>
     Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sFastISel.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsFastISel.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Mi<u></u><u></u>ps/MipsFastISel.cpp?rev=<u></u>231979<u></u><u></u>&r1=231978&r2=231979&<u></u>view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sFastISel.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sFastISel.cpp Wed Mar 11 17:42:13 2015<br>
@@ -1167,7 +1167,7 @@ bool MipsFastISel::fastLowerCall(<u></u>Ca<u></u><u></u>llLow<br>
<br>
   // Add a register mask with the call-preserved registers.<br>
   // Proper defs for return values will be added by setPhysRegsDeadExcept().<br>
-  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(CC));<br>
+  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(*<u></u>FuncInfo.MF, CC));<br>
<br>
   CLI.Call = MIB;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Mi<u></u><u></u>ps/MipsISelLowering.cpp?rev=<u></u>23<u></u><u></u>1979&r1=231978&r2=231979&<u></u>view=<u></u><u></u>diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sISelLowering.cpp Wed Mar 11 17:42:13 2015<br>
@@ -2481,7 +2481,8 @@ getOpndList(SmallVectorImpl<<u></u>SD<u></u><u></u>Value> &Op<br>
<br>
   // Add a register mask operand representing the call-preserved registers.<br>
   const TargetRegisterInfo *TRI = Subtarget.getRegisterInfo();<br>
-  const uint32_t *Mask = TRI->getCallPreservedMask(CLI.<u></u><u></u><u></u>CallConv);<br>
+  const uint32_t *Mask =<br>
+      TRI->getCallPreservedMask(CLI.<u></u><u></u><u></u>DAG.getMachineFunction(), CLI.CallConv);<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   if (Subtarget.inMips16HardFloat()<u></u><u></u><u></u>) {<br>
     if (GlobalAddressSDNode *G = dyn_cast<GlobalAddressSDNode>(<u></u><u></u><u></u>CLI.Callee)) {<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Mi<u></u><u></u>ps/MipsRegisterInfo.cpp?rev=<u></u>23<u></u><u></u>1979&r1=231978&r2=231979&<u></u>view=<u></u><u></u>diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.cpp Wed Mar 11 17:42:13 2015<br>
@@ -100,8 +100,9 @@ MipsRegisterInfo::<u></u>getCalleeSav<u></u><u></u>edRegs(con<br>
   return CSR_O32_SaveList;<br>
 }<br>
<br>
-const uint32_t*<br>
-MipsRegisterInfo::<u></u>getCallPres<u></u><u></u>ervedMask(<u></u>CallingConv::ID) const {<br>
+const uint32_t *<br>
+MipsRegisterInfo::<u></u>getCallPres<u></u><u></u>ervedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID) const {<br>
   if (Subtarget.isSingleFloat())<br>
     return CSR_SingleFloatOnly_RegMask;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsRegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Mi<u></u><u></u>ps/MipsRegisterInfo.h?rev=<u></u>2319<u></u><u></u>79&r1=231978&r2=231979&<u></u>view=<u></u>di<u></u>ff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.h (original)<br>
+++ llvm/trunk/lib/Target/Mips/<u></u>Mip<u></u><u></u>sRegisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -48,7 +48,8 @@ public:<br>
   unsigned getRegPressureLimit(const TargetRegisterClass *RC,<br>
                                MachineFunction &MF) const override;<br>
   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;<br>
-  const uint32_t *getCallPreservedMask(<u></u>CallingC<u></u><u></u>onv::ID) const override;<br>
+  const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID) const override;<br>
   static const uint32_t *getMips16RetHelperMask();<br>
<br>
   BitVector getReservedRegs(const MachineFunction &MF) const override;<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCFastISel.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCFastISel.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Po<u></u><u></u>werPC/PPCFastISel.cpp?rev=<u></u>2319<u></u><u></u>79&r1=231978&r2=231979&<u></u>view=<u></u>di<u></u>ff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCFastISel.cpp (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCFastISel.cpp Wed Mar 11 17:42:13 2015<br>
@@ -1532,7 +1532,7 @@ bool PPCFastISel::fastLowerCall(<u></u>Cal<u></u><u></u>lLowe<br>
<br>
   // Add a register mask with the call-preserved registers.  Proper<br>
   // defs for return values will be added by setPhysRegsDeadExcept().<br>
-  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(CC));<br>
+  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(*<u></u>FuncInfo.MF, CC));<br>
<br>
   CLI.Call = MIB;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Po<u></u><u></u>werPC/PPCISelLowering.cpp?<u></u>rev=<u></u><u></u>231979&r1=231978&r2=<u></u>231979&<u></u>vie<u></u>w=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCISelLowering.cpp Wed Mar 11 17:42:13 2015<br>
@@ -4187,7 +4187,8 @@ PPCTargetLowering::FinishCall(<u></u><u></u><u></u>CallingCon<br>
<br>
   // Add a register mask operand representing the call-preserved registers.<br>
   const TargetRegisterInfo *TRI = Subtarget.getRegisterInfo();<br>
-  const uint32_t *Mask = TRI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv);<br>
+  const uint32_t *Mask =<br>
+      TRI->getCallPreservedMask(DAG.<u></u><u></u><u></u>getMachineFunction(), CallConv);<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Po<u></u><u></u>werPC/PPCRegisterInfo.cpp?<u></u>rev=<u></u><u></u>231979&r1=231978&r2=<u></u>231979&<u></u>vie<u></u>w=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.cpp Wed Mar 11 17:42:13 2015<br>
@@ -128,8 +128,9 @@ PPCRegisterInfo::<u></u>getCalleeSave<u></u><u></u>dRegs(cons<br>
                                 CSR_SVR432_SaveList);<br>
 }<br>
<br>
-const uint32_t*<br>
-PPCRegisterInfo::<u></u>getCallPrese<u></u><u></u>rvedMask(<u></u>CallingConv::ID CC) const {<br>
+const uint32_t *<br>
+PPCRegisterInfo::<u></u>getCallPrese<u></u><u></u>rvedMask(const MachineFunction &MF,<br>
+                                      CallingConv::ID CC) const {<br>
   if (CC == CallingConv::AnyReg) {<br>
     if (Subtarget.hasVSX())<br>
       return CSR_64_AllRegs_VSX_RegMask;<br>
<br>
Modified: llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCRegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Po<u></u><u></u>werPC/PPCRegisterInfo.h?rev=<u></u>23<u></u><u></u>1979&r1=231978&r2=231979&<u></u>view=<u></u><u></u>diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.h (original)<br>
+++ llvm/trunk/lib/Target/PowerPC/<u></u><u></u><u></u>PPCRegisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -46,7 +46,8 @@ public:<br>
<br>
   /// Code Generation virtual methods...<br>
   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;<br>
-  const uint32_t *getCallPreservedMask(<u></u>CallingC<u></u><u></u>onv::ID CC) const override;<br>
+  const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID CC) const override;<br>
   const uint32_t *getNoPreservedMask() const;<br>
<br>
   void adjustStackMapLiveOutMask(<u></u>uint<u></u><u></u>32_t *Mask) const override;<br>
<br>
Modified: llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Sp<u></u><u></u>arc/SparcISelLowering.cpp?<u></u>rev=<u></u><u></u>231979&r1=231978&r2=<u></u>231979&<u></u>vie<u></u>w=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcISelLowering.cpp Wed Mar 11 17:42:13 2015<br>
@@ -915,9 +915,10 @@ SparcTargetLowering::<u></u>LowerCall<u></u><u></u>_32(Target<br>
<br>
   // Add a register mask operand representing the call-preserved registers.<br>
   const SparcRegisterInfo *TRI = Subtarget->getRegisterInfo();<br>
-  const uint32_t *Mask = ((hasReturnsTwice)<br>
-                          ? TRI->getRTCallPreservedMask(<u></u>Ca<u></u><u></u>llConv)<br>
-                          : TRI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv));<br>
+  const uint32_t *Mask =<br>
+      ((hasReturnsTwice)<br>
+           ? TRI->getRTCallPreservedMask(<u></u>Ca<u></u><u></u>llConv)<br>
+           : TRI->getCallPreservedMask(DAG.<u></u><u></u><u></u>getMachineFunction(), CallConv));<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
@@ -1229,7 +1230,8 @@ SparcTargetLowering::<u></u>LowerCall<u></u><u></u>_64(Target<br>
   const SparcRegisterInfo *TRI = Subtarget->getRegisterInfo();<br>
   const uint32_t *Mask =<br>
       ((hasReturnsTwice) ? TRI->getRTCallPreservedMask(<u></u>CL<u></u><u></u>I.CallConv)<br>
-                         : TRI->getCallPreservedMask(CLI.<u></u><u></u><u></u>CallConv));<br>
+                         : TRI->getCallPreservedMask(DAG.<u></u><u></u><u></u>getMachineFunction(),<br>
+                                                     CLI.CallConv));<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
@@ -1904,8 +1906,8 @@ SDValue SparcTargetLowering::<u></u>LowerGlob<u></u><u></u>al<br>
     Ops.push_back(Callee);<br>
     Ops.push_back(Symbol);<br>
     Ops.push_back(DAG.<u></u>getRegister<u></u>(<u></u>SP::O0, PtrVT));<br>
-    const uint32_t *Mask =<br>
-        Subtarget->getRegisterInfo()-><u></u><u></u><u></u>getCallPreservedMask(<u></u>CallingCo<u></u><u></u>nv::C);<br>
+    const uint32_t *Mask = Subtarget->getRegisterInfo()-><u></u><u></u><u></u>getCallPreservedMask(<br>
+        DAG.getMachineFunction(), CallingConv::C);<br>
     assert(Mask && "Missing call preserved mask for calling convention");<br>
     Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
     Ops.push_back(InFlag);<br>
<br>
Modified: llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Sp<u></u><u></u>arc/SparcRegisterInfo.cpp?<u></u>rev=<u></u><u></u>231979&r1=231978&r2=<u></u>231979&<u></u>vie<u></u>w=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.cpp Wed Mar 11 17:42:13 2015<br>
@@ -43,8 +43,9 @@ SparcRegisterInfo::<u></u>getCalleeSa<u></u><u></u>vedRegs(co<br>
   return CSR_SaveList;<br>
 }<br>
<br>
-const uint32_t*<br>
-SparcRegisterInfo::<u></u>getCallPre<u></u><u></u>servedMask(<u></u>CallingConv::ID CC) const {<br>
+const uint32_t *<br>
+SparcRegisterInfo::<u></u>getCallPre<u></u><u></u>servedMask(const MachineFunction &MF,<br>
+                                        CallingConv::ID CC) const {<br>
   return CSR_RegMask;<br>
 }<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcRegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Sp<u></u><u></u>arc/SparcRegisterInfo.h?rev=<u></u>23<u></u><u></u>1979&r1=231978&r2=231979&<u></u>view=<u></u><u></u>diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.h (original)<br>
+++ llvm/trunk/lib/Target/Sparc/<u></u>Sp<u></u><u></u>arcRegisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -32,7 +32,8 @@ struct SparcRegisterInfo : public SparcG<br>
<br>
   /// Code Generation virtual methods...<br>
   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;<br>
-  const uint32_t* getCallPreservedMask(<u></u>CallingCo<u></u><u></u>nv::ID CC) const override;<br>
+  const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID CC) const override;<br>
<br>
   const uint32_t* getRTCallPreservedMask(<u></u>Calling<u></u><u></u>Conv::ID CC) const;<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZISelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZISelLowering.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Sy<u></u><u></u>stemZ/SystemZISelLowering.<u></u>cpp?<u></u><u></u>rev=231979&r1=231978&r2=<u></u>231979<u></u><u></u>&view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZISelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZISelLowering.cpp Wed Mar 11 17:42:13 2015<br>
@@ -920,7 +920,7 @@ SystemZTargetLowering::<u></u>LowerCa<u></u><u></u>ll(CallLow<br>
<br>
   // Add a register mask operand representing the call-preserved registers.<br>
   const TargetRegisterInfo *TRI = Subtarget.getRegisterInfo();<br>
-  const uint32_t *Mask = TRI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv);<br>
+  const uint32_t *Mask = TRI->getCallPreservedMask(MF, CallConv);<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
@@ -1858,7 +1858,8 @@ SDValue SystemZTargetLowering::<u></u>lowerTL<u></u><u></u>SG<br>
<br>
   // Add a register mask operand representing the call-preserved registers.<br>
   const TargetRegisterInfo *TRI = Subtarget.getRegisterInfo();<br>
-  const uint32_t *Mask = TRI->getCallPreservedMask(<u></u>Call<u></u><u></u>ingConv::C);<br>
+  const uint32_t *Mask =<br>
+      TRI->getCallPreservedMask(DAG.<u></u><u></u><u></u>getMachineFunction(), CallingConv::C);<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Sy<u></u><u></u>stemZ/SystemZRegisterInfo.<u></u>cpp?<u></u><u></u>rev=231979&r1=231978&r2=<u></u>231979<u></u><u></u>&view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.cpp Wed Mar 11 17:42:13 2015<br>
@@ -28,7 +28,8 @@ SystemZRegisterInfo::<u></u>getCallee<u></u><u></u>SavedRegs(<br>
 }<br>
<br>
 const uint32_t *<br>
-SystemZRegisterInfo::<u></u>getCallP<u></u><u></u>reservedMask(<u></u>CallingConv::ID CC) const {<br>
+SystemZRegisterInfo::<u></u>getCallP<u></u><u></u>reservedMask(const MachineFunction &MF,<br>
+                                          CallingConv::ID CC) const {<br>
   return CSR_SystemZ_RegMask;<br>
 }<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>Sy<u></u><u></u>stemZ/SystemZRegisterInfo.h?<u></u>re<u></u><u></u>v=231979&r1=231978&r2=<u></u>231979&<u></u>v<u></u>iew=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.h (original)<br>
+++ llvm/trunk/lib/Target/SystemZ/<u></u><u></u><u></u>SystemZRegisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -44,7 +44,8 @@ public:<br>
     return true;<br>
   }<br>
   const MCPhysReg *getCalleeSavedRegs(const MachineFunction *MF) const override;<br>
-  const uint32_t *getCallPreservedMask(<u></u>CallingC<u></u><u></u>onv::ID CC) const override;<br>
+  const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID CC) const override;<br>
   BitVector getReservedRegs(const MachineFunction &MF) const override;<br>
   void eliminateFrameIndex(<u></u>MachineBas<u></u><u></u>icBlock::iterator MI,<br>
                            int SPAdj, unsigned FIOperandNum,<br>
<br>
Modified: llvm/trunk/lib/Target/X86/<u></u>X86F<u></u><u></u>astISel.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FastISel.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>X8<u></u><u></u>6/X86FastISel.cpp?rev=<u></u>231979&<u></u>r<u></u>1=231978&r2=231979&<u></u>view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/X86/<u></u>X86F<u></u><u></u>astISel.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/<u></u>X86F<u></u><u></u>astISel.cpp Wed Mar 11 17:42:13 2015<br>
@@ -3062,7 +3062,7 @@ bool X86FastISel::fastLowerCall(<u></u>Cal<u></u><u></u>lLowe<br>
<br>
   // Add a register mask operand representing the call-preserved registers.<br>
   // Proper defs for return values will be added by setPhysRegsDeadExcept().<br>
-  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(CC));<br>
+  MIB.addRegMask(TRI.<u></u>getCallPres<u></u><u></u>ervedMask(*<u></u>FuncInfo.MF, CC));<br>
<br>
   // Add an implicit use GOT pointer in EBX.<br>
   if (Subtarget->isPICStyleGOT())<br>
<br>
Modified: llvm/trunk/lib/Target/X86/<u></u>X86I<u></u><u></u>SelLowering.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>X8<u></u><u></u>6/X86ISelLowering.cpp?rev=<u></u>2319<u></u><u></u>79&r1=231978&r2=231979&<u></u>view=<u></u>di<u></u>ff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/X86/<u></u>X86I<u></u><u></u>SelLowering.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/<u></u>X86I<u></u><u></u>SelLowering.cpp Wed Mar 11 17:42:13 2015<br>
@@ -3161,7 +3161,7 @@ X86TargetLowering::LowerCall(<u></u>T<u></u><u></u>argetLower<br>
<br>
   // Add a register mask operand representing the call-preserved registers.<br>
   const TargetRegisterInfo *TRI = Subtarget->getRegisterInfo();<br>
-  const uint32_t *Mask = TRI->getCallPreservedMask(<u></u>Call<u></u><u></u>Conv);<br>
+  const uint32_t *Mask = TRI->getCallPreservedMask(MF, CallConv);<br>
   assert(Mask && "Missing call preserved mask for calling convention");<br>
   Ops.push_back(DAG.<u></u>getRegister<u></u><u></u>Mask(Mask));<br>
<br>
@@ -18453,7 +18453,7 @@ X86TargetLowering::<u></u>EmitLowered<u></u><u></u>SegAlloca(<br>
<br>
   // Calls into a routine in libgcc to allocate more space from the heap.<br>
   const uint32_t *RegMask =<br>
-      Subtarget->getRegisterInfo()-><u></u><u></u><u></u>getCallPreservedMask(<u></u>CallingCo<u></u><u></u>nv::C);<br>
+      Subtarget->getRegisterInfo()-><u></u><u></u><u></u>getCallPreservedMask(*MF, CallingConv::C);<br>
   if (IsLP64) {<br>
     BuildMI(mallocMBB, DL, TII->get(X86::MOV64rr), X86::RDI)<br>
       .addReg(sizeVReg);<br>
@@ -18538,7 +18538,7 @@ X86TargetLowering::<u></u>EmitLowered<u></u><u></u>TLSCall(Ma<br>
   // FIXME: The 32-bit calls have non-standard calling conventions. Use a<br>
   // proper register mask.<br>
   const uint32_t *RegMask =<br>
-      Subtarget->getRegisterInfo()-><u></u><u></u><u></u>getCallPreservedMask(<u></u>CallingCo<u></u><u></u>nv::C);<br>
+      Subtarget->getRegisterInfo()-><u></u><u></u><u></u>getCallPreservedMask(*F, CallingConv::C);<br>
   if (Subtarget->is64Bit()) {<br>
     MachineInstrBuilder MIB = BuildMI(*BB, MI, DL,<br>
                                       TII->get(X86::MOV64rm), X86::RDI)<br>
<br>
Modified: llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.cpp?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>X8<u></u><u></u>6/X86RegisterInfo.cpp?rev=<u></u>2319<u></u><u></u>79&r1=231978&r2=231979&<u></u>view=<u></u>di<u></u>ff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.cpp (original)<br>
+++ llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.cpp Wed Mar 11 17:42:13 2015<br>
@@ -277,8 +277,9 @@ X86RegisterInfo::<u></u>getCalleeSave<u></u><u></u>dRegs(cons<br>
   return CSR_32_SaveList;<br>
 }<br>
<br>
-const uint32_t*<br>
-X86RegisterInfo::<u></u>getCallPrese<u></u><u></u>rvedMask(<u></u>CallingConv::ID CC) const {<br>
+const uint32_t *<br>
+X86RegisterInfo::<u></u>getCallPrese<u></u><u></u>rvedMask(const MachineFunction &MF,<br>
+                                      CallingConv::ID CC) const {<br>
   bool HasAVX = Subtarget.hasAVX();<br>
   bool HasAVX512 = Subtarget.hasAVX512();<br>
<br>
@@ -360,7 +361,7 @@ BitVector X86RegisterInfo::getReservedRe<br>
   // Set the base-pointer register and its aliases as reserved if needed.<br>
   if (hasBasePointer(MF)) {<br>
     CallingConv::ID CC = MF.getFunction()-><u></u>getCallingCo<u></u><u></u>nv();<br>
-    const uint32_t* RegMask = getCallPreservedMask(CC);<br>
+    const uint32_t *RegMask = getCallPreservedMask(MF, CC);<br>
     if (MachineOperand::<u></u>clobbersPhysR<u></u><u></u>eg(RegMask, getBaseRegister()))<br>
       report_fatal_error(<br>
         "Stack realignment in presence of dynamic allocas is not supported with"<br>
<br>
Modified: llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86RegisterInfo.h?rev=231979&r1=231978&r2=231979&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>pr<u></u><u></u>oject/llvm/trunk/lib/Target/<u></u>X8<u></u><u></u>6/X86RegisterInfo.h?rev=<u></u>231979<u></u><u></u>&r1=231978&r2=231979&<u></u>view=diff</a><br>
==============================<u></u><u></u><u></u>==============================<u></u><u></u><u></u>==================<br>
--- llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.h (original)<br>
+++ llvm/trunk/lib/Target/X86/<u></u>X86R<u></u><u></u>egisterInfo.h Wed Mar 11 17:42:13 2015<br>
@@ -99,7 +99,8 @@ public:<br>
   /// callee-save registers on this target.<br>
   const MCPhysReg *<br>
   getCalleeSavedRegs(const MachineFunction* MF) const override;<br>
-  const uint32_t *getCallPreservedMask(<u></u>CallingC<u></u><u></u>onv::ID) const override;<br>
+  const uint32_t *getCallPreservedMask(const MachineFunction &MF,<br>
+                                       CallingConv::ID) const override;<br>
   const uint32_t *getNoPreservedMask() const;<br>
<br>
   /// getReservedRegs - Returns a bitset indexed by physical register number<br>
<br>
<br>
______________________________<u></u><u></u><u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailm<u></u><u></u>an/listinfo/llvm-commits</a><br>
</blockquote></div>
</div></div><br>______________________________<u></u><u></u>_________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailm<u></u>an/listinfo/llvm-commits</a><br>
<br></blockquote></div></div></div></blockquote></div></div></blockquote></div></div></blockquote></div></div></div></div>
</blockquote></div><br></div></div>