This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/32044] [4.3/4.4 Regression] final value replacement too aggressive for e.g. targets with no native div/mod insns
- From: "mmitchel at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Dec 2008 00:42:10 -0000
- Subject: [Bug tree-optimization/32044] [4.3/4.4 Regression] final value replacement too aggressive for e.g. targets with no native div/mod insns
- References: <bug-32044-11706@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #62 from mmitchel at gcc dot gnu dot org 2008-12-11 00:42 -------
I take Zdenek's point about the transformation from division to a loop being
profitable only if x is small. But, that might argue that if we see the loop,
we still transform it into the division form -- but with a note that allows the
value-profiling code to turn it back. The advantage to that is we can then
take advantage of the fact that it's division otherwise; for example, CSE it
with a manually written division, or eliminate it if multiplied by the same
value we divided by, etc.
There are a bunch of issues somewhat tangled up in here. In any case, I am
also concerned about the fact that if the user writes division and modulus
manually, we're not taking advantage of the ABI divmod function. IIUC, it
sounds like we could fix that by having the ARM back end always use the divmod
function as on x86. Is that right?
-- Mark
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32044