From: James Y Knight Date: Fri, 26 Feb 2021 15:33:24 +0000 (-0500) Subject: Fix assert to use getTypeStoreSize instead of getPrimitiveSizeInBits, X-Git-Tag: llvmorg-14-init~13943 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=740e69b6fdc2b1415065f3d20acc4d10a73edb00;p=platform%2Fupstream%2Fllvm.git Fix assert to use getTypeStoreSize instead of getPrimitiveSizeInBits, per comment on D97223. --- diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp index f04a8d2..85d38c4 100644 --- a/llvm/lib/CodeGen/AtomicExpandPass.cpp +++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp @@ -1034,7 +1034,8 @@ Value *AtomicExpand::insertRMWLLSCLoop( BasicBlock *BB = Builder.GetInsertBlock(); Function *F = BB->getParent(); - assert(AddrAlign >= ResultTy->getPrimitiveSizeInBits() / 8 && + assert(AddrAlign >= + F->getParent()->getDataLayout().getTypeStoreSize(ResultTy) && "Expected at least natural alignment at this point."); // Given: atomicrmw some_op iN* %addr, iN %incr ordering