Instruction sink pass tries to sink instructions to the lowest possible point, with an effort
to bring instructions closer to their users. But it does not have heuristic regarding actual
benefit to do so. For example, when you sink an instruction, it may increase the live ranges
of it uses.
We have observe a greaterr than 10% performance benefit on some applications if we completely
turn off this pass. A flag to control this pass will allow us to tune the performance. It will also help us
isolate potential correctness issue that may be introduced from the llvm community.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
I agree with Matt here. You should be able to do experiments locally. Perhaps sinking should be disabled entirely, or perhaps sinking should be improved to take register liveness into account.
Comment Actions
Right, my point of view is that the Sink pass should be re-evaluated. Since it has been introduced into AMDGPU pipeline many years ago, there must have been unexpected dependencies
on this pass.
Local experiments are absolutely necessary, but not sufficient. I propose to introduce a flag which could enable a broad range of experiments (from CQE for example). And then we can make decisions:
- if it is mostly negative, we can disable it completely;
- if it is mostly positive, we can keep it as it is;
- if it it is in the middle, we can make effort to enhance it;
Comment Actions
So everyone can use it. Also,
If my understand is correct, every optimization pass should have an associated flag to turn it on/off.