MemoryBuiltins: getAllocAlignment is now useful for non-allocator funcs

This has been true since dba73135c8, but
didn't matter until now because clang wasn't emitting allocalign
attributes.

Differential Revision: https://reviews.llvm.org/D121640
This commit is contained in:
Augie Fackler 2022-03-14 15:21:04 -04:00
parent 538c77172a
commit 33b1f41914
1 changed files with 0 additions and 2 deletions

View File

@ -334,8 +334,6 @@ bool llvm::isAllocRemovable(const CallBase *CB, const TargetLibraryInfo *TLI) {
Value *llvm::getAllocAlignment(const CallBase *V,
const TargetLibraryInfo *TLI) {
assert(isAllocationFn(V, TLI));
const Optional<AllocFnsTy> FnData = getAllocationData(V, AnyAlloc, TLI);
if (FnData.hasValue() && FnData->AlignParam >= 0) {
return V->getOperand(FnData->AlignParam);