Lines Matching refs:IRB
469 IRBuilder<> IRB(M->getContext()); in getAddrIntType() local
470 return IRB.getIntNTy(M->getDataLayout().getPointerSizeInBits()); in getAddrIntType()
484 IRBuilder<> IRB(M->getContext()); in getAddrSizeInt() local
485 return IRB.getIntN(M->getDataLayout().getPointerSizeInBits(), C); in getAddrSizeInt()
518 IRBuilder<> IRB(C); in wrapInvoke() local
519 IRB.SetInsertPoint(CI); in wrapInvoke()
523 IRB.CreateStore(getAddrSizeInt(M, 0), ThrewGV); in wrapInvoke()
531 CallInst *NewCall = IRB.CreateCall(getInvokeWrapper(CI), Args); in wrapInvoke()
573 IRB.CreateLoad(getAddrIntType(M), ThrewGV, ThrewGV->getName() + ".val"); in wrapInvoke()
574 IRB.CreateStore(getAddrSizeInt(M, 0), ThrewGV); in wrapInvoke()
714 IRBuilder<> IRB(C); in wrapTestSetjmp() local
715 IRB.SetCurrentDebugLocation(DL); in wrapTestSetjmp()
718 IRB.SetInsertPoint(BB); in wrapTestSetjmp()
722 Value *ThrewCmp = IRB.CreateICmpNE(Threw, getAddrSizeInt(M, 0)); in wrapTestSetjmp()
723 Value *ThrewValue = IRB.CreateLoad(IRB.getInt32Ty(), ThrewValueGV, in wrapTestSetjmp()
725 Value *ThrewValueCmp = IRB.CreateICmpNE(ThrewValue, IRB.getInt32(0)); in wrapTestSetjmp()
726 Value *Cmp1 = IRB.CreateAnd(ThrewCmp, ThrewValueCmp, "cmp1"); in wrapTestSetjmp()
727 IRB.CreateCondBr(Cmp1, ThenBB1, ElseBB1); in wrapTestSetjmp()
733 IRB.SetInsertPoint(CallEmLongjmpBB); in wrapTestSetjmp()
734 CallEmLongjmpBBThrewPHI = IRB.CreatePHI(getAddrIntType(M), 4, "threw.phi"); in wrapTestSetjmp()
736 IRB.CreatePHI(IRB.getInt32Ty(), 4, "threwvalue.phi"); in wrapTestSetjmp()
739 IRB.CreateCall(EmLongjmpF, in wrapTestSetjmp()
741 IRB.CreateUnreachable(); in wrapTestSetjmp()
749 IRB.SetInsertPoint(ThenBB1); in wrapTestSetjmp()
752 IRB.CreateIntToPtr(Threw, getAddrPtrType(M), Threw->getName() + ".p"); in wrapTestSetjmp()
753 Value *LoadedThrew = IRB.CreateLoad(getAddrIntType(M), ThrewPtr, in wrapTestSetjmp()
755 Value *ThenLabel = IRB.CreateCall( in wrapTestSetjmp()
757 Value *Cmp2 = IRB.CreateICmpEQ(ThenLabel, IRB.getInt32(0)); in wrapTestSetjmp()
758 IRB.CreateCondBr(Cmp2, CallEmLongjmpBB, EndBB2); in wrapTestSetjmp()
761 IRB.SetInsertPoint(EndBB2); in wrapTestSetjmp()
762 IRB.CreateCall(SetTempRet0F, ThrewValue); in wrapTestSetjmp()
763 IRB.CreateBr(EndBB1); in wrapTestSetjmp()
765 IRB.SetInsertPoint(ElseBB1); in wrapTestSetjmp()
766 IRB.CreateBr(EndBB1); in wrapTestSetjmp()
769 IRB.SetInsertPoint(EndBB1); in wrapTestSetjmp()
770 PHINode *LabelPHI = IRB.CreatePHI(IRB.getInt32Ty(), 2, "label"); in wrapTestSetjmp()
773 LabelPHI->addIncoming(IRB.getInt32(-1), ElseBB1); in wrapTestSetjmp()
778 LongjmpResult = IRB.CreateCall(GetTempRet0F, None, "longjmp_result"); in wrapTestSetjmp()
823 IRBuilder<> IRB(C); in replaceLongjmpWith() local
830 IRB.SetInsertPoint(CI); in replaceLongjmpWith()
834 IRB.CreatePtrToInt(CI->getArgOperand(0), getAddrIntType(M), "env"); in replaceLongjmpWith()
837 IRB.CreateBitCast(CI->getArgOperand(0), IRB.getInt8PtrTy(), "env"); in replaceLongjmpWith()
838 IRB.CreateCall(NewF, {Env, CI->getArgOperand(1)}); in replaceLongjmpWith()
849 IRB.CreateBitCast(NewF, LongjmpF->getType(), "longjmp.cast"); in replaceLongjmpWith()
869 IRBuilder<> IRB(M.getContext()); in nullifySetjmp() local
885 CI->replaceAllUsesWith(IRB.getInt32(0)); in nullifySetjmp()
895 IRBuilder<> IRB(C); in runOnModule() local
935 ThrewValueGV = getGlobalVariable(M, IRB.getInt32Ty(), TM, "__threwValue"); in runOnModule()
937 FunctionType::get(IRB.getInt32Ty(), false), "getTempRet0", &M); in runOnModule()
939 FunctionType::get(IRB.getVoidTy(), IRB.getInt32Ty(), false), in runOnModule()
950 FunctionType::get(IRB.getVoidTy(), IRB.getInt8PtrTy(), false); in runOnModule()
956 FunctionType::get(IRB.getInt32Ty(), IRB.getInt8PtrTy(), false); in runOnModule()
996 IRB.getVoidTy(), {getAddrIntType(&M), IRB.getInt32Ty()}, false); in runOnModule()
1002 IRB.getVoidTy(), {IRB.getInt8PtrTy(), IRB.getInt32Ty()}, false); in runOnModule()
1012 {SetjmpFTy->getParamType(0), IRB.getInt32Ty(), in runOnModule()
1013 Type::getInt32PtrTy(C), IRB.getInt32Ty()}, in runOnModule()
1019 IRB.getInt32Ty(), in runOnModule()
1020 {getAddrIntType(&M), Type::getInt32PtrTy(C), IRB.getInt32Ty()}, in runOnModule()
1028 LongjmpArgsTy = StructType::get(IRB.getInt8PtrTy(), // env in runOnModule()
1029 IRB.getInt32Ty() // val in runOnModule()
1078 IRBuilder<> IRB(C); in runEHOnFunction() local
1095 IRB.SetInsertPoint(II); in runEHOnFunction()
1129 IRB.SetInsertPoint(RethrowLongjmpBB); in runEHOnFunction()
1131 IRB.CreatePHI(getAddrIntType(&M), 4, "threw.phi"); in runEHOnFunction()
1133 Value *ThrewValue = IRB.CreateLoad(IRB.getInt32Ty(), ThrewValueGV, in runEHOnFunction()
1135 IRB.CreateCall(EmLongjmpF, {RethrowLongjmpBBThrewPHI, ThrewValue}); in runEHOnFunction()
1136 IRB.CreateUnreachable(); in runEHOnFunction()
1141 IRB.SetInsertPoint(II); // Restore the insert point back in runEHOnFunction()
1144 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp.eq.one"); in runEHOnFunction()
1146 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 0), "cmp.eq.zero"); in runEHOnFunction()
1147 Value *Or = IRB.CreateOr(CmpEqZero, CmpEqOne, "or"); in runEHOnFunction()
1148 IRB.CreateCondBr(Or, Tail, RethrowLongjmpBB); in runEHOnFunction()
1149 IRB.SetInsertPoint(Tail); in runEHOnFunction()
1154 Value *Cmp = IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp"); in runEHOnFunction()
1155 IRB.CreateCondBr(Cmp, II->getUnwindDest(), II->getNormalDest()); in runEHOnFunction()
1175 IRB.SetInsertPoint(RI); in runEHOnFunction()
1176 Value *Low = IRB.CreateExtractValue(Input, 0, "low"); in runEHOnFunction()
1178 IRB.CreateCall(ResumeF, {Low}); in runEHOnFunction()
1180 IRB.CreateUnreachable(); in runEHOnFunction()
1198 IRB.SetInsertPoint(CI); in runEHOnFunction()
1200 IRB.CreateCall(EHTypeIDF, CI->getArgOperand(0), "typeid"); in runEHOnFunction()
1217 IRB.SetInsertPoint(LPI); in runEHOnFunction()
1229 CallInst *FMCI = IRB.CreateCall(FMCF, FMCArgs, "fmc"); in runEHOnFunction()
1231 Value *Pair0 = IRB.CreateInsertValue(Undef, FMCI, 0, "pair0"); in runEHOnFunction()
1232 Value *TempRet0 = IRB.CreateCall(GetTempRet0F, None, "tempret0"); in runEHOnFunction()
1233 Value *Pair1 = IRB.CreateInsertValue(Pair0, TempRet0, 1, "pair1"); in runEHOnFunction()
1271 IRBuilder<> IRB(C); in runSjLjOnFunction() local
1289 BinaryOperator::Create(Instruction::Add, IRB.getInt32(4), IRB.getInt32(0), in runSjLjOnFunction()
1294 SetjmpTableSize, IRB.getInt32Ty(), IRB.getInt32Ty(), IRB.getInt32(40), in runSjLjOnFunction()
1304 IRB.SetInsertPoint(SetjmpTableSize); in runSjLjOnFunction()
1305 IRB.CreateStore(IRB.getInt32(0), SetjmpTable); in runSjLjOnFunction()
1339 IRB.SetInsertPoint(Tail->getFirstNonPHI()); in runSjLjOnFunction()
1340 PHINode *SetjmpRet = IRB.CreatePHI(IRB.getInt32Ty(), 2, "setjmp.ret"); in runSjLjOnFunction()
1343 SetjmpRet->addIncoming(IRB.getInt32(0), BB); in runSjLjOnFunction()
1352 IRB.SetInsertPoint(CI); in runSjLjOnFunction()
1353 Value *Args[] = {CI->getArgOperand(0), IRB.getInt32(SetjmpRetPHIs.size()), in runSjLjOnFunction()
1356 IRB.CreateCall(SaveSetjmpF, Args, "setjmpTable"); in runSjLjOnFunction()
1358 IRB.CreateCall(GetTempRet0F, None, "setjmpTableSize"); in runSjLjOnFunction()
1467 IRBuilder<> IRB(C); in handleLongjmpableCallsForEmscriptenSjLj() local
1595 IRB.SetInsertPoint(RethrowExnBB); in handleLongjmpableCallsForEmscriptenSjLj()
1597 IRB.CreateCall(getFindMatchingCatch(M, 0), {}, "exn"); in handleLongjmpableCallsForEmscriptenSjLj()
1598 IRB.CreateCall(ResumeF, {Exn}); in handleLongjmpableCallsForEmscriptenSjLj()
1599 IRB.CreateUnreachable(); in handleLongjmpableCallsForEmscriptenSjLj()
1602 IRB.SetInsertPoint(CI); in handleLongjmpableCallsForEmscriptenSjLj()
1605 IRB.CreateICmpEQ(Threw, getAddrSizeInt(&M, 1), "cmp.eq.one"); in handleLongjmpableCallsForEmscriptenSjLj()
1606 IRB.CreateCondBr(CmpEqOne, RethrowExnBB, NormalBB); in handleLongjmpableCallsForEmscriptenSjLj()
1608 IRB.SetInsertPoint(NormalBB); in handleLongjmpableCallsForEmscriptenSjLj()
1609 IRB.CreateBr(Tail); in handleLongjmpableCallsForEmscriptenSjLj()
1632 IRB.SetInsertPoint(EndBB); in handleLongjmpableCallsForEmscriptenSjLj()
1633 IRB.SetCurrentDebugLocation(EndBB->getInstList().back().getDebugLoc()); in handleLongjmpableCallsForEmscriptenSjLj()
1634 SwitchInst *SI = IRB.CreateSwitch(Label, Tail, SetjmpRetPHIs.size()); in handleLongjmpableCallsForEmscriptenSjLj()
1640 SI->addCase(IRB.getInt32(I + 1), SetjmpRetPHIs[I]->getParent()); in handleLongjmpableCallsForEmscriptenSjLj()
1671 IRBuilder<> IRB(C); in handleLongjmpableCallsForWasmSjLj() local
1680 FunctionType::get(IRB.getInt32Ty(), /* isVarArg */ true); in handleLongjmpableCallsForWasmSjLj()
1683 cast<Constant>(IRB.CreateBitCast(PersF, IRB.getInt8PtrTy()))); in handleLongjmpableCallsForWasmSjLj()
1689 IRB.SetCurrentDebugLocation(FirstDL); in handleLongjmpableCallsForWasmSjLj()
1715 IRB.SetInsertPoint(CatchDispatchLongjmpBB); in handleLongjmpableCallsForWasmSjLj()
1717 IRB.CreateCatchSwitch(ConstantTokenNone::get(C), nullptr, 1); in handleLongjmpableCallsForWasmSjLj()
1722 IRB.SetInsertPoint(CatchLongjmpBB); in handleLongjmpableCallsForWasmSjLj()
1723 CatchPadInst *CatchPad = IRB.CreateCatchPad(CatchSwitchLongjmp, {}); in handleLongjmpableCallsForWasmSjLj()
1730 IRB.CreateCall(CatchF, {IRB.getInt32(WebAssembly::C_LONGJMP)}, "thrown"); in handleLongjmpableCallsForWasmSjLj()
1732 IRB.CreateBitCast(CatchCI, LongjmpArgsTy->getPointerTo(), "longjmp.args"); in handleLongjmpableCallsForWasmSjLj()
1734 IRB.CreateConstGEP2_32(LongjmpArgsTy, LongjmpArgs, 0, 0, "env_gep"); in handleLongjmpableCallsForWasmSjLj()
1736 IRB.CreateConstGEP2_32(LongjmpArgsTy, LongjmpArgs, 0, 1, "val_gep"); in handleLongjmpableCallsForWasmSjLj()
1738 Instruction *Env = IRB.CreateLoad(IRB.getInt8PtrTy(), EnvField, "env"); in handleLongjmpableCallsForWasmSjLj()
1740 Instruction *Val = IRB.CreateLoad(IRB.getInt32Ty(), ValField, "val"); in handleLongjmpableCallsForWasmSjLj()
1748 Value *EnvP = IRB.CreateBitCast(Env, getAddrPtrType(&M), "env.p"); in handleLongjmpableCallsForWasmSjLj()
1749 Value *SetjmpID = IRB.CreateLoad(getAddrIntType(&M), EnvP, "setjmp.id"); in handleLongjmpableCallsForWasmSjLj()
1751 IRB.CreateCall(TestSetjmpF, {SetjmpID, SetjmpTable, SetjmpTableSize}, in handleLongjmpableCallsForWasmSjLj()
1753 Value *Cmp = IRB.CreateICmpEQ(Label, IRB.getInt32(0)); in handleLongjmpableCallsForWasmSjLj()
1754 IRB.CreateCondBr(Cmp, ThenBB, EndBB); in handleLongjmpableCallsForWasmSjLj()
1756 IRB.SetInsertPoint(ThenBB); in handleLongjmpableCallsForWasmSjLj()
1757 CallInst *WasmLongjmpCI = IRB.CreateCall( in handleLongjmpableCallsForWasmSjLj()
1759 IRB.CreateUnreachable(); in handleLongjmpableCallsForWasmSjLj()
1761 IRB.SetInsertPoint(EndBB); in handleLongjmpableCallsForWasmSjLj()
1763 IRB.CreateCatchRet(CatchPad, SetjmpDispatchBB); in handleLongjmpableCallsForWasmSjLj()
1773 IRB.SetInsertPoint(SetjmpDispatchBB); in handleLongjmpableCallsForWasmSjLj()
1774 PHINode *LabelPHI = IRB.CreatePHI(IRB.getInt32Ty(), 2, "label.phi"); in handleLongjmpableCallsForWasmSjLj()
1776 LabelPHI->addIncoming(IRB.getInt32(-1), Entry); in handleLongjmpableCallsForWasmSjLj()
1777 SwitchInst *SI = IRB.CreateSwitch(LabelPHI, OrigEntry, SetjmpRetPHIs.size()); in handleLongjmpableCallsForWasmSjLj()
1783 SI->addCase(IRB.getInt32(I + 1), SetjmpRetPHIs[I]->getParent()); in handleLongjmpableCallsForWasmSjLj()
1857 IRB.SetInsertPoint(CSI); in handleLongjmpableCallsForWasmSjLj()
1859 auto *NewCSI = IRB.CreateCatchSwitch(CSI->getParentPad(), in handleLongjmpableCallsForWasmSjLj()
1869 IRB.SetInsertPoint(CRI); in handleLongjmpableCallsForWasmSjLj()
1871 IRB.CreateCleanupRet(CRI->getCleanupPad(), CatchDispatchLongjmpBB); in handleLongjmpableCallsForWasmSjLj()