Paul Walker 56c091ea71
[LLVM][IR] Use splat syntax when printing ConstantExpr based splats. (#116856)
This brings the printing of scalable vector constant splats inline with
their fixed length counterparts.
2024-11-21 11:21:12 +00:00

16 lines
622 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]], splat (i64 -309383)
; 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
}