[llvm] cd11312 - [NFC][Verifier] Remove checks for atomic loads/stores that alignment is non-zero

Arthur Eubanks via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 23:20:27 PST 2021


Author: Arthur Eubanks
Date: 2021-12-08T23:17:08-08:00
New Revision: cd11312607f86d53fff1f3de138dba3673366c85

URL: https://github.com/llvm/llvm-project/commit/cd11312607f86d53fff1f3de138dba3673366c85
DIFF: https://github.com/llvm/llvm-project/commit/cd11312607f86d53fff1f3de138dba3673366c85.diff

LOG: [NFC][Verifier] Remove checks for atomic loads/stores that alignment is non-zero

The alignment is never 0 since getAlign() returns 1 << bits.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D115388

Added: 
    

Modified: 
    llvm/lib/IR/Verifier.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 8d3fd4ec0fa8b..32573262ca2d5 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -3742,8 +3742,6 @@ void Verifier::visitLoadInst(LoadInst &LI) {
     Assert(LI.getOrdering() != AtomicOrdering::Release &&
                LI.getOrdering() != AtomicOrdering::AcquireRelease,
            "Load cannot have Release ordering", &LI);
-    Assert(LI.getAlignment() != 0,
-           "Atomic load must specify explicit alignment", &LI);
     Assert(ElTy->isIntOrPtrTy() || ElTy->isFloatingPointTy(),
            "atomic load operand must have integer, pointer, or floating point "
            "type!",
@@ -3770,8 +3768,6 @@ void Verifier::visitStoreInst(StoreInst &SI) {
     Assert(SI.getOrdering() != AtomicOrdering::Acquire &&
                SI.getOrdering() != AtomicOrdering::AcquireRelease,
            "Store cannot have Acquire ordering", &SI);
-    Assert(SI.getAlignment() != 0,
-           "Atomic store must specify explicit alignment", &SI);
     Assert(ElTy->isIntOrPtrTy() || ElTy->isFloatingPointTy(),
            "atomic store operand must have integer, pointer, or floating point "
            "type!",


        


More information about the llvm-commits mailing list