mirror of
https://github.com/RPCSX/llvm.git
synced 2025-03-04 19:07:26 +00:00

We didn't consider the inbounds flag on GEPs leading to downstream users introducing UB. This fixes PR28562. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275532 91177308-0d34-0410-b5e6-96231b3b80d8
10 lines
285 B
LLVM
10 lines
285 B
LLVM
; RUN: opt -S -gvn < %s | FileCheck %s
|
|
define i32* @test1(i32* %a) {
|
|
%x1 = getelementptr inbounds i32, i32* %a, i32 10
|
|
%x2 = getelementptr i32, i32* %a, i32 10
|
|
ret i32* %x2
|
|
; CHECK-LABEL: @test1(
|
|
; CHECK: %[[x:.*]] = getelementptr i32, i32* %a, i32 10
|
|
; CHECK: ret i32* %[[x]]
|
|
}
|