This is an archive of the discontinued LLVM Phabricator instance.

[X86] Provide a separate feature bit for macro fusion support instead of basing it on the AVX flag
ClosedPublic

Authored by craig.topper on Aug 29 2017, 3:59 PM.

Details

Summary

Currently we determine if macro fusion is supported based on the AVX flag as a proxy for the processor being Sandy Bridge".

This is really strange as now AMD supports AVX. It also means if user explicitly disables AVX we disable macro fusion.

This patch adds an explicit macro fusion feature. I've also enabled for the generic 64-bit CPU (which doesn't have AVX)

This is probably another candidate for being in the MI layer, but for now I at least wanted to correct the overloading of the AVX feature.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Aug 29 2017, 3:59 PM
chandlerc edited edge metadata.Aug 29 2017, 6:40 PM

A quick skim of Agner's suggsets that all of Core2, Nehalem, Westmere, Bulldozer, Piledriver, Steamroler, and Zen all do nearly full blown macro fusion for cmp/test and a branch. Even the Via Nana apparently does some of this apparently....

I don't think we should restrict it to SNB. I think we should default it on everywhere we don't have explicit information that it doesn't occur (Silvermont, KNL, Athlon, etc)

Anyways, several of the AMD chips listed support AVX and so this would be a regression there.

Add flag to bdver*, znver1, core2, penryn, nehalem, and westmere.

This revision is now accepted and ready to land.Aug 29 2017, 9:26 PM
This revision was automatically updated to reflect the committed changes.