https://github.com/llvm/llvm-project/issues/55914
When counting instructions to compare with threshold debug instructions need to be ignored in order to be invariant wrt to debuginfo
Paths
| Differential D127208
MachineSink debug invariance ClosedPublic Authored by markus on Jun 7 2022, 5:27 AM.
Details
Summary https://github.com/llvm/llvm-project/issues/55914 When counting instructions to compare with threshold debug instructions need to be ignored in order to be invariant wrt to debuginfo
Diff Detail
Event TimelineComment Actions Should add a .mir test
Comment Actions
+1 This change looks ok to me but FTR I haven't touched the MachineSink pass before.
fhahn added inline comments.
This revision is now accepted and ready to land.Jun 20 2022, 7:38 AM This revision was landed with ongoing or failed builds.Jun 20 2022, 11:13 PM Closed by commit rG3815ae29b5cb: [machinesink] fix debug invariance issue (authored by markus). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 438564 llvm/include/llvm/CodeGen/MachineBasicBlock.h
llvm/lib/CodeGen/MachineBasicBlock.cpp
llvm/lib/CodeGen/MachineSink.cpp
llvm/test/CodeGen/X86/machinesink-debug-inv-0.mir
|
One issue with this helper is that it needs to iterate over all instructions in the block to count them and the limit is used to decide whether the block is too big to process.
Not sure there's a good alternative, but maybe have something like sizeWIthoutDebugLargerThan(x) so we can at least bail out once the limit is reached.