Skip to content

[GVN] GVN/Fix rle-no-phi-translate.ll #149998

@madhur13490

Description

@madhur13490
; FIXME: This should be promotable, but memdep/gvn don't track values
; path/edge sensitively enough.

define i32 @g(ptr %b, ptr %c) nounwind {
entry:
        store i32 1, ptr %b
        store i32 2, ptr %c
        
	%t1 = icmp eq ptr %b, null		
	br i1 %t1, label %bb, label %bb2

bb:		
	br label %bb2

bb2:		
	%c_addr.0 = phi ptr [ %b, %entry ], [ %c, %bb ]		
	%cv = load i32, ptr %c_addr.0, align 4		
	ret i32 %cv
}

godbolt: https://godbolt.org/z/6PE1MqaYM

This test is marked as XFAIL. It expects no load at the end and return 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions