[LLVMdev] Early-clobber constraint in TableGen
dag at cray.com
Tue Dec 15 17:08:55 PST 2009
On Tuesday 15 December 2009 18:01, Jim Grosbach wrote:
> For a usage example, I've included in the patch the modification to
> use the constraint for the STREX ARM instruction.
Your example is:
constraints = "@early $success"
Why not spell it as:
constraints = "$success != $src", "$success != $ptr"
The grammar would change to something like:
constraint: operand '!=' operand
| operand '=' operand
This seems more intuitive and more generally applicable. I could see a use
for this in other architectures. From reading your example, without the
background I wouldn't know what "@early" means.
It may be slightly more difficult to code up for TableGen but in the long
term it's worth it.
More information about the llvm-dev