This adds a BranchFusion feature to replace the usage of the MacroFusion
for AMD CPUs.
See D59688 for context.
Paths
| Differential D59872
[X86MacroFusion] Handle branch fusion (AMD CPUs). ClosedPublic Authored by courbet on Mar 27 2019, 4:44 AM.
Details Summary This adds a BranchFusion feature to replace the usage of the MacroFusion See D59688 for context.
Diff Detail
Event TimelineComment Actions Looks good.
Comment Actions Update comment, swap features.
lebedev.ri marked an inline comment as done. Comment ActionsLooks good to me, but please wait a bit for @andreadb.
This revision is now accepted and ready to land.Mar 27 2019, 11:13 AM Comment Actions Macro-op fusion on Intel processors is essentially a form branch fusion. What if in future Intel/AMD processors decide to further expand the set of opcodes that are subject to macro-op fusion? If we adopt this approach, then we end up with even more feature flags. whether that is acceptable or not is often a matter of tastes. It may not be a problem for now (we only have two flags). However, we should really look into a tablegen-driven approach. For example, every scheduling model could declare the set of opcodes that can be fused with branches. Note that we can already do something like that today if we use STIPRedicateDecl and STIPredicate definitions via tablegen (with the advantage that the information is also accessible at the MC layer - and tools like mca could use it..). In case I can help you with how to write those STIPredicate. But for the short term, I think this patch is fine. -Andrea courbet marked 7 inline comments as done. Comment ActionsAddress review comments, rebase.
Closed by commit rL357171: [X86MacroFusion] Handle branch fusion (AMD CPUs). (authored by courbet). · Explain WhyMar 28 2019, 7:12 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 192425 llvm/lib/Target/X86/X86.td
llvm/lib/Target/X86/X86MacroFusion.cpp
llvm/lib/Target/X86/X86Subtarget.h
llvm/lib/Target/X86/X86TargetTransformInfo.h
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Transforms/LoopStrengthReduce/X86/macro-fuse-cmp.ll
|