Skip to content

Commit

Permalink
[RISCV] Remove unnecessary cast to i8* when converting gather/scatter…
Browse files Browse the repository at this point in the history
… to strided load/store.

Not sure why I thought this necessary at the time.
  • Loading branch information
topperc committed Apr 10, 2022
1 parent 4d87344 commit 4e561a5
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 109 deletions.
7 changes: 0 additions & 7 deletions llvm/lib/Target/RISCV/RISCVGatherScatterLowering.cpp
Expand Up @@ -387,13 +387,6 @@ RISCVGatherScatterLowering::determineBaseAndStride(GetElementPtrInst *GEP,
Value *BasePtr =
Builder.CreateGEP(SourceTy, Ops[0], makeArrayRef(Ops).drop_front());

// Cast the GEP to an i8*.
LLVMContext &Ctx = GEP->getContext();
Type *I8PtrTy =
Type::getInt8PtrTy(Ctx, GEP->getType()->getPointerAddressSpace());
if (BasePtr->getType() != I8PtrTy)
BasePtr = Builder.CreatePointerCast(BasePtr, I8PtrTy);

// Final adjustments to stride should go in the start block.
Builder.SetInsertPoint(
BasePhi->getIncomingBlock(1 - IncrementingBlock)->getTerminator());
Expand Down

0 comments on commit 4e561a5

Please sign in to comment.