This is an archive of the discontinued LLVM Phabricator instance.

RFC: Use data deps for schedule barrier; Only look at data deps in MacroFusion
Needs ReviewPublic

Authored by MatzeB on Oct 7 2021, 10:21 AM.

Details

Summary

ScheduleDAGInstrs used to use artifical edges between the barrier instruction and its predecessor instead. While this makes sense for live-out values that aren't actually used right away I don't see a good reason to do that for the uses in the instruction itself. This changes the code to use Data dependencies.

It also changes MacroFusion code to exclusively look at data dependencies.

Diff Detail

Event Timeline

MatzeB created this revision.Oct 7 2021, 10:21 AM
MatzeB requested review of this revision.Oct 7 2021, 10:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2021, 10:21 AM

Putting this up for discussion. Seems to be the right thing to me, but unfortunately comes with a lot of test churn, as-is it only fixed the X86+AArch64 tests that could be fixed automatically via update_llc_test_checks.py, to actually land this requires more work to review and fix tests for all targets. I am not sure I will be able to get that at the moment :-/

The -1 is introduced here: https://github.com/llvm/llvm-project/commit/ae53561b0c6e908c4fcda40043517605f9f814a2 so it may be possible that this is indeed an accident and was incorrectly just using the same thing in line 212 as 228 by accident...

Unfortunately the benchmarking I have downstream doesn't suggest this is a great idea. Nothing gets a lot worse, but a lot of things get a little worse.

These are mostly for small in-order cores like the cortex-m55. I haven't looked deeply into why. There is a chance our downstream schedules are just getting unlucky.