This is an archive of the discontinued LLVM Phabricator instance.

[X86][SSE] Disable shouldFoldConstantShiftPairToMask for btver1/btver2 targets (PR40758)
ClosedPublic

Authored by RKSimon on Apr 24 2019, 7:18 AM.

Details

Summary

As detailed on PR40758, Bobcat/Jaguar can perform vector immediate shifts on the same pipes as vector ANDs with the same latency - so it doesn't make sense to replace a shl+lshr with a shift+and pair as it requires an additional mask (with the extra constant pool, loading and register pressure costs).

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon created this revision.Apr 24 2019, 7:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 24 2019, 7:18 AM
spatel added inline comments.Apr 24 2019, 9:45 AM
lib/Target/X86/X86.td
427–430 ↗(On Diff #196446)

Is there a possibility that we would use this for scalar transforms too? If not, better to make this explicitly about vectors:
"FeatureFastVectorShifts" ?

RKSimon marked an inline comment as done.Apr 24 2019, 12:01 PM
RKSimon added inline comments.
lib/Target/X86/X86.td
427–430 ↗(On Diff #196446)

Yes AMD targets at least should benefit from the scalar case as well - I'll investigate.

spatel accepted this revision.Apr 25 2019, 12:36 PM

LGTM

This revision is now accepted and ready to land.Apr 25 2019, 12:36 PM
This revision was automatically updated to reflect the committed changes.