This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] loop invariant motion expensive codes
>>>>> Jeffrey A Law writes:
Jeff> First, to move the divide you must be sure the division will always
Jeff> execute in its original position. Otherwise you can introduce a
Jeff> spurious divide by zero fault.
Jeff> We have also avoided hoisting division operations in the past as
Jeff> doing so changes the point at which a divide by zero fault will
Jeff> occur.
This patch does not change whether the optimization can or does
hoist a FP divide. The loop invariant motion pass tests the safety of the
motion elsewhere. The pass has a cost model and the patch makes the cost
model consistent for all types of divides.
David