-
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.
[InstCombine] Handle scalable splat in `getFlippedStrictnessPredicate…
…AndConstant` (#83980) This patch adds support for canonicalization of icmp with a scalable splat. Some optimizations assume that `icmp pred X, APInt C` is in canonical form. Fixes #83931.
- Loading branch information
Showing
4 changed files
with
24 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,15 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4 | ||
; RUN: opt -S -passes=instcombine < %s | FileCheck %s | ||
|
||
define <vscale x 2 x i1> @dont_crash(<vscale x 2 x i64> %x) { | ||
; CHECK-LABEL: define <vscale x 2 x i1> @dont_crash( | ||
; CHECK-SAME: <vscale x 2 x i64> [[X:%.*]]) { | ||
; CHECK-NEXT: entry: | ||
; CHECK-NEXT: [[RET:%.*]] = icmp sgt <vscale x 2 x i64> [[X]], shufflevector (<vscale x 2 x i64> insertelement (<vscale x 2 x i64> poison, i64 -309383, i64 0), <vscale x 2 x i64> poison, <vscale x 2 x i32> zeroinitializer) | ||
; CHECK-NEXT: ret <vscale x 2 x i1> [[RET]] | ||
; | ||
entry: | ||
%div = sdiv <vscale x 2 x i64> %x, splat (i64 309383) | ||
%ret = icmp sge <vscale x 2 x i64> %div, zeroinitializer | ||
ret <vscale x 2 x i1> %ret | ||
} |
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