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
59 lines
1.5 KiB
LLVM
59 lines
1.5 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -S -passes=instcombine | FileCheck %s
|
|
|
|
declare i8 @llvm.bitreverse.i8(i8)
|
|
declare i32 @llvm.bitreverse.i32(i32)
|
|
|
|
define i1 @test1(i32 %arg) {
|
|
; CHECK-LABEL: @test1(
|
|
; CHECK-NEXT: ret i1 true
|
|
;
|
|
%a = or i32 %arg, 4294901760
|
|
%b = call i32 @llvm.bitreverse.i32(i32 %a)
|
|
%and = and i32 %b, 65535
|
|
%res = icmp eq i32 %and, 65535
|
|
ret i1 %res
|
|
}
|
|
|
|
define i1 @test2(i32 %arg) {
|
|
; CHECK-LABEL: @test2(
|
|
; CHECK-NEXT: ret i1 true
|
|
;
|
|
%a = or i32 %arg, 1
|
|
%b = call i32 @llvm.bitreverse.i32(i32 %a)
|
|
%c = and i32 %b, 2147483648
|
|
%d = call i32 @llvm.bitreverse.i32(i32 %c)
|
|
%res = icmp eq i32 %d, 1
|
|
ret i1 %res
|
|
}
|
|
|
|
define i1 @test3(i32 %arg) {
|
|
; CHECK-LABEL: @test3(
|
|
; CHECK-NEXT: ret i1 false
|
|
;
|
|
%a = or i32 %arg, 65536
|
|
%b = call i32 @llvm.bitreverse.i32(i32 %a)
|
|
%and = and i32 %b, 32768
|
|
%res = icmp eq i32 %and, 0
|
|
ret i1 %res
|
|
}
|
|
|
|
; known bits for the bitreverse will say the result is in the range [0, 64)
|
|
; but the metadata says [0, 16). So make sure the range metadata wins.
|
|
; add %reverse, 1111 0000
|
|
; should become
|
|
; or %reverse, 1111 0000
|
|
|
|
define i8 @add_bitreverse(i8 %a) {
|
|
; CHECK-LABEL: @add_bitreverse(
|
|
; CHECK-NEXT: [[TMP1:%.*]] = or i8 [[A:%.*]], 15
|
|
; CHECK-NEXT: [[C:%.*]] = call i8 @llvm.bitreverse.i8(i8 [[TMP1]])
|
|
; CHECK-NEXT: ret i8 [[C]]
|
|
;
|
|
%b = and i8 %a, 252
|
|
%reverse = call i8 @llvm.bitreverse.i8(i8 %b), !range !1
|
|
%c = add i8 %reverse, -16
|
|
ret i8 %c
|
|
}
|
|
!1 = !{i8 0, i8 16}
|