[PATCH] D67601: TLI: Remove DAG argument from getRegisterByName

Renato Golin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 07:28:47 PDT 2019


rengolin added a comment.
Herald added a subscriber: wuzish.

For context, read_register was introduced to allow use of the "global named register" GNU extension.

GNU's version allows the programmer to read any register, on both global and local contexts, which is nuts. After a long discussion, we decided to only allow global read of the stack pointer, which was the only meaningful use of this feature.

The kernel community agreed and changed their code (in a lot of target-specific files) to remove the dangerous use of reading registers directly without an inline asm context.

With that, Clang's implementation ended up as "only SP", which then unfortunately, it seems, allowed some assumptions to shape the code.

I don't know x86 well enough, but this code seems to be checking for some relationship between the frame and stack pointers that don't exist in other targets.

Regarding the change, it looks good to me, but I'll let other people chime in, as it's been a long time since I looked at that code.

cheers,
--renato


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67601/new/

https://reviews.llvm.org/D67601





More information about the llvm-commits mailing list