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);
708 IRBuilder<> IRB(C);
709 IRB.SetCurrentDebugLocation(DL);
712 IRB.SetInsertPoint(BB);
716 Value *ThrewCmp = IRB.CreateICmpNE(Threw, getAddrSizeInt(M, 0));
717 Value *ThrewValue = IRB.CreateLoad(IRB.getInt32Ty(), ThrewValueGV,
719 Value *ThrewValueCmp = IRB.CreateICmpNE(ThrewValue, IRB.getInt32(0));
720 Value *Cmp1 = IRB.CreateAnd(ThrewCmp, ThrewValueCmp, "cmp1");
721 IRB.CreateCondBr(Cmp1, ThenBB1, ElseBB1);
727 IRB.SetInsertPoint(CallEmLongjmpBB);
728 CallEmLongjmpBBThrewPHI = IRB.CreatePHI(getAddrIntType(M), 4, "threw.phi");
730 IRB.CreatePHI(IRB.getInt32Ty(), 4, "threwvalue.phi");
733 IRB.CreateCall(EmLongjmpF,
735 IRB.CreateUnreachable();
743 IRB.SetInsertPoint(ThenBB1);
746 IRB.CreateIntToPtr(Threw, getAddrPtrType(M), Threw->getName() + ".p");
747 Value *ThenLabel = IRB.CreateCall(WasmSetjmpTestF,
749 Value *Cmp2 = IRB.CreateICmpEQ(ThenLabel, IRB.getInt32(0));
750 IRB.CreateCondBr(Cmp2, CallEmLongjmpBB, EndBB2);
753 IRB.SetInsertPoint(EndBB2);
754 IRB.CreateCall(SetTempRet0F, ThrewValue);
755 IRB.CreateBr(EndBB1);
757 IRB.SetInsertPoint(ElseBB1);
758 IRB.CreateBr(EndBB1);
761 IRB.SetInsertPoint(EndBB1);
762 PHINode *LabelPHI = IRB.CreatePHI(IRB.getInt32Ty(), 2, "label");
765 LabelPHI->addIncoming(IRB.getInt32(-1), ElseBB1);
770 LongjmpResult = IRB.CreateCall(GetTempRet0F, std::nullopt, "longjmp_result");
815 IRBuilder<> IRB(C);
822 IRB.SetInsertPoint(CI);
826 IRB.CreatePtrToInt(CI->getArgOperand(0), getAddrIntType(M), "env");
828 Env = IRB.CreateBitCast(CI->getArgOperand(0), IRB.getPtrTy(), "env");
829 IRB.CreateCall(NewF, {Env, CI->getArgOperand(1)});
840 IRB.CreateBitCast(NewF, LongjmpF->getType(), "longjmp.cast");
860 IRBuilder<> IRB(M.getContext());
876 CI->replaceAllUsesWith(IRB.getInt32(0));
886 IRBuilder<> IRB(C);
926 ThrewValueGV = getGlobalVariable(M, IRB.getInt32Ty(), TM, "__threwValue");
928 FunctionType::get(IRB.getInt32Ty(), false), "getTempRet0", &M);
930 FunctionType::get(IRB.getVoidTy(), IRB.getInt32Ty(), false),
941 FunctionType::get(IRB.getVoidTy(), IRB.getPtrTy(), false);
947 FunctionType::get(IRB.getInt32Ty(), IRB.getPtrTy(), false);
987 IRB.getVoidTy(), {getAddrIntType(&M), IRB.getInt32Ty()}, false);
991 Type *Int8PtrTy = IRB.getPtrTy();
994 IRB.getVoidTy(), {Int8PtrTy, IRB.getInt32Ty()}, false);
1000 Type *Int8PtrTy = IRB.getPtrTy();
1001 Type *Int32PtrTy = IRB.getPtrTy();
1002 Type *Int32Ty = IRB.getInt32Ty();
1007 IRB.getVoidTy(), {SetjmpFTy->getParamType(0), Int32Ty, Int32PtrTy},
1069 IRBuilder<> IRB(C);
1086 IRB.SetInsertPoint(II);
1120 IRB.SetInsertPoint(RethrowLongjmpBB);
1122 IRB.CreatePHI(getAddrIntType(&M), 4, "threw.phi");
1124 Value *ThrewValue = IRB.CreateLoad(IRB.getInt32Ty(), ThrewValueGV,
1126 IRB.CreateCall(EmLongjmpF, {RethrowLongjmpBBThrewPHI, ThrewValue});
1127 IRB.CreateUnreachable();
1132 IRB.SetInsertPoint(II); // Restore the insert point back
1135 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp.eq.one");
1137 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 0), "cmp.eq.zero");
1138 Value *Or = IRB.CreateOr(CmpEqZero, CmpEqOne, "or");
1139 IRB.CreateCondBr(Or, Tail, RethrowLongjmpBB);
1140 IRB.SetInsertPoint(Tail);
1145 Value *Cmp = IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp");
1146 IRB.CreateCondBr(Cmp, II->getUnwindDest(), II->getNormalDest());
1166 IRB.SetInsertPoint(RI);
1167 Value *Low = IRB.CreateExtractValue(Input, 0, "low");
1169 IRB.CreateCall(ResumeF, {Low});
1171 IRB.CreateUnreachable();
1189 IRB.SetInsertPoint(CI);
1191 IRB.CreateCall(EHTypeIDF, CI->getArgOperand(0), "typeid");
1208 IRB.SetInsertPoint(LPI);
1220 CallInst *FMCI = IRB.CreateCall(FMCF, FMCArgs, "fmc");
1222 Value *Pair0 = IRB.CreateInsertValue(Poison, FMCI, 0, "pair0");
1223 Value *TempRet0 = IRB.CreateCall(GetTempRet0F, std::nullopt, "tempret0");
1224 Value *Pair1 = IRB.CreateInsertValue(Pair0, TempRet0, 1, "pair1");
1262 IRBuilder<> IRB(C);
1271 IRB.SetInsertPoint(Entry->getTerminator()->getIterator());
1276 IRB.CreateAlloca(IRB.getInt32Ty(), nullptr, "functionInvocationId");
1309 IRB.SetInsertPoint(Tail, Tail->getFirstNonPHIIt());
1310 PHINode *SetjmpRet = IRB.CreatePHI(IRB.getInt32Ty(), 2, "setjmp.ret");
1313 SetjmpRet->addIncoming(IRB.getInt32(0), BB);
1322 IRB.SetInsertPoint(CI);
1323 Value *Args[] = {CI->getArgOperand(0), IRB.getInt32(SetjmpRetPHIs.size()),
1325 IRB.CreateCall(WasmSetjmpF, Args);
1362 IRBuilder<> IRB(C);
1482 IRB.SetInsertPoint(RethrowExnBB);
1484 IRB.CreateCall(getFindMatchingCatch(M, 0), {}, "exn");
1485 IRB.CreateCall(ResumeF, {Exn});
1486 IRB.CreateUnreachable();
1489 IRB.SetInsertPoint(CI);
1492 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp.eq.one");
1493 IRB.CreateCondBr(CmpEqOne, RethrowExnBB, NormalBB);
1495 IRB.SetInsertPoint(NormalBB);
1496 IRB.CreateBr(Tail);
1518 IRB.SetInsertPoint(EndBB);
1519 IRB.SetCurrentDebugLocation(EndBB->back().getDebugLoc());
1520 SwitchInst *SI = IRB.CreateSwitch(Label, Tail, SetjmpRetPHIs.size());
1526 SI->addCase(IRB.getInt32(I + 1), SetjmpRetPHIs[I]->getParent());
1557 IRBuilder<> IRB(C);
1566 FunctionType::get(IRB.getInt32Ty(), /* isVarArg */ true);
1569 cast<Constant>(IRB.CreateBitCast(PersF, IRB.getPtrTy())));
1575 IRB.SetCurrentDebugLocation(FirstDL);
1596 IRB.SetInsertPoint(CatchDispatchLongjmpBB);
1598 IRB.CreateCatchSwitch(ConstantTokenNone::get(C), nullptr, 1);
1603 IRB.SetInsertPoint(CatchLongjmpBB);
1604 CatchPadInst *CatchPad = IRB.CreateCatchPad(CatchSwitchLongjmp, {});
1611 IRB.CreateCall(CatchF, {IRB.getInt32(WebAssembly::C_LONGJMP)}, "thrown");
1613 IRB.CreateConstGEP2_32(LongjmpArgsTy, LongjmpArgs, 0, 0, "env_gep");
1615 IRB.CreateConstGEP2_32(LongjmpArgsTy, LongjmpArgs, 0, 1, "val_gep");
1617 Instruction *Env = IRB.CreateLoad(IRB.getPtrTy(), EnvField, "env");
1619 Instruction *Val = IRB.CreateLoad(IRB.getInt32Ty(), ValField, "val");
1627 Value *EnvP = IRB.CreateBitCast(Env, getAddrPtrType(&M), "env.p");
1628 Value *Label = IRB.CreateCall(WasmSetjmpTestF, {EnvP, FunctionInvocationId},
1630 Value *Cmp = IRB.CreateICmpEQ(Label, IRB.getInt32(0));
1631 IRB.CreateCondBr(Cmp, ThenBB, EndBB);
1633 IRB.SetInsertPoint(ThenBB);
1634 CallInst *WasmLongjmpCI = IRB.CreateCall(
1636 IRB.CreateUnreachable();
1638 IRB.SetInsertPoint(EndBB);
1640 IRB.CreateCatchRet(CatchPad, SetjmpDispatchBB);
1650 IRB.SetInsertPoint(SetjmpDispatchBB);
1651 PHINode *LabelPHI = IRB.CreatePHI(IRB.getInt32Ty(), 2, "label.phi");
1653 LabelPHI->addIncoming(IRB.getInt32(-1), Entry);
1654 SwitchInst *SI = IRB.CreateSwitch(LabelPHI, OrigEntry, SetjmpRetPHIs.size());
1660 SI->addCase(IRB.getInt32(I + 1), SetjmpRetPHIs[I]->getParent());
1734 IRB.SetInsertPoint(CSI);
1736 auto *NewCSI = IRB.CreateCatchSwitch(CSI->getParentPad(),
1746 IRB.SetInsertPoint(CRI);
1748 IRB.CreateCleanupRet(CRI->getCleanupPad(), CatchDispatchLongjmpBB);