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.
[Metadata] Try to merge the first and last ranges. (llvm#101860)
Fixes llvm#101859. If we have at least 2 ranges, we have to try to merge the last and first ones to handle the wrap range. (cherry picked from commit 4377656)
- Loading branch information
Showing
2 changed files
with
23 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: opt -passes=gvn -S < %s | FileCheck %s | ||
|
||
define i8 @foo(ptr %arg, i8 %arg1) { | ||
; CHECK-LABEL: define i8 @foo( | ||
; CHECK-SAME: ptr [[ARG:%.*]], i8 [[ARG1:%.*]]) { | ||
; CHECK-NEXT: [[BB:.*:]] | ||
; CHECK-NEXT: [[I:%.*]] = load i8, ptr [[ARG]], align 1, !range [[RNG0:![0-9]+]] | ||
; CHECK-NEXT: [[I3:%.*]] = add i8 [[I]], [[I]] | ||
; CHECK-NEXT: ret i8 [[I3]] | ||
; | ||
bb: | ||
%i = load i8, ptr %arg, align 1, !range !{i8 127, i8 -20} | ||
%i2 = load i8, ptr %arg, align 1, !range !{i8 -27, i8 -24, i8 -20, i8 -17} | ||
%i3 = add i8 %i, %i2 | ||
ret i8 %i3 | ||
} | ||
;. | ||
; CHECK: [[RNG0]] = !{i8 127, i8 -17} | ||
;. |