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
54 lines
1.6 KiB
LLVM
54 lines
1.6 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
|
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
|
|
|
|
define dso_local i32 @_Z6answeri(i32 %0) {
|
|
; CHECK-LABEL: @_Z6answeri(
|
|
; CHECK-NEXT: [[TMP2:%.*]] = call noalias nonnull dereferenceable(80) ptr @_Znam(i64 80) #[[ATTR4:[0-9]+]]
|
|
; CHECK-NEXT: call void @free(ptr [[TMP2]])
|
|
; CHECK-NEXT: ret i32 42
|
|
;
|
|
%2 = call noalias nonnull ptr @_Znam(i64 80) #0
|
|
call void @free(ptr %2)
|
|
ret i32 42
|
|
}
|
|
|
|
; All we care about with this function is that LLVM doesn't crash
|
|
; when optimizing it.
|
|
define void @test_alloca() {
|
|
; CHECK-LABEL: @test_alloca(
|
|
; CHECK-NEXT: [[TMP1:%.*]] = alloca i8, align 1
|
|
; CHECK-NEXT: call void @free(ptr [[TMP1]])
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%1 = alloca i8
|
|
call void @free(ptr %1)
|
|
ret void
|
|
}
|
|
|
|
; Test that missing `alloc-family` attributes don't crash LLVM
|
|
; https://github.com/llvm/llvm-project/issues/63749
|
|
|
|
define void @no_family() {
|
|
; CHECK-LABEL: @no_family(
|
|
; CHECK-NEXT: [[ALLOC:%.*]] = call ptr @customalloc(i64 64)
|
|
; CHECK-NEXT: call void @customfree(ptr [[ALLOC]])
|
|
; CHECK-NEXT: ret void
|
|
;
|
|
%alloc = call ptr @customalloc(i64 64)
|
|
call void @customfree(ptr %alloc)
|
|
ret void
|
|
}
|
|
|
|
|
|
; Function Attrs: nobuiltin allocsize(0)
|
|
declare dso_local nonnull ptr @_Znam(i64) #1
|
|
|
|
; Function Attrs: nounwind
|
|
declare dso_local void @free(ptr) allockind("free") "alloc-family"="malloc"
|
|
|
|
declare ptr @customalloc(i64) allockind("alloc")
|
|
declare void @customfree(ptr allocptr) allockind("free")
|
|
|
|
attributes #0 = { builtin allocsize(0) }
|
|
attributes #1 = { nobuiltin allocsize(0) allockind("alloc,uninitialized") "alloc-family"="_Znam" }
|