1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple arm-eabi -mcpu swift -verify-machineinstrs %s -o /dev/null 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Workerdeclare i32 @f(i32 %p0, i32 %p1) 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Workerdefine i32 @foo(i32* %ptr) { 6*9880d681SAndroid Build Coastguard Workerentry: 7*9880d681SAndroid Build Coastguard Worker %cmp = icmp ne i32* %ptr, null 8*9880d681SAndroid Build Coastguard Worker br i1 %cmp, label %if.then, label %if.else 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Worker; present something which can be easily if-converted 11*9880d681SAndroid Build Coastguard Workerif.then: 12*9880d681SAndroid Build Coastguard Worker ; %R0 should be killed here 13*9880d681SAndroid Build Coastguard Worker %valt = load i32, i32* %ptr, align 4 14*9880d681SAndroid Build Coastguard Worker br label %return 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Workerif.else: 17*9880d681SAndroid Build Coastguard Worker ; %R0 should be killed here, however after if-conversion the %R0 kill 18*9880d681SAndroid Build Coastguard Worker ; has to be removed because if.then will follow after this and still 19*9880d681SAndroid Build Coastguard Worker ; read it. 20*9880d681SAndroid Build Coastguard Worker %addr = getelementptr inbounds i32, i32* %ptr, i32 4 21*9880d681SAndroid Build Coastguard Worker %vale = load i32, i32* %addr, align 4 22*9880d681SAndroid Build Coastguard Worker br label %return 23*9880d681SAndroid Build Coastguard Worker 24*9880d681SAndroid Build Coastguard Workerreturn: 25*9880d681SAndroid Build Coastguard Worker %phival = phi i32 [ %valt, %if.then ], [ %vale, %if.else ] 26*9880d681SAndroid Build Coastguard Worker ; suggest to bring %phival/%valt/%vale into %R1 (because otherwise there 27*9880d681SAndroid Build Coastguard Worker ; will be no kills in if.then/if.else) 28*9880d681SAndroid Build Coastguard Worker %retval = call i32 @f (i32 0, i32 %phival) 29*9880d681SAndroid Build Coastguard Worker ret i32 %retval 30*9880d681SAndroid Build Coastguard Worker} 31