31 lines · plain
1; RUN: llc -mtriple arm-eabi -mcpu swift -verify-machineinstrs %s -o /dev/null2 3declare i32 @f(i32 %p0, i32 %p1)4 5define i32 @foo(ptr %ptr) {6entry:7 %cmp = icmp ne ptr %ptr, null8 br i1 %cmp, label %if.then, label %if.else9 10; present something which can be easily if-converted11if.then:12 ; %R0 should be killed here13 %valt = load i32, ptr %ptr, align 414 br label %return15 16if.else:17 ; %R0 should be killed here, however after if-conversion the %R0 kill18 ; has to be removed because if.then will follow after this and still19 ; read it.20 %addr = getelementptr inbounds i32, ptr %ptr, i32 421 %vale = load i32, ptr %addr, align 422 br label %return23 24return:25 %phival = phi i32 [ %valt, %if.then ], [ %vale, %if.else ]26 ; suggest to bring %phival/%valt/%vale into %R1 (because otherwise there27 ; will be no kills in if.then/if.else)28 %retval = call i32 @f (i32 0, i32 %phival)29 ret i32 %retval30}31