[PATCH] D14878: findDeadCallerSavedReg needs to pay attention to calling convention

Andy Ayers via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 22 14:58:12 PST 2015


AndyAyers added inline comments.

================
Comment at: lib/Target/X86/X86FrameLowering.cpp:160-163
@@ -159,6 +157,1 @@
-
-  static const uint16_t CallerSavedRegs64Bit[] = {
-    X86::RAX, X86::RDX, X86::RCX, X86::RSI, X86::RDI,
-    X86::R8,  X86::R9,  X86::R10, X86::R11, 0
-  };
 
----------------
majnemer wrote:
> majnemer wrote:
> > `getPointerRegClass` will return `GR64_TC` which differs from `CallerSavedRegs64Bit` in that it doesn't include `R10` but does include `RIP`.  I reckon that `GR64_TC` is wrong and should match `CallerSavedRegs64Bit`, what do you think?
> Ah, `RIP` was added to silence the following machine verifier check:
> https://github.com/llvm-mirror/llvm/blob/5ca8076fccc1aa4860ab0d2fd741b60dd1ba269b/lib/CodeGen/MachineVerifier.cpp#L925
> 
> The following test case run with `llc -verify-coalescing` will cause us to trigger that verifier check...
>   target triple = "x86_64-pc-win32"
> 
>   @fnptr = external global void ()*
> 
>   define void @test() {
>   entry:
>     %p = load void ()*, void ()** @fnptr
>     tail call void %p()
>     ret void
>   }
> 
> I'll go fix this for Win64...
I'll add R10 to the windows set, and exclude RIP.

It seems odd that R10 is not in the SysV set -- it looks like it is caller saved on both.


Repository:
  rL LLVM

http://reviews.llvm.org/D14878





More information about the llvm-commits mailing list