[llvm] r305245 - Inliner: Don't remove calls to readnone+nounwind (but not always_inline) functions in the AlwaysInliner

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 17 13:23:45 PDT 2017


Hi,

On Fri, Jun 16, 2017 at 8:47 AM, Björn Pettersson A via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> What I noticed was that AddReachableCodeToWorklist (in
> InstructionCombining.cpp) does not always set MadeIRChange = true even if
> optimisations are done.
>
> This happens at least for the
>
>       // DCE instruction if trivially dead.
>
> and the
>
>       // ConstantProp instruction if trivially constant.
>
> optimisations.
>
> If I add
>
>   MadeIRChange = true;
>
> when doing those optimisations, then the CGPassManager will set
> CallGraphUpToDate = false, and later refresh the CallGraph if needed again.
>
> So with such a modification to AddReachableCodeToWorklist we no longer get
> the assert.
>
> I can prepare a patch for this next week if it sounds reasonable (and no one
> else is faster than me… my work week has actually ended already..).

Yes, it sounds like you're on the right track -- changing the IR and
pretending that the IR was not changed is definitely a bug in
InstCombine.

Thanks!
-- Sanjoy


More information about the llvm-commits mailing list