Fix assert to use getTypeStoreSize instead of getPrimitiveSizeInBits,
authorJames Y Knight <jyknight@google.com>
Fri, 26 Feb 2021 15:33:24 +0000 (10:33 -0500)
committerJames Y Knight <jyknight@google.com>
Fri, 26 Feb 2021 16:08:00 +0000 (11:08 -0500)
per comment on D97223.

llvm/lib/CodeGen/AtomicExpandPass.cpp

index f04a8d2..85d38c4 100644 (file)
@@ -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