Compile time regression after #154336
https://github.com/llvm/llvm-project/pull/154336 causes some drastic compile time regressions for AMDGPU. In one real world case compilation time jumped from a fraction of second to over 1 hour, where most of the time is spent in the instcombine. Here's the simplified reproducer repro.txt:
$ time ./opt_fail -passes="instcombine" -disable-output repro.txt
real 0m3,221s user 0m3,208s sys 0m0,013s
$ time ./opt_pass -passes="instcombine" -disable-output repro.txt
real 0m0,017s user 0m0,008s sys 0m0,009s
FYI @nikic
@nikic Would you like any assistance in resolving this, or do you have any thoughts on what might be causing the issue?
This is actually a correctness issues for us, because the compilation time increase is so dramatic that it causes TDR problems in real games. We had to revert the problematic commit downstream temporarily.
cc @c-rhodes this is probably related to the issues discussed in https://github.com/llvm/llvm-project/pull/157678. I just tried https://github.com/llvm/llvm-project/pull/171435 with this repro, and it drops the time from 1.5s to 0.03s.
#171435 is causing compile-time issues as well (see https://github.com/dtcxzyw/llvm-opt-benchmark/pull/3129), I just threw that together this morning whilst picking the freeze work back up and was surprised the tests passed so posted a draft PR so I could try it on @dtcxzyw's infra. The smallest is https://github.com/dtcxzyw/llvm-opt-benchmark/blob/main/bench/ffmpeg/original/avc.ll which I reduced to https://godbolt.org/z/6Gx58GfK1, but have not had chance to look at it properly yet as I got pulled into something else this afternoon.
I'd probably need your help to turn it around quickly if we want it as a fix for this
#171435 is causing compile-time issues as well (see dtcxzyw/llvm-opt-benchmark#3129), I just threw that together this morning whilst picking the freeze work back up and was surprised the tests passed so posted a draft PR so I could try it on @dtcxzyw's infra. The smallest is https://github.com/dtcxzyw/llvm-opt-benchmark/blob/main/bench/ffmpeg/original/avc.ll which I reduced to https://godbolt.org/z/6Gx58GfK1, but have not had chance to look at it properly yet as I got pulled into something else this afternoon.
I'd probably need your help to turn it around quickly if we want it as a fix for this
@c-rhodes I am sorry to tell you the computational resource in my CI is shared by my experiment about the automated program repair of LLVM (will be completed before this weekend). So the timeout failures may be flaky :( Can you reproduce it locally?
#171435 is causing compile-time issues as well (see dtcxzyw/llvm-opt-benchmark#3129), I just threw that together this morning whilst picking the freeze work back up and was surprised the tests passed so posted a draft PR so I could try it on @dtcxzyw's infra. The smallest is https://github.com/dtcxzyw/llvm-opt-benchmark/blob/main/bench/ffmpeg/original/avc.ll which I reduced to https://godbolt.org/z/6Gx58GfK1, but have not had chance to look at it properly yet as I got pulled into something else this afternoon. I'd probably need your help to turn it around quickly if we want it as a fix for this
@c-rhodes I am sorry to tell you the computational resource in my CI is shared by my experiment about the automated program repair of LLVM (will be completed before this weekend). So the timeout failures may be flaky :( Can you reproduce it locally?
I can reproduce it locally yes, I think it's genuine and not because of your CI resources
@c-rhodes was there a reason why #171435 was closed, given it seemed to help with this?
@c-rhodes was there a reason why #171435 was closed, given it seemed to help with this?
there's more context here: https://github.com/llvm/llvm-project/pull/157678#discussion_r2627806533
but in short, I don't have much experience with instcombine and this particular code is quite tricky, I tried a few things but couldn't get it to work.
Thanks for the revert - closing.