-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-reduce] Try harder to not create invalid aliases
This was done by adding --abort-on-invalid-reduction to remove-function-bodies-used-in-globals.ll and fixing the fallout. Aliases must have a GlobalValue or ConstantExpr aliasee and the aliasee must be a definition if it's a GlobalValue. Don't RAUW functions with null if there's an alias pointing to it, and similarly don't delete the body of a function. Don't delete the entire body of a function when reducing blocks, preserve at least one block. Also make debugging these sorts of things easier by dumping the module when --abort-on-invalid-reduction triggers. Reviewed By: regehr Differential Revision: https://reviews.llvm.org/D131505
- Loading branch information
Showing
11 changed files
with
45 additions
and
61 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,18 +1,14 @@ | ||
; Test that llvm-reduce correctly removes the entry block of functions for | ||
; linkages other than external and weak. | ||
; Test that llvm-reduce does not remove the entry block of functions. | ||
; | ||
; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=basic-blocks --test FileCheck --test-arg --check-prefixes=CHECK-INTERESTINGNESS --test-arg %s --test-arg --input-file %s -o %t | ||
; RUN: cat %t | FileCheck %s | ||
|
||
; CHECK-INTERESTINGNESS: interesting1: | ||
; CHECK-INTERESTINGNESS: foo | ||
|
||
; CHECK-NOT: uninteresting | ||
define linkonce_odr i32 @foo() { | ||
; CHECK: add i32 | ||
define i32 @foo() { | ||
uninteresting: | ||
%a = add i32 0, 0 | ||
ret i32 0 | ||
} | ||
|
||
define i32 @main(i1 %c) { | ||
interesting1: | ||
ret i32 0 | ||
} |
2 changes: 1 addition & 1 deletion
2
llvm/test/tools/llvm-reduce/remove-function-bodies-used-in-globals.ll
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
2 changes: 1 addition & 1 deletion
2
llvm/test/tools/llvm-reduce/temporary-files-as-bitcode-split.ll
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
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