mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
65ce9e19e8
For tracked globals that are unknown after solving, we expect all non-store uses to be replaced. This is a follow-up to f8045b250d80, which removed forcedconstant. We should not mark unknown loads as overdefined, as they either load from an unknown pointer or an undef global. Restore the original logic for loads.
15 lines
395 B
LLVM
15 lines
395 B
LLVM
; RUN: opt < %s -data-layout="E-p:32:32" -ipsccp -S | FileCheck %s
|
|
|
|
@j = internal global i32 undef, align 4
|
|
|
|
; Make sure we do not mark loads from undef as overdefined.
|
|
define i32 @test5(i32 %b) {
|
|
; CHECK-LABEL: define i32 @test5(i32 %b)
|
|
; CHECK-NEXT: %add = add nsw i32 undef, %b
|
|
; CHECK-NEXT: ret i32 %add
|
|
;
|
|
%l = load i32, i32* @j, align 4
|
|
%add = add nsw i32 %l, %b
|
|
ret i32 %add
|
|
}
|