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