[PATCH] D89341: [X86] Encode global symbol address in sub if possible

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 16:32:53 PDT 2020


craig.topper added a comment.

In D89341#2328996 <https://reviews.llvm.org/D89341#2328996>, @weiwang wrote:

> Thanks for the comment, Craig.
>
> `isSExtAbsoluteSymbolRef ` does seem to check for the width of immediate. If the immediate can be encoded directly, the node should be replaced with one of the `SUB64ri*` nodes. I think the `X86Wrapper` node can be replaced with a corresponding `imm` node if conditions are met, then the matching can proceed.

I was thinking that if we don't have range information from getAbsoluteSymbolRange, but the Width passed to isSExtAbsoluteSymbolRef is 32 and the code model is small we could return true?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89341



More information about the llvm-commits mailing list