This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/27855] reassociation pass produces ~30% slower matrix multiplication code
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Jun 2006 02:38:33 -0000
- Subject: [Bug target/27855] reassociation pass produces ~30% slower matrix multiplication code
- References: <bug-27855-1649@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from pinskia at gcc dot gnu dot org 2006-06-03 02:38 -------
What reassociation is doing is "scheduling" the instructions further down
before the use but it exands the life time of some variables.
e.g.:
D.1563_59 = rA0_49 * rB0_50;
rC0_0_60 = D.1563_59 + rC0_0_516;
D.1564_61 = rA1_52 * rB0_50;
rC1_0_62 = D.1564_61 + rC1_0_517;
D.1565_63 = rA2_54 * rB0_50;
rC2_0_64 = D.1565_63 + rC2_0_518;
D.1566_65 = rA3_56 * rB0_50;
rC3_0_66 = D.1566_65 + rC3_0_519;
D.1567_67 = rA4_58 * rB0_50;
rC4_0_68 = D.1567_67 + rC4_0_520;
into:
D.1563_59 = rB0_50 * rA0_49;
D.1564_61 = rA1_52 * rB0_50;
D.1565_63 = rA2_54 * rB0_50;
D.1566_65 = rA3_56 * rB0_50;
D.1567_67 = rA4_58 * rB0_50;
..... (with loads, etc here)
D.1563_477 = rB0_468 * rA0_466;
rC0_0_60 = D.1563_59 + rC0_0_516;
rC0_0_82 = rC0_0_60 + D.1563_81;
rC0_0_104 = rC0_0_82 + D.1563_103;
rC0_0_126 = rC0_0_104 + D.1563_125;
rC0_0_148 = rC0_0_126 + D.1563_147;
rC0_0_170 = rC0_0_148 + D.1563_169;
rC0_0_192 = rC0_0_170 + D.1563_191;
rC0_0_214 = rC0_0_192 + D.1563_213;
rC0_0_236 = rC0_0_214 + D.1563_235;
rC0_0_258 = rC0_0_236 + D.1563_257;
rC0_0_280 = rC0_0_258 + D.1563_279;
rC0_0_302 = rC0_0_280 + D.1563_301;
rC0_0_324 = rC0_0_302 + D.1563_323;
rC0_0_346 = rC0_0_324 + D.1563_345;
rC0_0_368 = rC0_0_346 + D.1563_367;
rC0_0_390 = rC0_0_368 + D.1563_389;
rC0_0_412 = rC0_0_390 + D.1563_411;
rC0_0_434 = rC0_0_412 + D.1563_433;
rC0_0_456 = rC0_0_434 + D.1563_455;
rC0_0_478 = rC0_0_456 + D.1563_477;
Which in of itself not supressing and not nothing which reassociate should
handle special. This is what we get with a semi bad register allocation which
does nothing to reduce spilling.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27855