Skip to content

SimplifyCFG doesn't proerly clean up trivially dead instructions #2712

@efriedma-quic

Description

@efriedma-quic
Bugzilla Link 2340
Resolution FIXED
Resolved on Dec 16, 2008 14:56
Version unspecified
OS Linux
Attachments Testcase, Potential patch
CC @nlewycky

Extended Description

To reproduce: run "opt -simplifycfg" on the attached testcase. Code after simplifycfg:

define i32 @​x(i32 %x) {
entry:
%call = call i32 (...)* @​foo( ) ; [#uses=0]
%cond = icmp eq i32 %x, 9 ; [#uses=0]
%call9 = call i32 (...)* @​bar( ) ; [#uses=0]
ret i32 0
}

The icmp is unused; SimplifyCFG should have eliminated it when it eliminated the branch that used it.

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