[llvm-commits] [llvm] r170226 - in /llvm/trunk: lib/Transforms/InstCombine/InstCombineMulDivRem.cpp test/Transforms/InstCombine/fast-math.ll
Shuxin Yang
shuxin.llvm at gmail.com
Mon Dec 17 17:19:56 PST 2012
I justed check SimplifyFmulInst(). It does nothing but
1. constant folding
2. x * 1.0 => x.
3. x + 0 = > x.
If the general optimization is really what we crave, I think we better
off implementing another rule for
the sake of cost:
C1 * cond ? C2 : C3
On 12/17/12 5:00 PM, Michael Ilseman wrote:
> On Dec 17, 2012, at 4:57 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>
>> On Mon, Dec 17, 2012 at 4:51 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
>>> In order to optimize that way, I need to create instruction "I = X * A"
>>> first. (Maybe I need to create a dummy instruction
>>> to use this instruction as well), then go ahead call SimplifyFMul(). Often
>>> time, if fails, I have to toss away the instruction
>>> I just created.
>> The signature is:
>>
>> Value *SimplifyFMulInst(Value *LHS, Value *RHS,
>> FastMathFlags FMF,
>> const DataLayout *TD = 0,
>> const TargetLibraryInfo *TLI = 0,
>> const DominatorTree *DT = 0);
>>
>> No Instruction* required.
>>
> As Eli mentioned, this is why those APIs are so convenient!
>
>> -Eli
More information about the llvm-commits
mailing list