[PATCH] D10977: Allow {e, r}bp as the target of {read, write}_register.

Pat Gavlin pagavlin at microsoft.com
Mon Jul 6 17:16:43 PDT 2015


In http://reviews.llvm.org/D10977#200036, @rnk wrote:

> Is it really that important to prevent people from hurting themselves by accessing ebp/rbp in a function without a frame pointer? I'd rather let them get hurt than suffer the extra code in LLVM.


I went back and forth on that a bit. The documentation seems a bit at odds with the current implementation:

> The compiler doesn’t check for register availability or use of the used register in surrounding code, including inline assembly. Because of that, allocatable registers are not supported.


The stance articulated here matches your suggestion (and indeed, my original change did not have the extra checks), but AFAICT the code in LLVM today (certainly for the X86 backend) is careful to reject allocatable registers. I erred on the side of "allocatable registers are not supported" rather than "the compiler doesn't check for reigster availability". That said, I really don't have a preference here--if you feel strongly that the additional checks are overkill, I'll remove them.


================
Comment at: test/CodeGen/X86/named-reg-alloc.ll:15
@@ +14,3 @@
+; FIXME: Include an allocatable-specific error message
+; CHECKL Invalid register name global variable
+  %fp = call i32 @llvm.read_register.i32(metadata !1)
----------------
rnk wrote:
> This CHECK is disabled with CHECKL?
Good catch.


Repository:
  rL LLVM

http://reviews.llvm.org/D10977







More information about the llvm-commits mailing list