[PATCH] Prefer small negative constants in InstCombine

Tim Northover t.p.northover at gmail.com
Tue Jul 2 05:29:49 PDT 2013


> This seems like a big change that could affect all sorts of optimizations;
> I'd like to see performance numbers from the nightly test suite.

Just an update, it turned out to be a terrible idea. Linpack got 66% worse.

Which leaves me Michael's suggestion:

> If this is disruptive to other architectures/optimizations in the middle end, perhaps you can use a dagcombine to do this. You would check for movabsq, see if it is being piped into an add, and if that is true fix it up.

Trouble is, in general that's invalid. It's only correct because that
add then goes into a shfit and then a truncate. Oh well, hopefully
something will work.

Tim.



More information about the llvm-commits mailing list