llvm-6502/test/CodeGen/R600/schedule-if-2.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

95 lines
3.8 KiB
LLVM

;RUN: llc < %s -march=r600 -mcpu=cayman -stress-sched -verify-misched -verify-machineinstrs
;REQUIRES: asserts
define void @main() {
main_body:
%0 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 2)
%1 = extractelement <4 x float> %0, i32 0
%2 = fadd float 1.000000e+03, %1
%3 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
%4 = extractelement <4 x float> %3, i32 0
%5 = bitcast float %4 to i32
%6 = icmp eq i32 %5, 0
%7 = sext i1 %6 to i32
%8 = bitcast i32 %7 to float
%9 = bitcast float %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %IF, label %ELSE
IF: ; preds = %main_body
%11 = call float @fabs(float %2)
%12 = fcmp ueq float %11, 0x7FF0000000000000
%13 = select i1 %12, float 1.000000e+00, float 0.000000e+00
%14 = fsub float -0.000000e+00, %13
%15 = fptosi float %14 to i32
%16 = bitcast i32 %15 to float
%17 = bitcast float %16 to i32
%18 = icmp ne i32 %17, 0
%. = select i1 %18, float 0x36A0000000000000, float 0.000000e+00
%19 = fcmp une float %2, %2
%20 = select i1 %19, float 1.000000e+00, float 0.000000e+00
%21 = fsub float -0.000000e+00, %20
%22 = fptosi float %21 to i32
%23 = bitcast i32 %22 to float
%24 = bitcast float %23 to i32
%25 = icmp ne i32 %24, 0
%temp8.0 = select i1 %25, float 0x36A0000000000000, float 0.000000e+00
%26 = bitcast float %. to i32
%27 = sitofp i32 %26 to float
%28 = bitcast float %temp8.0 to i32
%29 = sitofp i32 %28 to float
%30 = fcmp ugt float %2, 0.000000e+00
%31 = select i1 %30, float 1.000000e+00, float %2
%32 = fcmp uge float %31, 0.000000e+00
%33 = select i1 %32, float %31, float -1.000000e+00
%34 = fadd float %33, 1.000000e+00
%35 = fmul float %34, 5.000000e-01
br label %ENDIF
ELSE: ; preds = %main_body
%36 = load <4 x float>, <4 x float> addrspace(8)* getelementptr ([1024 x <4 x float>], [1024 x <4 x float>] addrspace(8)* null, i64 0, i32 1)
%37 = extractelement <4 x float> %36, i32 0
%38 = bitcast float %37 to i32
%39 = icmp eq i32 %38, 1
%40 = sext i1 %39 to i32
%41 = bitcast i32 %40 to float
%42 = bitcast float %41 to i32
%43 = icmp ne i32 %42, 0
br i1 %43, label %IF23, label %ENDIF
ENDIF: ; preds = %IF23, %ELSE, %IF
%temp4.0 = phi float [ %2, %IF ], [ %56, %IF23 ], [ 0.000000e+00, %ELSE ]
%temp5.0 = phi float [ %27, %IF ], [ %60, %IF23 ], [ 0.000000e+00, %ELSE ]
%temp6.0 = phi float [ %29, %IF ], [ 0.000000e+00, %ELSE ], [ 0.000000e+00, %IF23 ]
%temp7.0 = phi float [ %35, %IF ], [ 0.000000e+00, %ELSE ], [ 0.000000e+00, %IF23 ]
%44 = insertelement <4 x float> undef, float %temp4.0, i32 0
%45 = insertelement <4 x float> %44, float %temp5.0, i32 1
%46 = insertelement <4 x float> %45, float %temp6.0, i32 2
%47 = insertelement <4 x float> %46, float %temp7.0, i32 3
call void @llvm.R600.store.swizzle(<4 x float> %47, i32 0, i32 0)
ret void
IF23: ; preds = %ELSE
%48 = fcmp ult float 0.000000e+00, %2
%49 = select i1 %48, float 1.000000e+00, float 0.000000e+00
%50 = fsub float -0.000000e+00, %49
%51 = fptosi float %50 to i32
%52 = bitcast i32 %51 to float
%53 = bitcast float %52 to i32
%54 = icmp ne i32 %53, 0
%.28 = select i1 %54, float 0x36A0000000000000, float 0.000000e+00
%55 = bitcast float %.28 to i32
%56 = sitofp i32 %55 to float
%57 = load <4 x float>, <4 x float> addrspace(8)* null
%58 = extractelement <4 x float> %57, i32 0
%59 = fsub float -0.000000e+00, %58
%60 = fadd float %2, %59
br label %ENDIF
}
declare float @fabs(float) #0
declare void @llvm.R600.store.swizzle(<4 x float>, i32, i32)
attributes #0 = { readonly }