[llvm-commits] [PATCH][FastMath, InstCombine] Fadd/Fsub optimizations

Eli Friedman eli.friedman at gmail.com
Mon Dec 17 17:01:19 PST 2012


On Mon, Dec 17, 2012 at 4:55 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
>>By the same logic, why isn't the quota 3 for the case where nothing is
>> multi-use? Or are you concerned about the transformation falling into an
>> infinite loop?
> I only try to optimize "this instruction" along with at most two neighboring
> instructions.
> So the input has at most 3 instr, and the up-bound for the output quota is
> 3-1 = 2.
>
> I don't like to scale this optimization in InstCombine as it supposed to be
> extremely fast.

Have you given any thought to the possibility that the "simplified"
form could be the same as the original instruction?  I don't think
it's possible given the current way you're setting the quotas, but
your code doesn't seem to have any defense against the infinite loop
which would result.

-Eli



More information about the llvm-commits mailing list