Skip to content

LVI does not resolve condition value in destination blocks of conditional branches #9376

@llvmbot

Description

@llvmbot
Bugzilla Link 9004
Resolution FIXED
Resolved on Nov 21, 2017 04:25
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @fhahn,@nunoplopes

Extended Description

Run "opt -gvn" on the following testcase. It gets that "ret i1 %cond2" returns
false, but it doesn't see that the a priori easier "ret i1 %cond" returns true!

define i1 @​foo(i32 %x) {
%cond = icmp eq i32 %x, 0
br i1 %cond, label %iftrue, label %iffalse
iftrue:
ret i1 %cond
iffalse:
%cond2 = icmp eq i32 %x, 0
ret i1 %cond2
}

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