[llvm] [Cygwin] Cygwin X86ISelDAGToDAG.cpp (PR #76883)

εΎζŒζ’ Xu Chiheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 00:13:29 PST 2024


https://github.com/xu-chiheng updated https://github.com/llvm/llvm-project/pull/76883

>From 5a1f2bae0dd2c4282fce24299e41b9d0e3c104b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BE=90=E6=8C=81=E6=81=92=20Xu=20Chiheng?=
 <chiheng.xu at gmail.com>
Date: Thu, 4 Jan 2024 16:09:59 +0800
Subject: [PATCH] 1

---
 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index 77a997588c4fee..8cbb0fd25e2ffe 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -1828,7 +1828,9 @@ bool X86DAGToDAGISel::matchWrapper(SDValue N, X86ISelAddressMode &AM) {
   // That signifies access to globals that are known to be "near",
   // such as the GOT itself.
   CodeModel::Model M = TM.getCodeModel();
-  if (Subtarget->is64Bit() && M == CodeModel::Large && !IsRIPRelTLS)
+  if (Subtarget->is64Bit() && ((M == CodeModel::Large && !IsRIPRelTLS) ||
+                               (Subtarget->isTargetWindowsCygwin() &&
+                                M == CodeModel::Medium && !IsRIPRel)))
     return true;
 
   // Base and index reg must be 0 in order to use %rip as base.



More information about the llvm-commits mailing list