llvm-project/llvm/test/CodeGen/X86/fast-isel-large-object.ll
Arthur Eubanks 2366d53d8d
[X86] Fix more medium code model addressing modes (#75641)
By looking at whether a global is large instead of looking at the code
model.

This also fixes references to large data in the small code model.

We now always fold any 32-bit offset into the addressing mode with the
large code model since it uses 64-bit relocations.
2023-12-21 10:40:56 -08:00

15 lines
480 B
LLVM

; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
; RUN: llc -fast-isel -mtriple=x86_64-unknown-unknown -relocation-model=pic < %s | FileCheck %s
@g = external dso_local global i32, code_model "large"
define ptr @f() {
; CHECK-LABEL: f:
; CHECK: # %bb.0:
; CHECK-NEXT: leaq _GLOBAL_OFFSET_TABLE_(%rip), %rcx
; CHECK-NEXT: movabsq $g@GOTOFF, %rax
; CHECK-NEXT: addq %rcx, %rax
; CHECK-NEXT: retq
ret ptr @g
}