[LLVMdev] Enabling the vectorizer for -Os
Owen Anderson
resistor at mac.com
Wed Jun 5 23:00:12 PDT 2013
On Jun 5, 2013, at 7:31 PM, Jeffrey Yasskin <jyasskin at googlers.com> wrote:
> On Wed, Jun 5, 2013 at 5:51 PM, Nadav Rotem <nrotem at apple.com> wrote:
>> Hi,
>>
>> Thanks for the feedback. I think that we agree that vectorization on -Os
>> can benefit many programs. Regarding -O2 vs -O3, maybe we should set a
>> higher cost threshold for O2 to increase the likelihood of improving the
>> performance ? We have very few regressions on -O3 as is and with better
>> cost models I believe that we can bring them close to zero, so I am not sure
>> if it can help that much. Renato, I prefer not to estimate the encoding
>> size of instructions. We know that vector instructions take more space to
>> encode. Will knowing the exact number help us in making a better decision ?
>> I don’t think so. On modern processors when running vectorizable loops, the
>> code size of the vector instructions is almost never the bottleneck.
>
> You're talking about -Os, where the user has explicitly asked the
> compiler to optimize the code size. Saying that the code size isn't a
> speed bottleneck seems to miss the point.
I'm not sure that's a fair characterization. In Xcode, for example, -Os is the default setting.
My understanding is that -Os is intended to be optimized-without-sacrificing-code-size. -Oz is where we've being explicitly mandated to prefer code size to all else.
--Owen
More information about the llvm-dev
mailing list