llvm/test/Transforms/LoopUnswitch/2007-07-12-ExitDomInfo.ll
David Blaikie 5a70dd1d82 [opaque pointer type] Add textual IR support for explicit type parameter to gep operator
Similar to gep (r230786) and load (r230794) changes.

Similar migration script can be used to update test cases, which
successfully migrated all of LLVM and Polly, but about 4 test cases
needed manually changes in Clang.

(this script will read the contents of stdin and massage it into stdout
- wrap it in the 'apply.sh' script shown in previous commits + xargs to
apply it over a large set of test cases)

import fileinput
import sys
import re

rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL)

def conv(match):
  line = match.group(1)
  line += match.group(4)
  line += ", "
  line += match.group(2)
  return line

line = sys.stdin.read()
off = 0
for match in re.finditer(rep, line):
  sys.stdout.write(line[off:match.start()])
  sys.stdout.write(conv(match))
  off = match.end()
sys.stdout.write(line[off:])

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-13 18:20:45 +00:00

46 lines
1.3 KiB
LLVM

; RUN: opt < %s -loop-unswitch -instcombine -disable-output
@str3 = external constant [3 x i8] ; <[3 x i8]*> [#uses=1]
define i32 @stringSearch_Clib(i32 %count) {
entry:
%ttmp25 = icmp sgt i32 %count, 0 ; <i1> [#uses=1]
br i1 %ttmp25, label %bb36.preheader, label %bb44
bb36.preheader: ; preds = %entry
%ttmp33 = icmp slt i32 0, 250 ; <i1> [#uses=1]
br label %bb36.outer
bb36.outer: ; preds = %bb41, %bb36.preheader
br i1 %ttmp33, label %bb.nph, label %bb41
bb.nph: ; preds = %bb36.outer
%ttmp8 = icmp eq i8* null, null ; <i1> [#uses=1]
%ttmp6 = icmp eq i8* null, null ; <i1> [#uses=1]
%tmp31 = call i32 @strcspn( i8* null, i8* getelementptr ([3 x i8], [3 x i8]* @str3, i64 0, i64 0) ) ; <i32> [#uses=1]
br i1 %ttmp8, label %cond_next, label %cond_true
cond_true: ; preds = %bb.nph
ret i32 0
cond_next: ; preds = %bb.nph
br i1 %ttmp6, label %cond_next28, label %cond_true20
cond_true20: ; preds = %cond_next
ret i32 0
cond_next28: ; preds = %cond_next
%tmp33 = add i32 %tmp31, 0 ; <i32> [#uses=1]
br label %bb41
bb41: ; preds = %cond_next28, %bb36.outer
%c.2.lcssa = phi i32 [ 0, %bb36.outer ], [ %tmp33, %cond_next28 ] ; <i32> [#uses=1]
br i1 false, label %bb36.outer, label %bb44
bb44: ; preds = %bb41, %entry
%c.01.1 = phi i32 [ 0, %entry ], [ %c.2.lcssa, %bb41 ] ; <i32> [#uses=1]
ret i32 %c.01.1
}
declare i32 @strcspn(i8*, i8*)