[PATCH] D93931: [X86] Don't fold negative offset into 32-bit absolute address (e.g. movl $foo-1, %eax)

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 29 23:46:22 PST 2020


pengfei added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:19116
     if (OpFlags == X86II::MO_NO_FLAG &&
-        X86::isOffsetSuitableForCodeModel(Offset, M)) {
+        X86::isOffsetSuitableForCodeModel(Offset, M, true, true)) {
       std::swap(GlobalOffset, Offset);
----------------
Maybe just need to add `Offset >=0 &&` here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93931



More information about the llvm-commits mailing list