range-analysis icon indicating copy to clipboard operation
range-analysis copied to clipboard

Missing range discovery for `select`

Open dcci opened this issue 7 years ago • 0 comments

define i32 @test1(i1 %C)  {
        br i1 %C, label %exit, label %body

body:
        %A = select i1 %C, i32 10, i32 11
        ret i32 %A

exit:
        ret i32 10
}

Not sure how hard would it be to get this working, but this is a pattern that appears sorely often in LLVM. Here:

        %A = select i1 %C, i32 10, i32 11

%C is clearly zero so the range of %A is [11;11].

dcci avatar May 29 '17 01:05 dcci