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

    <tr>
        <th>Summary</th>
        <td>
            [llc] Signed Overflow detected by UBSan.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            backend:X86
      </td>
    </tr>

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

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

<pre>
    ```ll
target datalayout = "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128"
target triple = "i386-unknown-linux-gnu"

define void @test(ptr %0) {
 %2 = alloca [10 x i8], i32 0, align 1
  %3 = ptrtoint ptr %2 to i32
 %4 = add i32 %3, 2147483647
  br label %5

5: ; preds = %5, %1
  %6 = phi i32 [ 0, %1 ], [ %7, %5 ]
  %7 = add i32 %6, 1
  %8 = icmp eq i32 %6, %4
  br label %5
]
```
```bash
> llc out.ll
.../llvm-project/llvm/lib/Target/X86/X86RegisterInfo.cpp:945:27: runtime error: signed integer overflow: 3 + 2147483647 cannot be represented in type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior .../llvm-project/llvm/lib/Target/X86/X86RegisterInfo.cpp:945:27 in
```
I can reproduce this on f17e76697289e6a54e89298a49f12b6799dd3e1a

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVM2O4zYMfhrlQsSwKcs_Bx-SnQbYw6LATAdoj7JFO-oqkivLszt9-kKyZ2eyKHoqECgiRX7kR9KUy6InS9QxcWbi4SDXcHW-e5SGrCJ_6J167ViVbz9jWP7A8lOQfqIASgZp5KtbAzD-AAyRjjfGT3ScGT9xTMdxxjq_F4t7Md6qMh3HMV047lKzeR5tw_ipqDbhqcCGId6lEryeDb2loXlTHVf71bpv9mi0Xb8fJ7v-8NlORaO2BC9OK2BlHmgJDJs5eGAocoYtsP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