See bug 35730: https://bugs.llvm.org/show_bug.cgi?id=35730
Added a few negative tests and one positive.
Note that the following code is assembled ok, though 'glc' is omitted:
flat_atomic_cmpswap v0, v[1:2], v[3:4]
This is due to the way llvm handles optional operands. In this case tablegen-generated operand matcher tries to match (expected) 'offset' to an empty list of actual operands and failed doing that. However 'offset' is an optional operand so the match is considered successful.
This would not be easy to fix, and I think we should presume this a 'feature' :-)