getLatency() was considering only the first use when computing operand
latency. Fix this.
Details
- Reviewers
spatel dexonsmith asi-sc barannikov88
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This will still work because virtual registers cannot be implicit operands, and there is a check for virtualness above.
Still, using defs and uses should be avoided because they have unexpected behavior.
I hope they can be removed someday and then reimplemented correctly w.r.t. implicit operands.
Shouldn't there be any test changes?
I'm not familiar with this pass and can't help with further review.
llvm/lib/CodeGen/MachineCombiner.cpp | ||
---|---|---|
286 | (Assuming iterating over all uses is necessary.) |
Address review comments. There are no test changes, but Embench shows a minor improvement in one test.
Can this test be reduced and added to the review? I'm afraid this can't proceed without test coverage.
llvm/lib/CodeGen/MachineCombiner.cpp | ||
---|---|---|
286 | This now gets the operand number of the defining instruction. We need the operand number of the using instruction here; it is likely to be different. |
I just re-verified, and there are no benchmark changes either. I'm not sure how to cook up a test for this change.
This change is not correct. MI->uses() is misnomer, it returns everything apart explicit defs. I.e. it returns explicit uses, implicit uses, and implicit defs.