mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-16 00:33:10 +00:00
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
36 lines
1.4 KiB
LLVM
36 lines
1.4 KiB
LLVM
; RUN: opt -instcombine -S < %s | FileCheck %s
|
|
; Radar 10803727
|
|
@.str = private unnamed_addr constant [35 x i8] c"\0Ain_range input (should be 0): %f\0A\00", align 1
|
|
@.str1 = external hidden unnamed_addr constant [35 x i8], align 1
|
|
|
|
declare i32 @printf(i8*, ...)
|
|
define i64 @_Z8tempCastj(i32 %val) uwtable ssp {
|
|
entry:
|
|
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str1, i64 0, i64 0), i32 %val)
|
|
%conv = uitofp i32 %val to double
|
|
%call.i = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %conv)
|
|
%cmp.i = fcmp oge double %conv, -1.000000e+00
|
|
br i1 %cmp.i, label %land.rhs.i, label %if.end.critedge
|
|
; CHECK: br i1 true, label %land.rhs.i, label %if.end.critedge
|
|
|
|
land.rhs.i: ; preds = %entry
|
|
%cmp1.i = fcmp olt double %conv, 1.000000e+00
|
|
br i1 %cmp1.i, label %if.then, label %if.end
|
|
|
|
if.then: ; preds = %land.rhs.i
|
|
%add = fadd double %conv, 5.000000e-01
|
|
%conv3 = fptosi double %add to i64
|
|
br label %return
|
|
|
|
if.end.critedge: ; preds = %entry
|
|
br label %if.end
|
|
|
|
if.end: ; preds = %if.end.critedge, %land.rhs.i
|
|
br label %return
|
|
|
|
return: ; preds = %if.end, %if.then
|
|
%retval.0 = phi i64 [ %conv3, %if.then ], [ -1, %if.end ]
|
|
ret i64 %retval.0
|
|
}
|
|
|