[PATCH] D68417: [MachineVerify] Verify property of atomic G_LOAD/STORE variants
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 3 13:11:23 PDT 2019
reames created this revision.
reames added reviewers: aemerson, dsanders, arsenm.
Herald added subscribers: jfb, bollu, wdng, mcrosier.
Herald added a project: LLVM.
More or less directly copied from IR/Verifier.cpp.
Repository:
rL LLVM
https://reviews.llvm.org/D68417
Files:
lib/CodeGen/MachineVerifier.cpp
Index: lib/CodeGen/MachineVerifier.cpp
===================================================================
--- lib/CodeGen/MachineVerifier.cpp
+++ lib/CodeGen/MachineVerifier.cpp
@@ -1031,6 +1031,13 @@
if (ValTy.getSizeInBytes() < MMO.getSize())
report("store memory size cannot exceed value size", MI);
}
+
+ if (MMO.isAtomic()) {
+ if (MMO.getAlignment() == 0)
+ report("Atomics must have explicit alignment", MI);
+ if (ValTy.isVector())
+ report("atomic operations can't have vector type", MI);
+ }
}
break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68417.223078.patch
Type: text/x-patch
Size: 593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191003/a9c7db82/attachment.bin>
More information about the llvm-commits
mailing list