[llvm] 740e69b - Fix assert to use getTypeStoreSize instead of getPrimitiveSizeInBits,
James Y Knight via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 08:08:19 PST 2021
Author: James Y Knight
Date: 2021-02-26T11:08:00-05:00
New Revision: 740e69b6fdc2b1415065f3d20acc4d10a73edb00
URL: https://github.com/llvm/llvm-project/commit/740e69b6fdc2b1415065f3d20acc4d10a73edb00
DIFF: https://github.com/llvm/llvm-project/commit/740e69b6fdc2b1415065f3d20acc4d10a73edb00.diff
LOG: Fix assert to use getTypeStoreSize instead of getPrimitiveSizeInBits,
per comment on D97223.
Added:
Modified:
llvm/lib/CodeGen/AtomicExpandPass.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index f04a8d25ec1b..85d38c4983eb 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
More information about the llvm-commits
mailing list