[LLVMdev] Metadata [volatile bug?]

Dan Gohman gohman at apple.com
Thu Feb 11 18:05:25 PST 2010

On Feb 11, 2010, at 3:15 PM, David Greene wrote:

> On Thursday 11 February 2010 14:44:23 Dan Gohman wrote:
>>> Then we can't use it to hold a non-temporal flag.  The operand might be
>>> non-temporal in one context but it may not be in another.
>> Sharing only happens when two instructions have the "same" memory
>> reference info. You just need to make sure that the non-temporal
>> flag is significant. It's not fundamentally different from the
>> volatile flag in this respect.
> Ok, this sounds right, but this look wrong:
> /// Abstact virtual class for operations for memory operations
> class MemSDNode : public SDNode {
> [...]
>  bool isVolatile() const { return (SubclassData >> 5) & 1; }
> Shouldn't that be MMO->isVolatile()?

It's not a bug; the code could be written either way. There's actually
an assert in MemSDNode's constructor which checks that they're the
same. I believe the code is structured this way because it makes it
easy to lump the volatile flag in with other data which is
significant for CSE purposes, but it's not critical that it work
that way.


More information about the llvm-dev mailing list