Files
clang-p2996/llvm/test/Transforms/InstCombine/pr83931.ll
Yingwei Zheng d51fcd4ed8 [InstCombine] Handle scalable splat in getFlippedStrictnessPredicateAndConstant (#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 https://github.com/llvm/llvm-project/issues/83931.
2024-03-05 21:08:15 +08:00

16 lines
762 B
LLVM

; 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
}