[llvm] [X86] Restrict offset folding into address mode in 16-bit mode (PR #179399)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 3 08:28:38 PST 2026


================
@@ -1852,6 +1852,11 @@ bool X86DAGToDAGISel::foldOffsetIntoAddress(uint64_t Offset,
         !isDispSafeForFrameIndexOrRegBase((uint32_t)Val) &&
         !AM.hasBaseOrIndexReg())
       return true;
+  } else if (Subtarget->is16Bit()) {
----------------
MaskRay wrote:

This is intentional so that we skip `(AM.hasBaseOrIndexReg() && !isDispSafeForFrameIndexOrRegBase(Val)` for the `is16Bit()` code path.

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


More information about the llvm-commits mailing list