[LLVMdev] clang -O2 versus opt -O2 | llc | clang

Tim Northover t.p.northover at gmail.com
Fri May 23 13:01:34 PDT 2014


>> > It doesn't, but the backend can by overriding
>> > TTI::getUnrollingPreferences
>> > or setting LoopMicroOpBufferSize in the processor scheduling model.
>>
>> I don't think that explains what I'm seeing either: only PPC and R600
>> seem to mention that function. All code I'm compiling is x86_64.
>
> You missed my "or" :-) -- The x86_64 processor models (for Haswell, Sandy Bridge,
> etc.) do set LoopMicroOpBufferSize and will runtime unroll small loops.

Ah, that does explain it: "opt -mtriple=x86_64-linux-gnu -mcpu=core-i7
-unroll-loops" at least does it.

Thanks Hal!

Tim.



More information about the llvm-dev mailing list