[llvmlinux] [PATCH 2/2] [DO-NOT-UPSTREAM][mips] Remove all instances of explicit register variables from the mips arch.

Behan Webster behanw at converseincode.com
Fri Dec 19 18:07:46 UTC 2014

On 12/19/14 06:07, Daniel Sanders wrote:
> Clang accepts the syntax but does not honour them. I've asked a 
> colleague to
> look into supporting explicit register variables in clang. For now, 
> remove the
> uses of this feature and accept the unnecessary moves.
We've been calling this "named registers". This is something which is 
used to access the value of the stack pointer in the ARM and AARCH64 ports.

clang is supposed to honour these sorts of local allocations, but only 
if used in immediately proceeding ASM code (which appears to be the case 
here...). The problem is that the architecture of llvm doesn't really 
allow for register allocation to be reserved in general.

Otherwise naming a register globally in clang does work, as long as its 
the stack pointer. ;)

Renato Golan did the work to allow the preceding stack pointer 
allocation so we could get things like percpu variables and access to 
the task struct to work on ARM/AARCH64 kernels.

This appears like it will be a difficult situation to resolve 
considering named registers seem to be used a lot in the MIPS kernel.


Behan Webster
behanw at converseincode.com

More information about the LLVMLinux mailing list