llvm-6502/test/Other/optimization-remarks-inline.ll
David Blaikie 7c9c6ed761 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction
Essentially the same as the GEP change in r230786.

A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)

import fileinput
import sys
import re

pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")

for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))

Reviewers: rafael, dexonsmith, grosser

Differential Revision: http://reviews.llvm.org/D7649

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 21:17:42 +00:00

41 lines
1.5 KiB
LLVM

; RUN: opt < %s -inline -pass-remarks='inline' -S 2>&1 | FileCheck %s
; RUN: opt < %s -inline -pass-remarks='inl.*' -S 2>&1 | FileCheck %s
; RUN: opt < %s -inline -pass-remarks='vector' -pass-remarks='inl' -S 2>&1 | FileCheck %s
; These two should not yield an inline remark for the same reason.
; In the first command, we only ask for vectorizer remarks, in the
; second one we ask for the inliner, but we then ask for the vectorizer
; (thus overriding the first flag).
; RUN: opt < %s -inline -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s
; RUN: opt < %s -inline -pass-remarks='inl' -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s
; RUN: opt < %s -inline -S 2>&1 | FileCheck --check-prefix=REMARKS %s
; RUN: not opt < %s -pass-remarks='(' 2>&1 | FileCheck --check-prefix=BAD-REGEXP %s
define i32 @foo(i32 %x, i32 %y) #0 {
entry:
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
store i32 %x, i32* %x.addr, align 4
store i32 %y, i32* %y.addr, align 4
%0 = load i32, i32* %x.addr, align 4
%1 = load i32, i32* %y.addr, align 4
%add = add nsw i32 %0, %1
ret i32 %add
}
define i32 @bar(i32 %j) #0 {
entry:
%j.addr = alloca i32, align 4
store i32 %j, i32* %j.addr, align 4
%0 = load i32, i32* %j.addr, align 4
%1 = load i32, i32* %j.addr, align 4
%sub = sub nsw i32 %1, 2
%call = call i32 @foo(i32 %0, i32 %sub)
; CHECK: foo inlined into bar
; REMARKS-NOT: foo inlined into bar
ret i32 %call
}
; BAD-REGEXP: Invalid regular expression '(' in -pass-remarks: