This is an archive of the discontinued LLVM Phabricator instance.

[TwoAddressInstructionPass] Improve tryInstructionCommute X86 FMA and vpternlog instructions
ClosedPublic

Authored by craig.topper on Mar 9 2018, 12:50 PM.

Details

Summary

These instructions have 3 operands that can be commuted. The first commute we find may not be the best. So we should keep searching even after we perform a commute.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Mar 9 2018, 12:50 PM

Don't continue search if we found a non-aggressive commute. We don't want an aggressive commute to overwrite it.

v_klochkov accepted this revision.Mar 9 2018, 3:12 PM

Hi Craig,
This change-set looks good to me.
-Vyacheslav

lib/CodeGen/TwoAddressInstructionPass.cpp
1386 ↗(On Diff #137831)

I was looking for some potential problems on the caller side of the routine you changed; have not found anything interesting/wrong there, but noticed this odd line.
If it also seems redundant/nop to you and if you decide removing this line, then I am Ok with that.

This revision is now accepted and ready to land.Mar 9 2018, 3:12 PM
This revision was automatically updated to reflect the committed changes.