File: hoist-common.ll

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (38 lines) | stat: -rw-r--r-- 1,105 bytes parent folder | download | duplicates (33)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
; RUN: llc < %s -mtriple=x86_64-apple-macosx  | FileCheck %s
; This is supposed to be testing BranchFolding's common
; code hoisting logic, but has been erroneously passing due
; to there being a redundant xorl in the entry block
; and no common code to hoist.
; However, now that MachineSink sinks the redundant xor
; hoist-common looks at it and rejects it for hoisting,
; which causes this test to fail.
; Since it seems this test is broken, marking XFAIL for now
; until someone decides to remove it or fix what it tests.
; XFAIL: *

; Common "xorb al, al" instruction in the two successor blocks should be
; moved to the entry block above the test + je.

; rdar://9145558

define zeroext i1 @t(i32 %c) nounwind ssp {
entry:
; CHECK-LABEL: t:
; CHECK: xorl %eax, %eax
; CHECK: test
; CHECK: je
  %tobool = icmp eq i32 %c, 0
  br i1 %tobool, label %return, label %if.then

if.then:
; CHECK: callq
  %call = tail call zeroext i1 (...) @foo() nounwind
  br label %return

return:
; CHECK: ret
  %retval.0 = phi i1 [ %call, %if.then ], [ false, %entry ]
  ret i1 %retval.0
}

declare zeroext i1 @foo(...)