Lines Matching defs:IRB
464 IRBuilder<> IRB(M->getContext());
465 return IRB.getIntNTy(M->getDataLayout().getPointerSizeInBits());
479 IRBuilder<> IRB(M->getContext());
480 return IRB.getIntN(M->getDataLayout().getPointerSizeInBits(), C);
513 IRBuilder<> IRB(C);
514 IRB.SetInsertPoint(CI);
518 IRB.CreateStore(getAddrSizeInt(M, 0), ThrewGV);
526 CallInst *NewCall = IRB.CreateCall(getInvokeWrapper(CI), Args);
566 IRB.CreateLoad(getAddrIntType(M), ThrewGV, ThrewGV->getName() + ".val");
567 IRB.CreateStore(getAddrSizeInt(M, 0), ThrewGV);
709 IRBuilder<> IRB(C);
710 IRB.SetCurrentDebugLocation(DL);
713 IRB.SetInsertPoint(BB);
717 Value *ThrewCmp = IRB.CreateICmpNE(Threw, getAddrSizeInt(M, 0));
718 Value *ThrewValue = IRB.CreateLoad(IRB.getInt32Ty(), ThrewValueGV,
720 Value *ThrewValueCmp = IRB.CreateICmpNE(ThrewValue, IRB.getInt32(0));
721 Value *Cmp1 = IRB.CreateAnd(ThrewCmp, ThrewValueCmp, "cmp1");
722 IRB.CreateCondBr(Cmp1, ThenBB1, ElseBB1);
728 IRB.SetInsertPoint(CallEmLongjmpBB);
729 CallEmLongjmpBBThrewPHI = IRB.CreatePHI(getAddrIntType(M), 4, "threw.phi");
731 IRB.CreatePHI(IRB.getInt32Ty(), 4, "threwvalue.phi");
734 IRB.CreateCall(EmLongjmpF,
736 IRB.CreateUnreachable();
744 IRB.SetInsertPoint(ThenBB1);
747 IRB.CreateIntToPtr(Threw, getAddrPtrType(M), Threw->getName() + ".p");
748 Value *ThenLabel = IRB.CreateCall(WasmSetjmpTestF,
750 Value *Cmp2 = IRB.CreateICmpEQ(ThenLabel, IRB.getInt32(0));
751 IRB.CreateCondBr(Cmp2, CallEmLongjmpBB, EndBB2);
754 IRB.SetInsertPoint(EndBB2);
755 IRB.CreateCall(SetTempRet0F, ThrewValue);
756 IRB.CreateBr(EndBB1);
758 IRB.SetInsertPoint(ElseBB1);
759 IRB.CreateBr(EndBB1);
762 IRB.SetInsertPoint(EndBB1);
763 PHINode *LabelPHI = IRB.CreatePHI(IRB.getInt32Ty(), 2, "label");
766 LabelPHI->addIncoming(IRB.getInt32(-1), ElseBB1);
771 LongjmpResult = IRB.CreateCall(GetTempRet0F, {}, "longjmp_result");
818 IRBuilder<> IRB(C);
825 IRB.SetInsertPoint(CI);
829 IRB.CreatePtrToInt(CI->getArgOperand(0), getAddrIntType(M), "env");
831 Env = IRB.CreateBitCast(CI->getArgOperand(0), IRB.getPtrTy(), "env");
832 IRB.CreateCall(NewF, {Env, CI->getArgOperand(1)});
843 IRB.CreateBitCast(NewF, LongjmpF->getType(), "longjmp.cast");
863 IRBuilder<> IRB(M.getContext());
879 CI->replaceAllUsesWith(IRB.getInt32(0));
889 IRBuilder<> IRB(C);
929 ThrewValueGV = getGlobalVariable(M, IRB.getInt32Ty(), TM, "__threwValue");
931 FunctionType::get(IRB.getInt32Ty(), false), "getTempRet0", &M);
933 FunctionType::get(IRB.getVoidTy(), IRB.getInt32Ty(), false),
944 FunctionType::get(IRB.getVoidTy(), IRB.getPtrTy(), false);
950 FunctionType::get(IRB.getInt32Ty(), IRB.getPtrTy(), false);
990 IRB.getVoidTy(), {getAddrIntType(&M), IRB.getInt32Ty()}, false);
994 Type *Int8PtrTy = IRB.getPtrTy();
997 IRB.getVoidTy(), {Int8PtrTy, IRB.getInt32Ty()}, false);
1003 Type *Int8PtrTy = IRB.getPtrTy();
1004 Type *Int32PtrTy = IRB.getPtrTy();
1005 Type *Int32Ty = IRB.getInt32Ty();
1010 IRB.getVoidTy(), {SetjmpFTy->getParamType(0), Int32Ty, Int32PtrTy},
1072 IRBuilder<> IRB(C);
1089 IRB.SetInsertPoint(II);
1123 IRB.SetInsertPoint(RethrowLongjmpBB);
1125 IRB.CreatePHI(getAddrIntType(&M), 4, "threw.phi");
1127 Value *ThrewValue = IRB.CreateLoad(IRB.getInt32Ty(), ThrewValueGV,
1129 IRB.CreateCall(EmLongjmpF, {RethrowLongjmpBBThrewPHI, ThrewValue});
1130 IRB.CreateUnreachable();
1135 IRB.SetInsertPoint(II); // Restore the insert point back
1138 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp.eq.one");
1140 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 0), "cmp.eq.zero");
1141 Value *Or = IRB.CreateOr(CmpEqZero, CmpEqOne, "or");
1142 IRB.CreateCondBr(Or, Tail, RethrowLongjmpBB);
1143 IRB.SetInsertPoint(Tail);
1148 Value *Cmp = IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp");
1149 IRB.CreateCondBr(Cmp, II->getUnwindDest(), II->getNormalDest());
1169 IRB.SetInsertPoint(RI);
1170 Value *Low = IRB.CreateExtractValue(Input, 0, "low");
1172 IRB.CreateCall(ResumeF, {Low});
1174 IRB.CreateUnreachable();
1192 IRB.SetInsertPoint(CI);
1194 IRB.CreateCall(EHTypeIDF, CI->getArgOperand(0), "typeid");
1211 IRB.SetInsertPoint(LPI);
1223 CallInst *FMCI = IRB.CreateCall(FMCF, FMCArgs, "fmc");
1225 Value *Pair0 = IRB.CreateInsertValue(Poison, FMCI, 0, "pair0");
1226 Value *TempRet0 = IRB.CreateCall(GetTempRet0F, {}, "tempret0");
1227 Value *Pair1 = IRB.CreateInsertValue(Pair0, TempRet0, 1, "pair1");
1265 IRBuilder<> IRB(C);
1274 IRB.SetInsertPoint(Entry->getTerminator()->getIterator());
1279 IRB.CreateAlloca(IRB.getInt32Ty(), nullptr, "functionInvocationId");
1312 IRB.SetInsertPoint(Tail, Tail->getFirstNonPHIIt());
1313 PHINode *SetjmpRet = IRB.CreatePHI(IRB.getInt32Ty(), 2, "setjmp.ret");
1316 SetjmpRet->addIncoming(IRB.getInt32(0), BB);
1325 IRB.SetInsertPoint(CI);
1326 Value *Args[] = {CI->getArgOperand(0), IRB.getInt32(SetjmpRetPHIs.size()),
1328 IRB.CreateCall(WasmSetjmpF, Args);
1365 IRBuilder<> IRB(C);
1485 IRB.SetInsertPoint(RethrowExnBB);
1487 IRB.CreateCall(getFindMatchingCatch(M, 0), {}, "exn");
1488 IRB.CreateCall(ResumeF, {Exn});
1489 IRB.CreateUnreachable();
1492 IRB.SetInsertPoint(CI);
1495 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp.eq.one");
1496 IRB.CreateCondBr(CmpEqOne, RethrowExnBB, NormalBB);
1498 IRB.SetInsertPoint(NormalBB);
1499 IRB.CreateBr(Tail);
1521 IRB.SetInsertPoint(EndBB);
1522 IRB.SetCurrentDebugLocation(EndBB->back().getDebugLoc());
1523 SwitchInst *SI = IRB.CreateSwitch(Label, Tail, SetjmpRetPHIs.size());
1529 SI->addCase(IRB.getInt32(I + 1), SetjmpRetPHIs[I]->getParent());
1560 IRBuilder<> IRB(C);
1569 FunctionType::get(IRB.getInt32Ty(), /* isVarArg */ true);
1572 cast<Constant>(IRB.CreateBitCast(PersF, IRB.getPtrTy())));
1578 IRB.SetCurrentDebugLocation(FirstDL);
1599 IRB.SetInsertPoint(CatchDispatchLongjmpBB);
1601 IRB.CreateCatchSwitch(ConstantTokenNone::get(C), nullptr, 1);
1606 IRB.SetInsertPoint(CatchLongjmpBB);
1607 CatchPadInst *CatchPad = IRB.CreateCatchPad(CatchSwitchLongjmp, {});
1614 IRB.CreateCall(CatchF, {IRB.getInt32(WebAssembly::C_LONGJMP)}, "thrown");
1616 IRB.CreateConstGEP2_32(LongjmpArgsTy, LongjmpArgs, 0, 0, "env_gep");
1618 IRB.CreateConstGEP2_32(LongjmpArgsTy, LongjmpArgs, 0, 1, "val_gep");
1620 Instruction *Env = IRB.CreateLoad(IRB.getPtrTy(), EnvField, "env");
1622 Instruction *Val = IRB.CreateLoad(IRB.getInt32Ty(), ValField, "val");
1630 Value *EnvP = IRB.CreateBitCast(Env, getAddrPtrType(&M), "env.p");
1631 Value *Label = IRB.CreateCall(WasmSetjmpTestF, {EnvP, FunctionInvocationId},
1633 Value *Cmp = IRB.CreateICmpEQ(Label, IRB.getInt32(0));
1634 IRB.CreateCondBr(Cmp, ThenBB, EndBB);
1636 IRB.SetInsertPoint(ThenBB);
1637 CallInst *WasmLongjmpCI = IRB.CreateCall(
1639 IRB.CreateUnreachable();
1641 IRB.SetInsertPoint(EndBB);
1643 IRB.CreateCatchRet(CatchPad, SetjmpDispatchBB);
1653 IRB.SetInsertPoint(SetjmpDispatchBB);
1654 PHINode *LabelPHI = IRB.CreatePHI(IRB.getInt32Ty(), 2, "label.phi");
1656 LabelPHI->addIncoming(IRB.getInt32(-1), Entry);
1657 SwitchInst *SI = IRB.CreateSwitch(LabelPHI, OrigEntry, SetjmpRetPHIs.size());
1663 SI->addCase(IRB.getInt32(I + 1), SetjmpRetPHIs[I]->getParent());
1744 IRB.SetInsertPoint(CSI);
1746 auto *NewCSI = IRB.CreateCatchSwitch(CSI->getParentPad(),
1756 IRB.SetInsertPoint(CRI);
1758 IRB.CreateCleanupRet(CRI->getCleanupPad(), CatchDispatchLongjmpBB);