forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[InstCombine] Fold zext(X) + C2 pred C -> X + C3 pred C4 (llvm#110511)
Motivating case from https://github.com/torvalds/linux/blob/9852d85ec9d492ebef56dc5f229416c925758edc/drivers/gpu/drm/drm_edid.c#L5238-L5240: ``` define i1 @src(i8 noundef %v13) { entry: %conv1 = zext i8 %v13 to i32 %add = add nsw i32 %conv1, -4 %cmp = icmp ult i32 %add, 3 %cmp4 = icmp slt i8 %v13, 4 %cond = select i1 %cmp4, i1 true, i1 %cmp ret i1 %cond } define i1 @tgt(i8 noundef %v13) { entry: %cmp4 = icmp slt i8 %v13, 7 ret i1 %cmp4 } ```
- Loading branch information
Showing
2 changed files
with
130 additions
and
0 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