-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[DAGCombiner] Allow tryToFoldExtOfLoad to use a sextload for zext nneg. #81714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
55eb482
[RISCV] Add test for an upcoming DAGCombine change. NFC
topperc 9a01897
[DAGCombiner] Allow tryToFoldExtOfLoad to use a sextload for zext nneg.
topperc 902093a
fixup! clang-format
topperc ba0115f
!fixup Detect signed setccs early to change the load extend type befo…
topperc 2bb7c86
fixup! clang-format
topperc ba62e20
Address review comment
topperc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,28 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: llc < %s -mtriple=riscv64 | FileCheck %s | ||
|
||
define i8 @zext_nonneg_load_i16(ptr %x, ptr %y) { | ||
; CHECK-LABEL: zext_nonneg_load_i16: | ||
; CHECK: # %bb.0: | ||
; CHECK-NEXT: lh a0, 0(a0) | ||
; CHECK-NEXT: bltz a0, .LBB0_2 | ||
; CHECK-NEXT: # %bb.1: # %cont | ||
; CHECK-NEXT: add a0, a1, a0 | ||
; CHECK-NEXT: lbu a0, 0(a0) | ||
; CHECK-NEXT: ret | ||
; CHECK-NEXT: .LBB0_2: # %exit | ||
; CHECK-NEXT: li a0, 0 | ||
; CHECK-NEXT: ret | ||
%a = load i16, ptr %x | ||
%b = icmp slt i16 %a, 0 | ||
br i1 %b, label %exit, label %cont | ||
|
||
cont: | ||
%c = zext nneg i16 %a to i64 | ||
%d = getelementptr i8, ptr %y, i64 %c | ||
%e = load i8, ptr %d | ||
ret i8 %e | ||
|
||
exit: | ||
ret i8 0 | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.