Files
TheRock/compiler/amd-llvm/llvm/test/Transforms/SCCP/overdefined-ext.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

105 lines
3.2 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=sccp -use-constant-int-for-fixed-length-splat=false -S | FileCheck %s --check-prefixes=CHECK,CHECK-CV
; RUN: opt < %s -passes=sccp -use-constant-int-for-fixed-length-splat -S | FileCheck %s --check-prefixes=CHECK,CHECK-CI
define i32 @zext_lshr(i1 %t0) {
; CHECK-LABEL: @zext_lshr(
; CHECK-NEXT: [[T1:%.*]] = zext i1 [[T0:%.*]] to i32
; CHECK-NEXT: ret i32 0
;
%t1 = zext i1 %t0 to i32
%t2 = lshr i32 %t1, 1
ret i32 %t2
}
define i1 @zext_icmp(i1 %t0) {
; CHECK-LABEL: @zext_icmp(
; CHECK-NEXT: [[T1:%.*]] = zext i1 [[T0:%.*]] to i32
; CHECK-NEXT: ret i1 false
;
%t1 = zext i1 %t0 to i32
%t2 = icmp eq i32 %t1, 2
ret i1 %t2
}
; TODO: SCCP operates poorly with vector ranges
define <2 x i1> @zext_vector(<2 x i1> %t0) {
; CHECK-CV-LABEL: @zext_vector(
; CHECK-CV-NEXT: [[T1:%.*]] = zext <2 x i1> [[T0:%.*]] to <2 x i32>
; CHECK-CV-NEXT: [[T2:%.*]] = icmp eq <2 x i32> [[T1]], splat (i32 2)
; CHECK-CV-NEXT: ret <2 x i1> [[T2]]
;
; CHECK-CI-LABEL: @zext_vector(
; CHECK-CI-NEXT: [[T1:%.*]] = zext <2 x i1> [[T0:%.*]] to <2 x i32>
; CHECK-CI-NEXT: ret <2 x i1> zeroinitializer
;
%t1 = zext <2 x i1> %t0 to <2 x i32>
%t2 = icmp eq <2 x i32> %t1, <i32 2, i32 2>
ret <2 x i1> %t2
}
define <2 x i1> @zext_vector2(<2 x i1> %t0) {
; CHECK-LABEL: @zext_vector2(
; CHECK-NEXT: [[T1:%.*]] = zext <2 x i1> [[T0:%.*]] to <2 x i32>
; CHECK-NEXT: [[T2:%.*]] = add nuw nsw <2 x i32> [[T1]], splat (i32 2)
; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%t1 = zext <2 x i1> %t0 to <2 x i32>
%t2 = add <2 x i32> %t1, <i32 2, i32 2>
%t3 = icmp eq <2 x i32> %t1, %t2
ret <2 x i1> %t3
}
; negative test: %t2 can be replaced by %t1, but SCCP operates by ranges only
define i32 @sext_ashr(i1 %t0) {
; CHECK-LABEL: @sext_ashr(
; CHECK-NEXT: [[T1:%.*]] = sext i1 [[T0:%.*]] to i32
; CHECK-NEXT: [[T2:%.*]] = ashr i32 [[T1]], 1
; CHECK-NEXT: ret i32 [[T2]]
;
%t1 = sext i1 %t0 to i32
%t2 = ashr i32 %t1, 1
ret i32 %t2
}
define i1 @sext_icmp(i1 %t0) {
; CHECK-LABEL: @sext_icmp(
; CHECK-NEXT: [[T1:%.*]] = sext i1 [[T0:%.*]] to i32
; CHECK-NEXT: ret i1 false
;
%t1 = sext i1 %t0 to i32
%t2 = icmp eq i32 %t1, 2
ret i1 %t2
}
; TODO: SCCP operates poorly with vector ranges
define <2 x i1> @sext_vector(<2 x i1> %t0) {
; CHECK-CV-LABEL: @sext_vector(
; CHECK-CV-NEXT: [[T1:%.*]] = sext <2 x i1> [[T0:%.*]] to <2 x i32>
; CHECK-CV-NEXT: [[T2:%.*]] = icmp eq <2 x i32> [[T1]], splat (i32 2)
; CHECK-CV-NEXT: ret <2 x i1> [[T2]]
;
; CHECK-CI-LABEL: @sext_vector(
; CHECK-CI-NEXT: [[T1:%.*]] = sext <2 x i1> [[T0:%.*]] to <2 x i32>
; CHECK-CI-NEXT: ret <2 x i1> zeroinitializer
;
%t1 = sext <2 x i1> %t0 to <2 x i32>
%t2 = icmp eq <2 x i32> %t1, <i32 2, i32 2>
ret <2 x i1> %t2
}
define <2 x i1> @sext_vector2(<2 x i1> %t0) {
; CHECK-LABEL: @sext_vector2(
; CHECK-NEXT: [[T1:%.*]] = sext <2 x i1> [[T0:%.*]] to <2 x i32>
; CHECK-NEXT: [[T2:%.*]] = add nsw <2 x i32> [[T1]], splat (i32 2)
; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%t1 = sext <2 x i1> %t0 to <2 x i32>
%t2 = add <2 x i32> %t1, <i32 2, i32 2>
%t3 = icmp eq <2 x i32> %t1, %t2
ret <2 x i1> %t3
}