[llvm] [X86] Resolve FIXME: WinCOFFObjectWriter::RecordRelocation can emit PC-relative calls (PR #83877)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 09:38:02 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-x86

Author: AtariDreams (AtariDreams)

<details>
<summary>Changes</summary>

This has been true for a while now, but this check has not been removed.

---
Full diff: https://github.com/llvm/llvm-project/pull/83877.diff


1 Files Affected:

- (modified) llvm/lib/Target/X86/X86Subtarget.cpp (+1-4) 


``````````diff
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index 07f535685e8f97..74d9b1bd327ea1 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -238,10 +238,7 @@ X86Subtarget::classifyGlobalFunctionReference(const GlobalValue *GV,
 
 /// Return true if the subtarget allows calls to immediate address.
 bool X86Subtarget::isLegalToCallImmediateAddr() const {
-  // FIXME: I386 PE/COFF supports PC relative calls using IMAGE_REL_I386_REL32
-  // but WinCOFFObjectWriter::RecordRelocation cannot emit them.  Once it does,
-  // the following check for Win32 should be removed.
-  if (Is64Bit || isTargetWin32())
+  if (Is64Bit)
     return false;
   return isTargetELF() || TM.getRelocationModel() == Reloc::Static;
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/83877


More information about the llvm-commits mailing list