[Hexagon] Restrict compound instructions with constant value.
ClosedPublic

Authored by sgundapa on Thu, Oct 11, 11:10 AM.

Details

Summary

Having a constant value operand in the compound instruction
is not always profitable. This patch improves coremark by ~4% on
Hexagon.

Diff Detail

Repository
rL LLVM
sgundapa created this revision.Thu, Oct 11, 11:10 AM
kparzysz added inline comments.Thu, Oct 11, 11:57 AM
lib/Target/Hexagon/HexagonPatterns.td
262 ↗(On Diff #169257)

Those are not the instructions you're trying to avoid.

268 ↗(On Diff #169257)

Please change the name to something shorter, e.g. Su_ni, or Su_ni1 to indicate that it only checks operand(1).

test/CodeGen/Hexagon/constant_compound.ll
19 ↗(On Diff #169257)

Please run -instnamer on this testcase.

50 ↗(On Diff #169257)

Please remove all attributes except nounwind, readnone, and target-cpu/target-features. Remove -long-calls from target-features.

sgundapa marked 3 inline comments as done.Thu, Oct 11, 12:32 PM
sgundapa added inline comments.
lib/Target/Hexagon/HexagonPatterns.td
262 ↗(On Diff #169257)

You are correct. These are the instructions, that need to be avoided.
M4_and_and, M4_and_or,M4_or_and,M4_or_or,M4_xor_and,M4_xor_or

sgundapa updated this revision to Diff 169274.Thu, Oct 11, 12:34 PM
kparzysz accepted this revision.Thu, Oct 11, 12:36 PM
kparzysz added inline comments.
lib/Target/Hexagon/HexagonPatterns.td
1363 ↗(On Diff #169274)

Please fix the indentation before committing.

This revision is now accepted and ready to land.Thu, Oct 11, 12:36 PM
This revision was automatically updated to reflect the committed changes.