LDC 1.5-1.6 huge degradation of optimization

Igor Shirkalin mathsoft at inbox.ru
Thu Nov 30 15:25:31 UTC 2017


On Monday, 27 November 2017 at 13:21:04 UTC, kinke wrote:
> On Monday, 27 November 2017 at 10:41:44 UTC, Igor Shirkalin 
> wrote:
>> Hello!
>>
>> I have found that LDC1.5-1.6 generate unoptimized code in 
>> contrast to LDC1.3-1.4 in some cases. I tried to extract the 
>> example and make it as short as possible. The goal is to get 
>> the compiled code with avx(2) instructions.
>
> LDC 1.5 and 1.6 both come with LLVM 5.0.0, so it looks as if 
> this is an LLVM regression.
> This can be shown by compiling to unoptimized textual LLVM IR 
> (that's the LLVM IR LDC generates, before LLVM optimizations) 
> and comparing it across LDC versions. I did that for LDC 1.4 
> and 1.6, and the relevant IR is identical:
>
> ldc2-1.4.0-win64-msvc\bin\ldc2 -release -output-ll perf.d 
> -of=perf_1.4.ll
> ldc2-1.6.0-win64-msvc\bin\ldc2 -release -output-ll perf.d 
> -of=perf_1.6.ll
> <compare files perf_1.4.ll and perf_1.6.ll>

It's now obvious the reason of this regression is LLVM 5.0.0
Does it mean it's not time to move to latest LLVM for the latest 
LDC?



More information about the digitalmars-d-ldc mailing list