[PATCH] D157616: [ExtendLifetimes][2/4] Implement fake.use intrinsic in LLVM to extend the lifetime of operands

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 10:00:18 PDT 2023


jmorse added a comment.

Comments on tests; haven't looked at the python one yet.



================
Comment at: llvm/test/CodeGen/Generic/fake-use-constprop.ll:36
+;
+; CHECK-NOT: fake.use({{.*}} 0)
+;
----------------
There also needs to be some kind of positive check, that fake.uses are preserved or present, or at least something that will cause a test failure if we read a stack trace and no output.


================
Comment at: llvm/test/CodeGen/Generic/fake-use-constprop.ll:39
+; Function Attrs: nounwind sspstrong uwtable
+define i32 @foo(i32 %i, float %f, i32* %punused) {
+entry:
----------------
Typed pointers are banned now, right?


================
Comment at: llvm/test/CodeGen/Generic/fake-use-tailcall.ll:1
+; RUN: llc < %s -stop-after=finalize-isel -O2 - | FileCheck %s
+; Fake uses following tail calls should be pulled in front
----------------
I get the feeling that this has never been run with arches like SPARC, RISC-V and other exotic stuff. It might be risky to have such a generic test; in the worst case scenario we can downgrade it to just being an x86 test instead.


================
Comment at: llvm/test/CodeGen/Generic/fake-use-tailcall.ll:6-12
+; CHECK: body:
+; CHECK: bb.0.{{.*}}:
+; CHECK: %0:{{.*}}= COPY
+; CHECK-NOT: FAKE_USE
+; CHECK: FAKE_USE %0
+; CHECK-NOT: FAKE_USE
+; CHECK: TCRETURN
----------------
I feel like a implicit-check-not for fake_use would be a stronger test.


================
Comment at: llvm/test/CodeGen/MIR/X86/fake-use-phi.mir:8
+#
+# RUN: llc -run-pass=codegenprepare -o - %s | FileCheck %s
+#
----------------
pls2put at the top of the file as that's the convention.


================
Comment at: llvm/test/CodeGen/MIR/X86/fake-use-phi.mir:13
+#
+# CHECK-NOT:  llvm.fake.use{{.*}}call
+
----------------
This should be an implicit check not, and there should be a positive check line somewhere to ensure some vaguely relevant output is produced.


================
Comment at: llvm/test/CodeGen/MIR/X86/fake-use-zero-length.mir:10
+#
+# RUN: llc -stop-after=finalize-isel -o - %s | FileCheck %s
+#
----------------
RUN at the top, positive CHECK line needed etc, as with various other files here.


================
Comment at: llvm/test/CodeGen/X86/fake-use-escape.ll:1
+; RUN: opt -O2 -S %s | FileCheck %s
+;
----------------
This is widely targeted; is there any further information about what pass provoked this test? Having a whole-O2 test, especially in the "CodeGen" dir, might seem like overkill.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157616/new/

https://reviews.llvm.org/D157616



More information about the llvm-commits mailing list