Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SCCP] Do not mark unknown loads as overdefined.
For tracked globals that are unknown after solving, we expect all non-store uses to be replaced. This is a follow-up to f8045b2, 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.
- Loading branch information
Showing
5 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
; 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 | ||
} |