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
67 lines
2.8 KiB
LLVM
67 lines
2.8 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
|
|
|
; Check that assume is propagated backwards through all
|
|
; operations that are `isGuaranteedToTransferExecutionToSuccessor`
|
|
define i32 @assume_inevitable(ptr %a, ptr %b, ptr %c) {
|
|
; CHECK-LABEL: @assume_inevitable(
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[M:%.*]] = alloca i64, align 8
|
|
; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[A:%.*]], align 4
|
|
; CHECK-NEXT: [[LOADRES:%.*]] = load i32, ptr [[B:%.*]], align 4
|
|
; CHECK-NEXT: [[LOADRES2:%.*]] = call i32 @llvm.annotation.i32.p0(i32 [[LOADRES]], ptr nonnull @.str, ptr nonnull @.str1, i32 2)
|
|
; CHECK-NEXT: store i32 [[LOADRES2]], ptr [[A]], align 4
|
|
; CHECK-NEXT: [[DUMMY_EQ:%.*]] = icmp ugt i32 [[LOADRES]], 42
|
|
; CHECK-NEXT: tail call void @llvm.assume(i1 [[DUMMY_EQ]])
|
|
; CHECK-NEXT: [[M_A:%.*]] = call ptr @llvm.ptr.annotation.p0.p0(ptr nonnull [[M]], ptr nonnull @.str, ptr nonnull @.str1, i32 2, ptr null)
|
|
; CHECK-NEXT: [[OBJSZ:%.*]] = call i64 @llvm.objectsize.i64.p0(ptr [[C:%.*]], i1 false, i1 false, i1 false)
|
|
; CHECK-NEXT: store i64 [[OBJSZ]], ptr [[M_A]], align 4
|
|
; CHECK-NEXT: call void @llvm.assume(i1 true) [ "align"(ptr [[A]], i64 32) ]
|
|
; CHECK-NEXT: ret i32 [[TMP0]]
|
|
;
|
|
entry:
|
|
%dummy = alloca i8, align 4
|
|
%m = alloca i64
|
|
%0 = load i32, ptr %a, align 4
|
|
|
|
; START perform a bunch of inevitable operations
|
|
%loadres = load i32, ptr %b
|
|
%loadres2 = call i32 @llvm.annotation.i32(i32 %loadres, ptr @.str, ptr @.str1, i32 2)
|
|
store i32 %loadres2, ptr %a
|
|
|
|
%dummy_eq = icmp ugt i32 %loadres, 42
|
|
tail call void @llvm.assume(i1 %dummy_eq)
|
|
|
|
call void @llvm.lifetime.start.p0(ptr %dummy)
|
|
%i = call ptr @llvm.invariant.start.p0(i64 1, ptr %dummy)
|
|
call void @llvm.invariant.end.p0(ptr %i, i64 1, ptr %dummy)
|
|
call void @llvm.lifetime.end.p0(ptr %dummy)
|
|
|
|
%m_a = call ptr @llvm.ptr.annotation.p0(ptr %m, ptr @.str, ptr @.str1, i32 2, ptr null)
|
|
%objsz = call i64 @llvm.objectsize.i64.p0(ptr %c, i1 false)
|
|
store i64 %objsz, ptr %m_a
|
|
; END perform a bunch of inevitable operations
|
|
|
|
; AND here's the assume:
|
|
%ptrint = ptrtoint ptr %a to i64
|
|
%maskedptr = and i64 %ptrint, 31
|
|
%maskcond = icmp eq i64 %maskedptr, 0
|
|
tail call void @llvm.assume(i1 %maskcond)
|
|
|
|
ret i32 %0
|
|
}
|
|
|
|
@.str = private unnamed_addr constant [4 x i8] c"sth\00", section "llvm.metadata"
|
|
@.str1 = private unnamed_addr constant [4 x i8] c"t.c\00", section "llvm.metadata"
|
|
|
|
declare i64 @llvm.objectsize.i64.p0(ptr, i1)
|
|
declare i32 @llvm.annotation.i32(i32, ptr, ptr, i32)
|
|
declare ptr @llvm.ptr.annotation.p0(ptr, ptr, ptr, i32, ptr)
|
|
|
|
declare void @llvm.lifetime.start.p0(ptr nocapture)
|
|
declare void @llvm.lifetime.end.p0(ptr nocapture)
|
|
|
|
declare ptr @llvm.invariant.start.p0(i64, ptr nocapture)
|
|
declare void @llvm.invariant.end.p0(ptr, i64, ptr nocapture)
|
|
declare void @llvm.assume(i1)
|