Expected constant simplification not happening

Hi

the appended IR code does not optimize to my liking :slight_smile:

this is the interesting part in x86_64, that got produced via clang -Os:

[cc’ing Zia]

We have this transform with -Os for some cases after:
http://reviews.llvm.org/rL244601
http://reviews.llvm.org/D11363

but something in this example is causing the transform to not trigger.

I filed a related bug here:
https://llvm.org/bugs/show_bug.cgi?id=24448

If you can file your test case(s) in a bug report, that would be the best way to track progress on solving it. Thanks!

I took a quick look at this and relaxed the conditions under which we prevent immediate subsumption (specifically, optsize and instruction shape), and I managed to merge 2 of those immediates. I need to dig in a little more to see why it didn’t catch the third. I suspect a phase ordering issue.

I’ll take a closer look at this as soon as I get a chance. If you could please attach a testcase to the bug report, I’d appreciate it.

Thanks,

Zia.

Hello

Has there been any progress on this topic ? The 3.9 optimizer output is still the same as I just looked.

https://llvm.org/bugs/show_bug.cgi?id=24448

Ciao
    Nat!

Sanjay Patel schrieb:

AFAIK, there haven’t been any changes in this area. It’s in my bug queue (that only seem to get longer!), but I don’t have immediate plans to look at it.