@@ -3044,8 +3044,8 @@ void SelectionDAGBuilder::visitCallBr(const CallBrInst &I) {
30443044 {LLVMContext::OB_deopt, LLVMContext::OB_funclet}) &&
30453045 " Cannot lower callbrs with arbitrary operand bundles yet!" );
30463046
3047- assert (I.isInlineAsm () && " Only know how to handle inlineasm callbr" );
3048- visitInlineAsm (I);
3047+ // assert(I.isInlineAsm() && "Only know how to handle inlineasm callbr");
3048+ visitCall (I);
30493049 CopyToExportRegsIfNeeded (&I);
30503050
30513051 // Retrieve successors.
@@ -8092,7 +8092,7 @@ void SelectionDAGBuilder::processIntegerCallValue(const Instruction &I,
80928092// / normal call.
80938093// / The caller already checked that \p I calls the appropriate LibFunc with a
80948094// / correct prototype.
8095- bool SelectionDAGBuilder::visitMemCmpBCmpCall (const CallInst &I) {
8095+ bool SelectionDAGBuilder::visitMemCmpBCmpCall (const CallBase &I) {
80968096 const Value *LHS = I.getArgOperand (0 ), *RHS = I.getArgOperand (1 );
80978097 const Value *Size = I.getArgOperand (2 );
80988098 const ConstantSDNode *CSize = dyn_cast<ConstantSDNode>(getValue (Size));
@@ -8184,7 +8184,7 @@ bool SelectionDAGBuilder::visitMemCmpBCmpCall(const CallInst &I) {
81848184// / normal call.
81858185// / The caller already checked that \p I calls the appropriate LibFunc with a
81868186// / correct prototype.
8187- bool SelectionDAGBuilder::visitMemChrCall (const CallInst &I) {
8187+ bool SelectionDAGBuilder::visitMemChrCall (const CallBase &I) {
81888188 const Value *Src = I.getArgOperand (0 );
81898189 const Value *Char = I.getArgOperand (1 );
81908190 const Value *Length = I.getArgOperand (2 );
@@ -8208,7 +8208,7 @@ bool SelectionDAGBuilder::visitMemChrCall(const CallInst &I) {
82088208// / normal call.
82098209// / The caller already checked that \p I calls the appropriate LibFunc with a
82108210// / correct prototype.
8211- bool SelectionDAGBuilder::visitMemPCpyCall (const CallInst &I) {
8211+ bool SelectionDAGBuilder::visitMemPCpyCall (const CallBase &I) {
82128212 SDValue Dst = getValue (I.getArgOperand (0 ));
82138213 SDValue Src = getValue (I.getArgOperand (1 ));
82148214 SDValue Size = getValue (I.getArgOperand (2 ));
@@ -8249,7 +8249,7 @@ bool SelectionDAGBuilder::visitMemPCpyCall(const CallInst &I) {
82498249// / normal call.
82508250// / The caller already checked that \p I calls the appropriate LibFunc with a
82518251// / correct prototype.
8252- bool SelectionDAGBuilder::visitStrCpyCall (const CallInst &I, bool isStpcpy) {
8252+ bool SelectionDAGBuilder::visitStrCpyCall (const CallBase &I, bool isStpcpy) {
82538253 const Value *Arg0 = I.getArgOperand (0 ), *Arg1 = I.getArgOperand (1 );
82548254
82558255 const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo ();
@@ -8272,7 +8272,7 @@ bool SelectionDAGBuilder::visitStrCpyCall(const CallInst &I, bool isStpcpy) {
82728272// / normal call.
82738273// / The caller already checked that \p I calls the appropriate LibFunc with a
82748274// / correct prototype.
8275- bool SelectionDAGBuilder::visitStrCmpCall (const CallInst &I) {
8275+ bool SelectionDAGBuilder::visitStrCmpCall (const CallBase &I) {
82768276 const Value *Arg0 = I.getArgOperand (0 ), *Arg1 = I.getArgOperand (1 );
82778277
82788278 const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo ();
@@ -8295,7 +8295,7 @@ bool SelectionDAGBuilder::visitStrCmpCall(const CallInst &I) {
82958295// / normal call.
82968296// / The caller already checked that \p I calls the appropriate LibFunc with a
82978297// / correct prototype.
8298- bool SelectionDAGBuilder::visitStrLenCall (const CallInst &I) {
8298+ bool SelectionDAGBuilder::visitStrLenCall (const CallBase &I) {
82998299 const Value *Arg0 = I.getArgOperand (0 );
83008300
83018301 const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo ();
@@ -8316,7 +8316,7 @@ bool SelectionDAGBuilder::visitStrLenCall(const CallInst &I) {
83168316// / normal call.
83178317// / The caller already checked that \p I calls the appropriate LibFunc with a
83188318// / correct prototype.
8319- bool SelectionDAGBuilder::visitStrNLenCall (const CallInst &I) {
8319+ bool SelectionDAGBuilder::visitStrNLenCall (const CallBase &I) {
83208320 const Value *Arg0 = I.getArgOperand (0 ), *Arg1 = I.getArgOperand (1 );
83218321
83228322 const SelectionDAGTargetInfo &TSI = DAG.getSelectionDAGInfo ();
@@ -8338,7 +8338,7 @@ bool SelectionDAGBuilder::visitStrNLenCall(const CallInst &I) {
83388338// / false and it will be lowered like a normal call.
83398339// / The caller already checked that \p I calls the appropriate LibFunc with a
83408340// / correct prototype.
8341- bool SelectionDAGBuilder::visitUnaryFloatCall (const CallInst &I,
8341+ bool SelectionDAGBuilder::visitUnaryFloatCall (const CallBase &I,
83428342 unsigned Opcode) {
83438343 // We already checked this call's prototype; verify it doesn't modify errno.
83448344 if (!I.onlyReadsMemory ())
@@ -8358,7 +8358,7 @@ bool SelectionDAGBuilder::visitUnaryFloatCall(const CallInst &I,
83588358// / false, and it will be lowered like a normal call.
83598359// / The caller already checked that \p I calls the appropriate LibFunc with a
83608360// / correct prototype.
8361- bool SelectionDAGBuilder::visitBinaryFloatCall (const CallInst &I,
8361+ bool SelectionDAGBuilder::visitBinaryFloatCall (const CallBase &I,
83628362 unsigned Opcode) {
83638363 // We already checked this call's prototype; verify it doesn't modify errno.
83648364 if (!I.onlyReadsMemory ())
@@ -8374,7 +8374,7 @@ bool SelectionDAGBuilder::visitBinaryFloatCall(const CallInst &I,
83748374 return true ;
83758375}
83768376
8377- void SelectionDAGBuilder::visitCall (const CallInst &I) {
8377+ void SelectionDAGBuilder::visitCall (const CallBase &I) {
83788378 // Handle inline assembly differently.
83798379 if (I.isInlineAsm ()) {
83808380 visitInlineAsm (I);
@@ -8392,7 +8392,8 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
83928392 IID = II->getIntrinsicID (F);
83938393
83948394 if (IID) {
8395- visitIntrinsicCall (I, IID);
8395+ assert (isa<CallInst>(I) && " Don't know how to handle intrinsic callbr" );
8396+ visitIntrinsicCall (cast<CallInst>(I), IID);
83968397 return ;
83978398 }
83988399 }
0 commit comments