-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstSimplify] Simplify
select cond, undef, val
to val
if `val = …
…poison` implies `cond = poison` (#76465) This patch folds: ``` select cond, undef, val -> val select cond, val, undef -> val ``` iff `impliesPoison(val, cond)` returns true. Example: ``` define i32 @SRC1(i32 %retval.0.i.i) { %cmp.i = icmp sgt i32 %retval.0.i.i, -1 %spec.select.i = select i1 %cmp.i, i32 %retval.0.i.i, i32 undef ret i32 %spec.select.i } define i32 @tgt1(i32 %retval.0.i.i) { ret i32 %retval.0.i.i } ``` Alive2: https://alive2.llvm.org/ce/z/okJW3G Compile-time impact: http://llvm-compile-time-tracker.com/compare.php?from=38c9390b59c4d2b9181614d6a909887497d3692f&to=e146f51ba278aa3bb6879a9ec651831ac8938e91&stat=instructions%3Au
- Loading branch information
Showing
4 changed files
with
9 additions
and
22 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