<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/87154>87154</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            virtual bool llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::iterator, int, unsigned int, llvm::RegScavenger*) const: Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          DigOrDog
      </td>
    </tr>
</table>

<pre>
    # Description
The following code crashes X86 backend with "Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed."

# Minimal Reproduction
https://godbolt.org/z/h57r6bMsq

## code
```java
define void @f(i16 %LGV2, i1 %LGV3) {
BB:
  %A = alloca i1, i33 2147483648, align 1
  %G = getelementptr i1, ptr %A, i16 %LGV2
  %G4 = getelementptr i1, ptr %G, i32 -2147483648
  store i1 %LGV3, ptr %G4, align 1
  ret void
}
```

## Stack Trace
```
llc: /root/llvm-project/llvm/lib/Target/X86/X86RegisterInfo.cpp:950: virtual bool llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineBasicBlock::iterator, int, unsigned int, llvm::RegScavenger*) const: Assertion `(!Is64Bit || isInt<32>((long long)FIOffset + Imm)) && "Requesting 64-bit offset in 32-bit immediate!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/llc -o /app/output.s -x86-asm-syntax=intel -mtriple=x86_64 -mattr=+avx512f -O=0 <source>
1.      Running pass 'Function Pass Manager' on module '<source>'.
2.      Running pass 'Prologue/Epilogue Insertion & Frame Finalization' on function '@f'
 #0 0x000000000392d5d8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x392d5d8)
 #1 0x000000000392ad2c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007f2edc842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #3 0x00007f2edc8969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #4 0x00007f2edc842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #5 0x00007f2edc8287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #6 0x00007f2edc82871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #7 0x00007f2edc839e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #8 0x0000000001cf0fb0 llvm::X86RegisterInfo::eliminateFrameIndex(llvm::MachineInstrBundleIterator<llvm::MachineInstr, false>, int, unsigned int, llvm::RegScavenger*) const (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x1cf0fb0)
 #9 0x0000000002ac734c (anonymous namespace)::PEI::runOnMachineFunction(llvm::MachineFunction&) PrologEpilogInserter.cpp:0:0
#10 0x0000000002946051 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (.part.0) MachineFunctionPass.cpp:0:0
#11 0x0000000002f04a33 llvm::FPPassManager::runOnFunction(llvm::Function&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f04a33)
#12 0x0000000002f04c71 llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f04c71)
#13 0x0000000002f054d5 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x2f054d5)
#14 0x0000000000823e0c compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#15 0x0000000000722fd6 main (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x722fd6)
#16 0x00007f2edc829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#17 0x00007f2edc829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#18 0x000000000081a92e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/llc+0x81a92e)
Program terminated with signal: SIGSEGV
Compiler returned: 139
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWE1v4zgS_TX0pWBDIvV58MGO46yBDjpIBo25BRRFyZxQpIak0s78-gUpJbE8WexkJ1jsYRsdW6JVr159PZqm1opWcb5G6RaluwUd3FGb9U60381Ot4tK1y9rhAnsuGVG9E5ohaIdija_HDk0Wkr9U6gWmK45MEPtkVv4tcigouyJqxp-CncEhPHGWm68NaAsQrhAOD7YLNkKByi_QvkVCHtQDpErghG5Dk8UUqsW_AvC5f7wvWksd4DwFg5dh3CJcAkIZwhn3sM9_33g1nk2WbKshAM9GggFBIcF0XW8FtRxhGOEMcI5NFRIXq_8XQhresUEboUSHZVwz3uj64G9h350rreIbBDeI7xvdV1p6VbatAjv_0B4f0xzk1W39vcLSI_qEzUtZNH4_zf6TMelmjdCcXjWogaURA3ChYh9cOm3mx8Y4SsQ8XRHQvD5djTcbj2dcAn-gQ0gsgMqpWYURBwsCQEcJ3lSkCwp_AqVolUQn5ndBLOWOy55x5XrnZms_ZXHHTm8UzqzTf6d8c1IA8PyjMcEYJ02fBbdu1nyAVnDXUjTlMp8d5HTDzL_4Ch7gl8MZZcFGG-lZIhsAOG90dohvJfyuVv2Rv_G2eutfxMVwvtfqGm5X_21yMbXe94K67g5qEavWN8jsinTyCM-C-MGKqHSWkJAIRtENhc24yKXohOKOr43tOMHVfOTn4M3o1vKjkLxLbWCbaVmT-OycNxQp03IsHL-bVBhsuvX-3eMe94-MPrMVcsNwhvfSEwr6zzX__UxDZW6-3a9ebgGO1SdcEChGlowvNfGgdNwMZ3CHYdqxXR3VsJ5YYW1A7cI74Eqny4mh5qDO06CFqTM-baZ3I-NVA9d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