Skip to content

Commit

Permalink
Merge pull request #111 from frasercrmck/memcpy-memset-always-i8
Browse files Browse the repository at this point in the history
[vecz] Remove checks for non-i8 memcpy/memsets
  • Loading branch information
frasercrmck authored Aug 29, 2023
2 parents 83c5022 + 9dc1baa commit 678ee7d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 100 deletions.
23 changes: 0 additions & 23 deletions modules/compiler/vecz/source/transform/builtin_inlining_pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,6 @@ static Value *emitBuiltinMemSet(Function *F, IRBuilder<> &B,
Value *DstPtr = Args[0];
Type *Int8Ty = B.getInt8Ty();

#if LLVM_VERSION_LESS(17, 0)
auto *DstPtrTy = cast<PointerType>(DstPtr->getType());
// FIXME: We implicitly assume pointers to i8 by doing byte-wise stores,
// below. See CA-4331.
if (!DstPtrTy->isOpaque() &&
multi_llvm::getPtrElementType(DstPtrTy) != Int8Ty) {
return nullptr;
}
#endif

Value *StoredValue = Args[1];
bool IsVolatile = (Args.back() == ConstantInt::getTrue(Context));
llvm::StoreInst *MS = nullptr;
Expand Down Expand Up @@ -214,19 +204,6 @@ static Value *emitBuiltinMemCpy(Function *F, IRBuilder<> &B,
Value *SrcPtr = Args[1];
Type *Int8Ty = B.getInt8Ty();

#if LLVM_VERSION_LESS(17, 0)
auto *DstPtrTy = cast<PointerType>(DstPtr->getType());
auto *SrcPtrTy = cast<PointerType>(DstPtr->getType());
// FIXME: We implicitly assume pointers to i8 by doing byte-wise loads and
// stores, below. See CA-4331.
if ((!DstPtrTy->isOpaque() &&
multi_llvm::getPtrElementType(DstPtrTy) != Int8Ty) ||
((!SrcPtrTy->isOpaque() &&
multi_llvm::getPtrElementType(SrcPtrTy) != Int8Ty))) {
return nullptr;
}
#endif

bool IsVolatile = (Args.back() == ConstantInt::getTrue(Context));
llvm::StoreInst *MC = nullptr;

Expand Down
77 changes: 0 additions & 77 deletions modules/compiler/vecz/test/lit/llvm/builtin_inlining_mem.ll

This file was deleted.

0 comments on commit 678ee7d

Please sign in to comment.