17 lines · plain
1; RUN: opt < %s -passes=instcombine -S | grep load | count 32; PR24713 4declare i32 @x(ptr)5define i32 @b(ptr %a, ptr %b) {6entry:7 %tmp1 = load i32, ptr %a 8 %tmp3 = load i32, ptr %b 9 %add = add i32 %tmp1, %tmp3 10 %call = call i32 @x( ptr %a )11 %tobool = icmp ne i32 %add, 012 ; not safe to turn into an uncond load13 %cond = select i1 %tobool, ptr %b, ptr %a 14 %tmp8 = load i32, ptr %cond 15 ret i32 %tmp816}17