mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 10:55:58 +08:00
[CodeGen] Drop some references to getInt8PtrTy. NFC
Similar to https://reviews.llvm.org/D157550
This commit is contained in:
@@ -200,7 +200,7 @@ Value *SjLjEHPrepare::setupFunctionContext(Function &F,
|
||||
Value *ExceptionAddr = Builder.CreateConstGEP2_32(doubleUnderDataTy, FCData,
|
||||
0, 0, "exception_gep");
|
||||
Value *ExnVal = Builder.CreateLoad(DataTy, ExceptionAddr, true, "exn_val");
|
||||
ExnVal = Builder.CreateIntToPtr(ExnVal, Builder.getInt8PtrTy());
|
||||
ExnVal = Builder.CreateIntToPtr(ExnVal, Builder.getPtrTy());
|
||||
|
||||
Value *SelectorAddr = Builder.CreateConstGEP2_32(doubleUnderDataTy, FCData,
|
||||
0, 1, "exn_selector_gep");
|
||||
@@ -218,9 +218,8 @@ Value *SjLjEHPrepare::setupFunctionContext(Function &F,
|
||||
Value *PersonalityFn = F.getPersonalityFn();
|
||||
Value *PersonalityFieldPtr = Builder.CreateConstGEP2_32(
|
||||
FunctionContextTy, FuncCtx, 0, 3, "pers_fn_gep");
|
||||
Builder.CreateStore(
|
||||
Builder.CreateBitCast(PersonalityFn, Builder.getInt8PtrTy()),
|
||||
PersonalityFieldPtr, /*isVolatile=*/true);
|
||||
Builder.CreateStore(Builder.CreateBitCast(PersonalityFn, Builder.getPtrTy()),
|
||||
PersonalityFieldPtr, /*isVolatile=*/true);
|
||||
|
||||
// LSDA address
|
||||
Value *LSDA = Builder.CreateCall(LSDAAddrFn, {}, "lsda_addr");
|
||||
@@ -418,7 +417,7 @@ bool SjLjEHPrepare::setupEntryBlockAndCallSites(Function &F) {
|
||||
|
||||
// Store a pointer to the function context so that the back-end will know
|
||||
// where to look for it.
|
||||
Value *FuncCtxArg = Builder.CreateBitCast(FuncCtx, Builder.getInt8PtrTy());
|
||||
Value *FuncCtxArg = Builder.CreateBitCast(FuncCtx, Builder.getPtrTy());
|
||||
Builder.CreateCall(FuncCtxFn, FuncCtxArg);
|
||||
|
||||
// At this point, we are all set up, update the invoke instructions to mark
|
||||
|
||||
@@ -418,7 +418,7 @@ static Value *getStackGuard(const TargetLoweringBase *TLI, Module *M,
|
||||
Value *Guard = TLI->getIRStackGuard(B);
|
||||
StringRef GuardMode = M->getStackProtectorGuard();
|
||||
if ((GuardMode == "tls" || GuardMode.empty()) && Guard)
|
||||
return B.CreateLoad(B.getInt8PtrTy(), Guard, true, "StackGuard");
|
||||
return B.CreateLoad(B.getPtrTy(), Guard, true, "StackGuard");
|
||||
|
||||
// Use SelectionDAG SSP handling, since there isn't an IR guard.
|
||||
//
|
||||
@@ -539,7 +539,7 @@ bool StackProtector::InsertStackProtectors() {
|
||||
// Generate the function-based epilogue instrumentation.
|
||||
// The target provides a guard check function, generate a call to it.
|
||||
IRBuilder<> B(CheckLoc);
|
||||
LoadInst *Guard = B.CreateLoad(B.getInt8PtrTy(), AI, true, "Guard");
|
||||
LoadInst *Guard = B.CreateLoad(B.getPtrTy(), AI, true, "Guard");
|
||||
CallInst *Call = B.CreateCall(GuardCheck, {Guard});
|
||||
Call->setAttributes(GuardCheck->getAttributes());
|
||||
Call->setCallingConv(GuardCheck->getCallingConv());
|
||||
@@ -578,7 +578,7 @@ bool StackProtector::InsertStackProtectors() {
|
||||
|
||||
IRBuilder<> B(CheckLoc);
|
||||
Value *Guard = getStackGuard(TLI, M, B);
|
||||
LoadInst *LI2 = B.CreateLoad(B.getInt8PtrTy(), AI, true);
|
||||
LoadInst *LI2 = B.CreateLoad(B.getPtrTy(), AI, true);
|
||||
auto *Cmp = cast<ICmpInst>(B.CreateICmpNE(Guard, LI2));
|
||||
auto SuccessProb =
|
||||
BranchProbabilityInfo::getBranchProbStackProtector(true);
|
||||
|
||||
@@ -136,9 +136,9 @@ FunctionPass *llvm::createWasmEHPass() { return new WasmEHPrepare(); }
|
||||
|
||||
bool WasmEHPrepare::doInitialization(Module &M) {
|
||||
IRBuilder<> IRB(M.getContext());
|
||||
LPadContextTy = StructType::get(IRB.getInt32Ty(), // lpad_index
|
||||
IRB.getInt8PtrTy(), // lsda
|
||||
IRB.getInt32Ty() // selector
|
||||
LPadContextTy = StructType::get(IRB.getInt32Ty(), // lpad_index
|
||||
IRB.getPtrTy(), // lsda
|
||||
IRB.getInt32Ty() // selector
|
||||
);
|
||||
return false;
|
||||
}
|
||||
@@ -249,8 +249,8 @@ bool WasmEHPrepare::prepareEHPads(Function &F) {
|
||||
CatchF = Intrinsic::getDeclaration(&M, Intrinsic::wasm_catch);
|
||||
|
||||
// _Unwind_CallPersonality() wrapper function, which calls the personality
|
||||
CallPersonalityF = M.getOrInsertFunction(
|
||||
"_Unwind_CallPersonality", IRB.getInt32Ty(), IRB.getInt8PtrTy());
|
||||
CallPersonalityF = M.getOrInsertFunction("_Unwind_CallPersonality",
|
||||
IRB.getInt32Ty(), IRB.getPtrTy());
|
||||
if (Function *F = dyn_cast<Function>(CallPersonalityF.getCallee()))
|
||||
F->setDoesNotThrow();
|
||||
|
||||
|
||||
@@ -457,7 +457,7 @@ static Value *getAllocaPos(BasicBlock *BB) {
|
||||
BasicBlock::iterator Iter = AllocaRes->getIterator();
|
||||
++Iter;
|
||||
Builder.SetInsertPoint(&*Iter);
|
||||
Value *I8Ptr = Builder.CreateBitCast(AllocaRes, Builder.getInt8PtrTy());
|
||||
Value *I8Ptr = Builder.CreateBitCast(AllocaRes, Builder.getPtrTy());
|
||||
return I8Ptr;
|
||||
}
|
||||
|
||||
@@ -934,8 +934,7 @@ bool X86LowerAMXCast::combineCastStore(IntrinsicInst *Cast, StoreInst *ST) {
|
||||
IRBuilder<> Builder(ST);
|
||||
// Stride should be equal to col(measured by bytes)
|
||||
Value *Stride = Builder.CreateSExt(Col, Builder.getInt64Ty());
|
||||
Value *I8Ptr =
|
||||
Builder.CreateBitCast(ST->getOperand(1), Builder.getInt8PtrTy());
|
||||
Value *I8Ptr = Builder.CreateBitCast(ST->getOperand(1), Builder.getPtrTy());
|
||||
std::array<Value *, 5> Args = {Row, Col, I8Ptr, Stride, Tile};
|
||||
Builder.CreateIntrinsic(Intrinsic::x86_tilestored64_internal, std::nullopt,
|
||||
Args);
|
||||
@@ -975,10 +974,10 @@ bool X86LowerAMXCast::combineLoadCast(IntrinsicInst *Cast, LoadInst *LD) {
|
||||
Builder.CreateStore(LD, AllocaAddr);
|
||||
|
||||
Builder.SetInsertPoint(Cast);
|
||||
I8Ptr = Builder.CreateBitCast(AllocaAddr, Builder.getInt8PtrTy());
|
||||
I8Ptr = Builder.CreateBitCast(AllocaAddr, Builder.getPtrTy());
|
||||
EraseLoad = false;
|
||||
} else {
|
||||
I8Ptr = Builder.CreateBitCast(LD->getOperand(0), Builder.getInt8PtrTy());
|
||||
I8Ptr = Builder.CreateBitCast(LD->getOperand(0), Builder.getPtrTy());
|
||||
}
|
||||
std::array<Value *, 4> Args = {Row, Col, I8Ptr, Stride};
|
||||
|
||||
@@ -1137,7 +1136,7 @@ bool X86LowerAMXCast::transformAMXCast(IntrinsicInst *AMXCast) {
|
||||
|
||||
auto Prepare = [&](Type *MemTy) {
|
||||
AllocaAddr = createAllocaInstAtEntry(Builder, AMXCast->getParent(), MemTy);
|
||||
I8Ptr = Builder.CreateBitCast(AllocaAddr, Builder.getInt8PtrTy());
|
||||
I8Ptr = Builder.CreateBitCast(AllocaAddr, Builder.getPtrTy());
|
||||
Stride = Builder.getInt64(64);
|
||||
};
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ void WinEHStatePass::emitExceptionRegistrationRecord(Function *F) {
|
||||
Type *RegNodeTy;
|
||||
|
||||
IRBuilder<> Builder(&F->getEntryBlock(), F->getEntryBlock().begin());
|
||||
Type *Int8PtrType = Builder.getInt8PtrTy();
|
||||
Type *Int8PtrType = Builder.getPtrTy();
|
||||
Type *Int32Ty = Builder.getInt32Ty();
|
||||
Type *VoidTy = Builder.getVoidTy();
|
||||
|
||||
@@ -336,7 +336,7 @@ void WinEHStatePass::emitExceptionRegistrationRecord(Function *F) {
|
||||
Value *FrameAddr = Builder.CreateCall(
|
||||
Intrinsic::getDeclaration(
|
||||
TheModule, Intrinsic::frameaddress,
|
||||
Builder.getInt8PtrTy(
|
||||
Builder.getPtrTy(
|
||||
TheModule->getDataLayout().getAllocaAddrSpace())),
|
||||
Builder.getInt32(0), "frameaddr");
|
||||
Value *FrameAddrI32 = Builder.CreatePtrToInt(FrameAddr, Int32Ty);
|
||||
@@ -475,7 +475,7 @@ void WinEHStatePass::rewriteSetJmpCall(IRBuilder<> &Builder, Function &F,
|
||||
|
||||
SmallVector<Value *, 5> Args;
|
||||
Args.push_back(
|
||||
Builder.CreateBitCast(Call.getArgOperand(0), Builder.getInt8PtrTy()));
|
||||
Builder.CreateBitCast(Call.getArgOperand(0), Builder.getPtrTy()));
|
||||
Args.push_back(Builder.getInt32(OptionalArgs.size()));
|
||||
Args.append(OptionalArgs.begin(), OptionalArgs.end());
|
||||
|
||||
@@ -622,7 +622,7 @@ void WinEHStatePass::addStateStores(Function &F, WinEHFuncInfo &FuncInfo) {
|
||||
// Mark the registration node. The backend needs to know which alloca it is so
|
||||
// that it can recover the original frame pointer.
|
||||
IRBuilder<> Builder(RegNode->getNextNode());
|
||||
Value *RegNodeI8 = Builder.CreateBitCast(RegNode, Builder.getInt8PtrTy());
|
||||
Value *RegNodeI8 = Builder.CreateBitCast(RegNode, Builder.getPtrTy());
|
||||
Builder.CreateCall(
|
||||
Intrinsic::getDeclaration(TheModule, Intrinsic::x86_seh_ehregnode),
|
||||
{RegNodeI8});
|
||||
@@ -630,7 +630,7 @@ void WinEHStatePass::addStateStores(Function &F, WinEHFuncInfo &FuncInfo) {
|
||||
if (EHGuardNode) {
|
||||
IRBuilder<> Builder(EHGuardNode->getNextNode());
|
||||
Value *EHGuardNodeI8 =
|
||||
Builder.CreateBitCast(EHGuardNode, Builder.getInt8PtrTy());
|
||||
Builder.CreateBitCast(EHGuardNode, Builder.getPtrTy());
|
||||
Builder.CreateCall(
|
||||
Intrinsic::getDeclaration(TheModule, Intrinsic::x86_seh_ehguard),
|
||||
{EHGuardNodeI8});
|
||||
|
||||
Reference in New Issue
Block a user