[DX] Remove IntrNoMem from create handle intrinsic

The create handle intrinsic calls can't be removed, so it was incorrect
to mark them as IntrNoMem.
This commit is contained in:
Chris Bieneman 2022-08-02 16:55:46 -05:00
parent f7872cdce1
commit ee4d815008
2 changed files with 18 additions and 1 deletions

View File

@ -18,5 +18,5 @@ def int_dx_thread_id_in_group : Intrinsic<[llvm_i32_ty], [llvm_i32_ty], [IntrNoM
def int_dx_flattened_thread_id_in_group : Intrinsic<[llvm_i32_ty], [], [IntrNoMem, IntrWillReturn]>;
def int_dx_create_handle : ClangBuiltin<"__builtin_hlsl_create_handle">,
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrNoMem, IntrWillReturn]>;
Intrinsic<[ llvm_ptr_ty ], [llvm_i8_ty], [IntrWillReturn]>;
}

View File

@ -0,0 +1,17 @@
; RUN: opt %s -early-cse -S | FileCheck %s
define void @fn() {
entry:
%0 = tail call ptr @llvm.dx.create.handle(i8 1)
%1 = tail call ptr @llvm.dx.create.handle(i8 1)
ret void
}
; Function Attrs: mustprogress nounwind willreturn
declare ptr @llvm.dx.create.handle(i8) #0
attributes #0 = { mustprogress nounwind willreturn }
; CSE needs to leave this alone
; CHECK: %0 = tail call ptr @llvm.dx.create.handle(i8 1)
; CHECK: %1 = tail call ptr @llvm.dx.create.handle(i8 1)