@@ -557,31 +557,20 @@ int FunctionComparator::cmpOperations(const Instruction *L,
557
557
}
558
558
if (const CmpInst *CI = dyn_cast<CmpInst>(L))
559
559
return cmpNumbers (CI->getPredicate (), cast<CmpInst>(R)->getPredicate ());
560
- if (const CallInst *CI = dyn_cast<CallInst >(L)) {
561
- if ( int Res = cmpNumbers (CI-> getCallingConv (),
562
- cast<CallInst>(R)-> getCallingConv ()))
560
+ if (auto CSL = CallSite ( const_cast <Instruction * >(L) )) {
561
+ auto CSR = CallSite ( const_cast <Instruction *>(R));
562
+ if ( int Res = cmpNumbers (CSL. getCallingConv (), CSR. getCallingConv ()))
563
563
return Res;
564
- if (int Res =
565
- cmpAttrs (CI->getAttributes (), cast<CallInst>(R)->getAttributes ()))
566
- return Res;
567
- if (int Res = cmpOperandBundlesSchema (CI, R))
564
+ if (int Res = cmpAttrs (CSL.getAttributes (), CSR.getAttributes ()))
568
565
return Res;
569
- return cmpRangeMetadata (
570
- CI->getMetadata (LLVMContext::MD_range),
571
- cast<CallInst>(R)->getMetadata (LLVMContext::MD_range));
572
- }
573
- if (const InvokeInst *II = dyn_cast<InvokeInst>(L)) {
574
- if (int Res = cmpNumbers (II->getCallingConv (),
575
- cast<InvokeInst>(R)->getCallingConv ()))
566
+ if (int Res = cmpOperandBundlesSchema (L, R))
576
567
return Res;
577
- if (int Res =
578
- cmpAttrs (II->getAttributes (), cast<InvokeInst>(R)->getAttributes ()))
579
- return Res;
580
- if (int Res = cmpOperandBundlesSchema (II, R))
581
- return Res;
582
- return cmpRangeMetadata (
583
- II->getMetadata (LLVMContext::MD_range),
584
- cast<InvokeInst>(R)->getMetadata (LLVMContext::MD_range));
568
+ if (const CallInst *CI = dyn_cast<CallInst>(L))
569
+ if (int Res = cmpNumbers (CI->getTailCallKind (),
570
+ cast<CallInst>(R)->getTailCallKind ()))
571
+ return Res;
572
+ return cmpRangeMetadata (L->getMetadata (LLVMContext::MD_range),
573
+ R->getMetadata (LLVMContext::MD_range));
585
574
}
586
575
if (const InsertValueInst *IVI = dyn_cast<InsertValueInst>(L)) {
587
576
ArrayRef<unsigned > LIndices = IVI->getIndices ();
0 commit comments