Skip to content

IndVars creates an invalid phi node after r367485 #45180

@llvmbot

Description

@llvmbot
Bugzilla Link 45835
Resolution FIXED
Resolved on Jun 17, 2020 15:42
Version trunk
OS Windows NT
Blocks #44654
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic,@fhahn,@froydnj,@LebedevRI,@preames,@nikic,@tstellar
Fixed by commit(s) b2df961 4d0626a

Extended Description

https://godbolt.org/z/Me95yj

After r367485/llvmorg-10-init-991-gf8e7b536571, this phi node:
%a.mux.lcssa4 = phi i8* [ %a.mux, %switch.early.test.i ], [ %a.mux, %switch.early.test.i ], [ %a.mux, %cond.end ]

becomes
%a.mux.lcssa4 = phi i8* [ %a.mux, %switch.early.test.i ], [ %scevgep, %switch.early.test.i ], [ %scevgep, %cond.end ]

which has two different values for %switch.early.test.i.

This started out as an investigation of a clang hang in LICM (full repro available on request) but this phi node is the first place that the verifier started complaining, so I assume the rest is GIGO from there.

The bad phi is no longer seen after llvmorg-11-init-4213-gd6f47aeb519, but as that is a cost model patch, I assume it's not really a fix but just an avoidance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions