[PATCH] D157615: [ExtendLifetimes][1/4] Add "disable-post-ra" function attribute to disable the post-regalloc scheduler
Orlando Cazalet-Hyams via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 22 13:16:14 PDT 2023
Orlando added inline comments.
================
Comment at: llvm/lib/CodeGen/PostRASchedulerList.cpp:282
+ if (Fn.getFunction().hasFnAttribute("disable-post-ra"))
+ return false;
----------------
bikeshed: `disable-post-ra` seems potentially unclear. Perhaps `disable-post-ra-sched`?
================
Comment at: llvm/test/CodeGen/X86/suppress-post-ra.ll:7
+; RUN: llc < %s -O2 -print-after=post-RA-sched 2>&1 > /dev/null - | tail -n +2 > %t2
+; RUN: diff %t1 %t2
+;
----------------
Do you need to run all the `O2` passes? Can we not just use `--run-pass=post-RA-sched`?
Secondly, IMO it'd be good to check that post-RA-sched does something to the input when the attribute isn't present to avoid a rotten green test. You could probably achieve that with a `sed` command to add/remove the attribute (see example in [dbg-empty-metadata-lowering.ll](https://github.com/llvm/llvm-project/blob/main/llvm/test/DebugInfo/X86/dbg-empty-metadata-lowering.ll)).
================
Comment at: llvm/test/CodeGen/X86/suppress-post-ra.ll:21
+ %0 = bitcast i32* %val to i8*
+ call void @llvm.lifetime.start(i64 4, i8* %0) #3
+ %1 = load i32, i32* @data, align 4, !tbaa !2
----------------
Can the tbaa metadata and lifetime markers be removed?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157615/new/
https://reviews.llvm.org/D157615
More information about the llvm-commits
mailing list