forked from OSchip/llvm-project
[InstCombine] Use getFunctionType()
Avoid fetching pointer element type...
This commit is contained in:
parent
dbbc8d8333
commit
8321335fd8
|
@ -2310,8 +2310,7 @@ Instruction *InstCombinerImpl::visitCallBase(CallBase &Call) {
|
|||
if (IntrinsicInst *II = findInitTrampoline(Callee))
|
||||
return transformCallThroughTrampoline(Call, *II);
|
||||
|
||||
PointerType *PTy = cast<PointerType>(Callee->getType());
|
||||
FunctionType *FTy = cast<FunctionType>(PTy->getElementType());
|
||||
FunctionType *FTy = Call.getFunctionType();
|
||||
if (FTy->isVarArg()) {
|
||||
int ix = FTy->getNumParams();
|
||||
// See if we can optimize any arguments passed through the varargs area of
|
||||
|
|
|
@ -108,3 +108,12 @@ define ptr @load_bitcast_2(ptr %a) {
|
|||
%d = bitcast i8* %c to ptr
|
||||
ret ptr %d
|
||||
}
|
||||
|
||||
define void @call(ptr %a) {
|
||||
; CHECK-LABEL: @call(
|
||||
; CHECK-NEXT: call void [[A:%.*]]()
|
||||
; CHECK-NEXT: ret void
|
||||
;
|
||||
call void %a()
|
||||
ret void
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue