Skip to content

Commit

Permalink
[opaque pointer type] Add textual IR support for explicit type parame…
Browse files Browse the repository at this point in the history
…ter to the call instruction

See r230786 and r230794 for similar changes to gep and load
respectively.

Call is a bit different because it often doesn't have a single explicit
type - usually the type is deduced from the arguments, and just the
return type is explicit. In those cases there's no need to change the
IR.

When that's not the case, the IR usually contains the pointer type of
the first operand - but since typed pointers are going away, that
representation is insufficient so I'm just stripping the "pointerness"
of the explicit type away.

This does make the IR a bit weird - it /sort of/ reads like the type of
the first operand: "call void () %x(" but %x is actually of type "void
()*" and will eventually be just of type "ptr". But this seems not too
bad and I don't think it would benefit from repeating the type
("void (), void () * %x(" and then eventually "void (), ptr %x(") as has
been done with gep and load.

This also has a side benefit: since the explicit type is no longer a
pointer, there's no ambiguity between an explicit type and a function
that returns a function pointer. Previously this case needed an explicit
type (eg: a function returning a void() function was written as
"call void () () * @x(" rather than "call void () * @x(" because of the
ambiguity between a function returning a pointer to a void() function
and a function returning void).

No ambiguity means even function pointer return types can just be
written alone, without writing the whole function's type.

This leaves /only/ the varargs case where the explicit type is required.

Given the special type syntax in call instructions, the regex-fu used
for migration was a bit more involved in its own unique way (as every
one of these is) so here it is. Use it in conjunction with the apply.sh
script and associated find/xargs commands I've provided in rr230786 to
migrate your out of tree tests. Do let me know if any of this doesn't
cover your cases & we can iterate on a more general script/regexes to
help others with out of tree tests.

About 9 test cases couldn't be automatically migrated - half of those
were functions returning function pointers, where I just had to manually
delete the function argument types now that we didn't need an explicit
function type there. The other half were typedefs of function types used
in calls - just had to manually drop the * from those.

import fileinput
import sys
import re

pat = re.compile(r'((?:=|:|^|\s)call\s(?:[^@]*?))(\s*$|\s*(?:(?:\[\[[a-zA-Z0-9_]+\]\]|[@%](?:(")?[\\\?@a-zA-Z0-9_.]*?(?(3)"|)|{{.*}}))(?:\(|$)|undef|inttoptr|bitcast|null|asm).*$)')
addrspace_end = re.compile(r"addrspace\(\d+\)\s*\*$")
func_end = re.compile("(?:void.*|\)\s*)\*$")

def conv(match, line):
  if not match or re.search(addrspace_end, match.group(1)) or not re.search(func_end, match.group(1)):
    return line
  return line[:match.start()] + match.group(1)[:match.group(1).rfind('*')].rstrip() + match.group(2) + line[match.end():]

for line in sys.stdin:
  sys.stdout.write(conv(re.search(pat, line), line))

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235145 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dwblaikie committed Apr 16, 2015
1 parent 4906c57 commit 32b845d
Show file tree
Hide file tree
Showing 560 changed files with 1,498 additions and 1,503 deletions.
4 changes: 4 additions & 0 deletions include/llvm/IR/Instructions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,10 @@ class CallInst : public Instruction {

~CallInst() override;

Type *getFunctionType() const {
return cast<PointerType>(getCalledValue()->getType())->getElementType();
}

// Note that 'musttail' implies 'tail'.
enum TailCallKind { TCK_None = 0, TCK_Tail = 1, TCK_MustTail = 2 };
TailCallKind getTailCallKind() const {
Expand Down
10 changes: 4 additions & 6 deletions lib/AsmParser/LLParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5160,10 +5160,8 @@ bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
// If RetType is a non-function pointer type, then this is the short syntax
// for the call, which means that RetType is just the return type. Infer the
// rest of the function argument types from the arguments that are present.
PointerType *PFTy = nullptr;
FunctionType *Ty = nullptr;
if (!(PFTy = dyn_cast<PointerType>(RetType)) ||
!(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
FunctionType *Ty = dyn_cast<FunctionType>(RetType);
if (!Ty) {
// Pull out the types of all of the arguments...
std::vector<Type*> ParamTypes;
for (unsigned i = 0, e = ArgList.size(); i != e; ++i)
Expand All @@ -5173,12 +5171,12 @@ bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
return Error(RetTypeLoc, "Invalid result type for LLVM function");

Ty = FunctionType::get(RetType, ParamTypes, false);
PFTy = PointerType::getUnqual(Ty);
}

// Look up the callee.
Value *Callee;
if (ConvertValIDToValue(PFTy, CalleeID, Callee, &PFS)) return true;
if (ConvertValIDToValue(PointerType::getUnqual(Ty), CalleeID, Callee, &PFS))
return true;

// Set up the Attribute for the function.
SmallVector<AttributeSet, 8> Attrs;
Expand Down
15 changes: 4 additions & 11 deletions lib/IR/AsmWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2781,8 +2781,7 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
}

Operand = CI->getCalledValue();
PointerType *PTy = cast<PointerType>(Operand->getType());
FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
FunctionType *FTy = cast<FunctionType>(CI->getFunctionType());
Type *RetTy = FTy->getReturnType();
const AttributeSet &PAL = CI->getAttributes();

Expand All @@ -2794,15 +2793,9 @@ void AssemblyWriter::printInstruction(const Instruction &I) {
// and if the return type is not a pointer to a function.
//
Out << ' ';
if (!FTy->isVarArg() &&
(!RetTy->isPointerTy() ||
!cast<PointerType>(RetTy)->getElementType()->isFunctionTy())) {
TypePrinter.print(RetTy, Out);
Out << ' ';
writeOperand(Operand, false);
} else {
writeOperand(Operand, true);
}
TypePrinter.print(FTy->isVarArg() ? FTy : RetTy, Out);
Out << ' ';
writeOperand(Operand, false);
Out << '(';
for (unsigned op = 0, Eop = CI->getNumArgOperands(); op < Eop; ++op) {
if (op > 0)
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/BasicAA/2006-03-03-BadArraySubscript.ll
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ no_exit: ; preds = %no_exit, %entry
loopexit: ; preds = %no_exit, %entry
%Y.0.1 = phi i32 [ 0, %entry ], [ %tmp.13, %no_exit ] ; <i32> [#uses=1]
%tmp.4 = getelementptr [3 x [3 x i32]], [3 x [3 x i32]]* %X, i32 0, i32 0 ; <[3 x i32]*> [#uses=1]
%tmp.15 = call i32 (...)* @foo( [3 x i32]* %tmp.4, i32 %Y.0.1 ) ; <i32> [#uses=0]
%tmp.15 = call i32 (...) @foo( [3 x i32]* %tmp.4, i32 %Y.0.1 ) ; <i32> [#uses=0]
ret void
}

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/BasicAA/2008-04-15-Byval.ll
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ entry:
%tmp = getelementptr %struct.x, %struct.x* %X, i32 0, i32 0 ; <[4 x i32]*> [#uses=1]
%tmp1 = getelementptr [4 x i32], [4 x i32]* %tmp, i32 0, i32 3 ; <i32*> [#uses=1]
store i32 2, i32* %tmp1, align 4
%tmp2 = call i32 (...)* @bar( %struct.x* byval align 4 %X ) nounwind ; <i32> [#uses=0]
%tmp2 = call i32 (...) @bar( %struct.x* byval align 4 %X ) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
ret void
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/BasicAA/byval.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ target triple = "i686-apple-darwin8"

define i32 @foo(%struct.x* byval %a) nounwind {
; CHECK: ret i32 1
%tmp1 = tail call i32 (...)* @bar( %struct.x* %a ) nounwind ; <i32> [#uses=0]
%tmp1 = tail call i32 (...) @bar( %struct.x* %a ) nounwind ; <i32> [#uses=0]
%tmp2 = getelementptr %struct.x, %struct.x* %a, i32 0, i32 0 ; <i32*> [#uses=2]
store i32 1, i32* %tmp2, align 4
store i32 2, i32* @g, align 4
Expand Down
6 changes: 3 additions & 3 deletions test/Analysis/BlockFrequencyInfo/loops_with_profile_info.ll
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ for.inc10: ; preds = %for.end9

for.end12: ; preds = %for.cond
%6 = load i32, i32* @g, align 4
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i32 %6)
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i32 %6)
store i32 0, i32* @g, align 4
store i32 0, i32* %i, align 4
br label %for.cond13
Expand Down Expand Up @@ -165,7 +165,7 @@ for.inc22: ; preds = %for.end21

for.end24: ; preds = %for.cond13
%11 = load i32, i32* @g, align 4
%call25 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i32 %11)
%call25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i32 %11)
store i32 0, i32* @g, align 4
store i32 0, i32* %i, align 4
br label %for.cond26
Expand All @@ -188,7 +188,7 @@ for.inc29: ; preds = %for.body28

for.end31: ; preds = %for.cond26
%14 = load i32, i32* @g, align 4
%call32 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i32 %14)
%call32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i32 0, i32 0), i32 %14)
store i32 0, i32* @g, align 4
%15 = load i32, i32* %retval
ret i32 %15
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/CallGraph/2008-09-09-DirectCall.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ entry:

define void @caller() {
entry:
call void (...)* @callee( void (...)* @callee )
call void (...) @callee( void (...)* @callee )
unreachable
}
2 changes: 1 addition & 1 deletion test/Analysis/GlobalsModRef/volatile-instrs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ main_entry:
%0 = load volatile i32, i32* getelementptr inbounds (%struct.anon, %struct.anon* @b, i64 0, i32 0), align 4
store i32 %0, i32* @c, align 4
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* bitcast (%struct.anon* @b to i8*), i8* bitcast (%struct.anon* @a to i8*), i64 12, i32 4, i1 false) nounwind
%call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind
%call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0) nounwind
ret i32 0
}
2 changes: 1 addition & 1 deletion test/Analysis/LazyCallGraph/basic.ll
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ next:
select i1 true, void ()* @f3, void ()* @f4
store void ()* @f5, void ()** %x
call void @f6()
call void (void ()*, void ()*)* bitcast (void ()* @f7 to void (void ()*, void ()*)*)(void ()* @f8, void ()* @f9)
call void (void ()*, void ()*) bitcast (void ()* @f7 to void (void ()*, void ()*)*)(void ()* @f8, void ()* @f9)
invoke void @f10() to label %exit unwind label %unwind

exit:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ bb.nph: ; preds = %entry
bb: ; preds = %bb.nph, %bb1
%indvar = phi i32 [ 0, %bb.nph ], [ %indvar.next, %bb1 ] ; <i32> [#uses=2]
%argc_addr.04 = add i32 %indvar, %argc ; <i32> [#uses=1]
tail call void (...)* @Test() nounwind
tail call void (...) @Test() nounwind
%1 = add i32 %argc_addr.04, 1 ; <i32> [#uses=1]
br label %bb1

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/ScalarEvolution/2012-03-26-LoadConstant.ll
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ entry:
br label %lbl_818

lbl_818: ; preds = %for.end, %entry
call void (...)* @func_27()
call void (...) @func_27()
store i32 0, i32* @g_814, align 4
br label %for.cond

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/ScalarEvolution/max-trip-count.ll
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ for.inc: ; preds = %for.body
br label %for.cond

for.end: ; preds = %for.body, %for.cond
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %g_4.0) nounwind ; <i32> [#uses=0]
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %g_4.0) nounwind ; <i32> [#uses=0]
ret i32 0
}

Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/ScalarEvolution/zext-signed-addrec.ll
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ for.cond.for.end9_crit_edge: ; preds = %for.inc8

for.end9: ; preds = %entry.for.end9_crit_edge, %for.cond.for.end9_crit_edge
%3 = phi i32 [ %.pre, %entry.for.end9_crit_edge ], [ %shl, %for.cond.for.end9_crit_edge ]
%call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3) #2
%call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3) #2
br label %return

return.loopexit.split: ; preds = %for.cond1.preheader.lr.ph
Expand Down
2 changes: 1 addition & 1 deletion test/Analysis/ValueTracking/memory-dereferenceable.ll
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ entry:
%alloca = alloca i1
%load2 = load i1, i1* %alloca
%load3 = load i32, i32 addrspace(1)* %dparam
%tok = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam)
%tok = tail call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam)
%relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %tok, i32 4, i32 4)
%load4 = load i32, i32 addrspace(1)* %relocate
%nparam = getelementptr i32, i32 addrspace(1)* %dparam, i32 5
Expand Down
2 changes: 1 addition & 1 deletion test/Assembler/2002-07-25-ReturnPtrFunction.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
declare void (i32)* @foo()

define void @test() {
call void (i32)* ()* @foo( ) ; <%ty*>:1 [#uses=0]
call void (i32)* () @foo( ) ; <%ty*>:1 [#uses=0]
ret void
}

Expand Down
4 changes: 2 additions & 2 deletions test/Assembler/2003-05-15-AssemblerProblem.ll
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
; RUN: verify-uselistorder %s

define void @test() {
call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 )
call void (...) bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* null, i32 0 )
ret void
}

define void @AddString(i16* %tmp.124, i32 %tmp.127) {
call void (...)* bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* %tmp.124, i32 %tmp.127 )
call void (...) bitcast (void (i16*, i32)* @AddString to void (...)*)( i16* %tmp.124, i32 %tmp.127 )
ret void
}

2 changes: 1 addition & 1 deletion test/Assembler/2008-01-11-VarargAttrs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
declare void @foo(...)

define void @bar() {
call void (...)* @foo(%struct* byval null )
call void (...) @foo(%struct* byval null )
ret void
}
2 changes: 1 addition & 1 deletion test/Assembler/musttail-invalid-1.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
declare i8* @f(i8*, ...)

define i8* @f_thunk(i8* %this) {
%rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...)
%rv = musttail call i8* (i8*, ...) @f(i8* %this, ...)
; CHECK: error: unexpected ellipsis in argument list for musttail call in non-varargs function
ret i8* %rv
}
2 changes: 1 addition & 1 deletion test/Assembler/musttail-invalid-2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
declare i8* @f(i8*, ...)

define i8* @f_thunk(i8* %this, ...) {
%rv = musttail call i8* (i8*, ...)* @f(i8* %this)
%rv = musttail call i8* (i8*, ...) @f(i8* %this)
; CHECK: error: expected '...' at end of argument list for musttail call in varargs function
ret i8* %rv
}
4 changes: 2 additions & 2 deletions test/Assembler/musttail.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
declare i8* @f(i8*, ...)

define i8* @f_thunk(i8* %this, ...) {
%rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...)
%rv = musttail call i8* (i8*, ...) @f(i8* %this, ...)
ret i8* %rv
}
; CHECK-LABEL: define i8* @f_thunk(i8* %this, ...)
; CHECK: %rv = musttail call i8* (i8*, ...)* @f(i8* %this, ...)
; CHECK: %rv = musttail call i8* (i8*, ...) @f(i8* %this, ...)
4 changes: 2 additions & 2 deletions test/Bitcode/miscInstructions.3.2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ entry:
; CHECK-NEXT: %res2 = tail call i32 @test(i32 %x)
%res2 = tail call i32 @test(i32 %x)

; CHECK-NEXT: %res3 = call i32 (i8*, ...)* @printf(i8* %msg, i32 12, i8 42)
%res3 = call i32 (i8*, ...)* @printf(i8* %msg, i32 12, i8 42)
; CHECK-NEXT: %res3 = call i32 (i8*, ...) @printf(i8* %msg, i32 12, i8 42)
%res3 = call i32 (i8*, ...) @printf(i8* %msg, i32 12, i8 42)

ret void
}
Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/AArch64/argument-blocks.ll
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ define void @test_varargs_stackalign() {
; CHECK-LABEL: test_varargs_stackalign:
; CHECK-DARWINPCS: stp {{w[0-9]+}}, {{w[0-9]+}}, [sp, #16]

call void(...)* @callee([3 x float] undef, [2 x float] [float 1.0, float 2.0])
call void(...) @callee([3 x float] undef, [2 x float] [float 1.0, float 2.0])
ret void
}

Expand Down
8 changes: 4 additions & 4 deletions test/CodeGen/AArch64/arm64-2012-06-06-FPToUI.ll
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ entry:
%0 = load double, double* %d.addr, align 8
%1 = load double, double* %d.addr, align 8
%conv = fptoui double %1 to i64
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), double %0, i64 %conv)
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i32 0, i32 0), double %0, i64 %conv)
%2 = load double, double* %d.addr, align 8
%3 = load double, double* %d.addr, align 8
%conv1 = fptoui double %3 to i32
%call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str1, i32 0, i32 0), double %2, i32 %conv1)
%call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str1, i32 0, i32 0), double %2, i32 %conv1)
ret void
}

Expand All @@ -37,12 +37,12 @@ entry:
%conv = fpext float %0 to double
%1 = load float, float* %f.addr, align 4
%conv1 = fptoui float %1 to i64
%call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str2, i32 0, i32 0), double %conv, i64 %conv1)
%call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str2, i32 0, i32 0), double %conv, i64 %conv1)
%2 = load float, float* %f.addr, align 4
%conv2 = fpext float %2 to double
%3 = load float, float* %f.addr, align 4
%conv3 = fptoui float %3 to i32
%call4 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str3, i32 0, i32 0), double %conv2, i32 %conv3)
%call4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str3, i32 0, i32 0), double %conv2, i32 %conv3)
ret void
}

Expand Down
2 changes: 1 addition & 1 deletion test/CodeGen/AArch64/arm64-aapcs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ declare void @variadic(i32 %a, ...)
; Under AAPCS variadic functions have the same calling convention as
; others. The extra arguments should go in registers rather than on the stack.
define void @test_variadic() {
call void(i32, ...)* @variadic(i32 0, i64 1, double 2.0)
call void(i32, ...) @variadic(i32 0, i64 1, double 2.0)
; CHECK: fmov d0, #2.0
; CHECK: orr w1, wzr, #0x1
; CHECK: bl variadic
Expand Down
6 changes: 3 additions & 3 deletions test/CodeGen/AArch64/arm64-abi-varargs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ define i32 @main() nounwind ssp {
%10 = load i32, i32* %a10, align 4
%11 = load i32, i32* %a11, align 4
%12 = load i32, i32* %a12, align 4
call void (i32, i32, i32, i32, i32, i32, i32, i32, i32, ...)* @fn9(i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12)
call void (i32, i32, i32, i32, i32, i32, i32, i32, i32, ...) @fn9(i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12)
ret i32 0
}

Expand Down Expand Up @@ -133,7 +133,7 @@ entry:
store <4 x i32> %y, <4 x i32>* %y.addr, align 16
%0 = load i32, i32* %x.addr, align 4
%1 = load <4 x i32>, <4 x i32>* %y.addr, align 16
call void (i8*, ...)* @foo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %0, <4 x i32> %1)
call void (i8*, ...) @foo(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %0, <4 x i32> %1)
ret void
}

Expand Down Expand Up @@ -186,6 +186,6 @@ entry:
%1 = load i32, i32* %x.addr, align 4
%2 = bitcast %struct.s41* %s41 to i128*
%3 = load i128, i128* %2, align 1
call void (i8*, ...)* @foo2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %1, i128 %3)
call void (i8*, ...) @foo2(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %1, i128 %3)
ret void
}
2 changes: 1 addition & 1 deletion test/CodeGen/AArch64/arm64-anyregcc-crash.ll
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ define i64 @anyreglimit(i64 %v1, i64 %v2, i64 %v3, i64 %v4, i64 %v5, i64 %v6, i6
i64 %v17, i64 %v18, i64 %v19, i64 %v20, i64 %v21, i64 %v22, i64 %v23, i64 %v24,
i64 %v25, i64 %v26, i64 %v27, i64 %v28, i64 %v29, i64 %v30, i64 %v31, i64 %v32) {
entry:
%result = tail call anyregcc i64 (i64, i32, i8*, i32, ...)* @llvm.experimental.patchpoint.i64(i64 12, i32 15, i8* inttoptr (i64 0 to i8*), i32 32,
%result = tail call anyregcc i64 (i64, i32, i8*, i32, ...) @llvm.experimental.patchpoint.i64(i64 12, i32 15, i8* inttoptr (i64 0 to i8*), i32 32,
i64 %v1, i64 %v2, i64 %v3, i64 %v4, i64 %v5, i64 %v6, i64 %v7, i64 %v8,
i64 %v9, i64 %v10, i64 %v11, i64 %v12, i64 %v13, i64 %v14, i64 %v15, i64 %v16,
i64 %v17, i64 %v18, i64 %v19, i64 %v20, i64 %v21, i64 %v22, i64 %v23, i64 %v24,
Expand Down
Loading

0 comments on commit 32b845d

Please sign in to comment.