[PATCH] D98606: [NVPTX] CUDA does provide malloc/free since compute capability 2.X
Artem Belevich via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 15 14:26:39 PDT 2021
tra accepted this revision.
tra added a comment.
This revision is now accepted and ready to land.
LGTM module couple of test nits.
================
Comment at: llvm/test/CodeGen/NVPTX/libcall-fulfilled.ll:39-45
+; CHECK: (
+; CHECK: param0
+; CHECK: );
+; CHECK: ld.param.b32 %r1, [retval0+0];
+; CHECK: } // callseq 1
+; CHECK: mov.u16 %rs1, 0;
+; CHECK: st.u8 [%r1], %rs1;
----------------
I'd just leave
```
CHECK: call.uni
CHECK: malloc
CHECK: call-uni
CHECK: free
```
The surrounding call setup machinery is not particularly interesting and can potentially morph due to unrelated backend changes.
================
Comment at: llvm/test/Transforms/InstCombine/malloc_free_delete_nvptx.ll:13
+; CHECK-LABEL: @malloc_then_free(
+; CHECK-NEXT: ret void
+;
----------------
I'd explicitly check that malloc/free are missing to make it obvious.
```
CHECK-NOT: malloc
CHECK-NOT: free
CHECK: ret void
```
Otherwise the test looks somewhat odd -- it's supposedly about mallof and free, but the CHECK lines don't mention either. The `optimize them properly` in the comment above could also be more specific about what we expect to happen.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98606/new/
https://reviews.llvm.org/D98606
More information about the llvm-commits
mailing list