-
Notifications
You must be signed in to change notification settings - Fork 677
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llc/opt] Add an option to run all passes twice (#6666)
This PR pulls the following upstream changes into DXC: [llc/opt] Add an option to run all passes twice (llvm/llvm-project@04464cf) > Lately, I have submitted a number of patches to fix bugs that only occurred when using the same pass manager to compile > multiple modules (generally these bugs are failure to reset some persistent state). > > Unfortunately I don't think there is currently a way to test that from the command line. This adds a very simple flag to both > llc and opt, under which the tools will simply re-run their respective > pass pipelines using the same pass manager on (a clone of the same module). Additionally, we verify that both outputs are > bitwise the same. > > Reviewers: yaron.keren [opt] Fix sanitizer complaints about r254774 (llvm/llvm-project@38707c4) > `Out` can be null if no output is requested, so move any access > to it inside the conditional. Thanks to Justin Bogner for finding > this. This is for the test of this change (llvm/llvm-project@ef8761f) to fix #6659. --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Adam Yang <[email protected]>
- Loading branch information
1 parent
b197bec
commit b79169b
Showing
4 changed files
with
115 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
; Check that there is no persistent state in the ELF emitter that crashes us | ||
; when we try to reuse the pass manager | ||
; RUN: llc -compile-twice -filetype=obj %s -o - | ||
|
||
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32" | ||
target triple = "i386-pc-linux-gnu" |
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 @@ | ||
; The pass here doesn't matter (we use deadargelim), but test | ||
; that the -run-twice options exists, generates output, and | ||
; doesn't crash | ||
; RUN: opt -run-twice -deadargelim -S < %s | FileCheck %s | ||
|
||
; CHECK: define internal void @test | ||
define internal {} @test() { | ||
ret {} undef | ||
} | ||
|
||
define void @caller() { | ||
call {} @test() | ||
ret void | ||
} |
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