This function improves the mul instruction combine function (combineMul)
by adding new layer of logic.
In this patch, we are adding the ability to fold (mul x, -((1 << c) -1))
or (mul x, -((1 << c) +1)) into (neg(X << c) -x) or (neg((x << c) + x) respective.
Details
Diff Detail
Event Timeline
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
28880 | does NumSign * SignMulAmt == MulAmt, or i missing something ? | |
28888 | this is common code for the both cases . can we put it after if/else ? | |
test/CodeGen/X86/imul.ll | ||
175 | Sorry, i can't understand the test output. Could you please auto-generate the CHECKS ? |
lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
28880 | Yes mine is sext will the MulAmt is zext |
How did this get merged without any performance data? It isn't obvious this is a good idea.
Hi Eli,
We tested the patch with internal performance tests.
If you have test/suite/benchmark that my patch bring down, please share them with me.
Regards,
Michael Zuckerman
I don't have any specific issue with this patch (I don't do x86 benchmarking), but it would be a good idea to have some sort of record of what this is actually improving; if someone revisits this code in the future, they won't have access to Intel-internal benchmark numbers.
does NumSign * SignMulAmt == MulAmt, or i missing something ?