[llvm] [Cygwin] Cygwin X86ISelDAGToDAG.cpp (PR #76284)
εΎζζ Xu Chiheng via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 04:47:37 PST 2024
https://github.com/xu-chiheng updated https://github.com/llvm/llvm-project/pull/76284
>From 4456dcc7e6ef9eca93cb3110ee5f26900cc6a317 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 20:47:01 +0800
Subject: [PATCH] 1
---
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index 77a997588c4fee..fc3cde7fba5368 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -2948,14 +2948,17 @@ bool X86DAGToDAGISel::selectMOV64Imm32(SDValue N, SDValue &Imm) {
// 32 bit constants.
if (N->getOpcode() != ISD::TargetGlobalAddress) {
return TM.getCodeModel() == CodeModel::Small ||
- TM.getCodeModel() == CodeModel::Medium;
+ (!(Subtarget->isTargetWindowsCygwin() && Subtarget->is64Bit()) &&
+ TM.getCodeModel() == CodeModel::Medium);
}
const GlobalValue *GV = cast<GlobalAddressSDNode>(N)->getGlobal();
if (std::optional<ConstantRange> CR = GV->getAbsoluteSymbolRange())
return CR->getUnsignedMax().ult(1ull << 32);
-
- return !TM.isLargeGlobalValue(GV);
+ else if (Subtarget->isTargetWindowsCygwin() && Subtarget->is64Bit())
+ return TM.getCodeModel() == CodeModel::Small;
+ else
+ return !TM.isLargeGlobalValue(GV);
}
bool X86DAGToDAGISel::selectLEA64_32Addr(SDValue N, SDValue &Base,
More information about the llvm-commits
mailing list