[PATCH] [x86] add a reassociation optimization to increase ILP via the MachineCombiner pass

Gerolf Hoflehner ghoflehner at apple.com
Mon Jun 8 15:44:35 PDT 2015


I'm also curious about performance numbers.

Cheers
Gerolf


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:6228
@@ +6227,3 @@
+// This logic could be hoisted into the machine combiner pass itself.
+bool X86InstrInfo::hasPattern(MachineInstr &Root,
+        SmallVectorImpl<MachineCombinerPattern::MC_PATTERN> &Pattern) const {
----------------
This function doesn't fit on my screen :-) You could integrate it into the combiner or split it into a) Checking for candidate b) Checking for pattern and c) generating a pattern. You also make a design decision and filter (one)  pattern (vsadd/vsadd/vsadd) while searching. Instead you could separate search and filter. I can see arguments either way, but please document cost model functionality clearly.

================
Comment at: lib/Target/X86/X86InstrInfo.cpp:6400
@@ +6399,3 @@
+
+void X86InstrInfo::genAlternativeCodeSequence(
+    MachineInstr &Root,
----------------
You could implement this with a two-dimensional array (pattern rows, operand columns) and avoid the code bloat.

================
Comment at: lib/Target/X86/X86InstrInfo.h:32
@@ +31,3 @@
+      MC_NONE = 0,
+      MC_REASSOC_1 = 1,
+      MC_REASSOC_2 = 2,
----------------
Can you think of more descriptive names than 1-4? And/or add a comment about the targeted pattern?

http://reviews.llvm.org/D10321

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list