[llvm-commits] [llvm] r46827 - MemOperands #2/2

Dan Gohman gohman at apple.com
Tue Feb 12 10:38:03 PST 2008


On Feb 12, 2008, at 12:12 AM, Evan Cheng wrote:
>>>
>>> +
>>> +    // Save loads/stores matched by a pattern.
>>> +    if (!N->isLeaf() && N->getName().empty()) {
>>> +      std::string EnumName = N->getOperator()- 
>>> >getValueAsString("Opcode");
>>> +      if (EnumName == "ISD::LOAD" ||
>>> +          EnumName == "ISD::STORE") {
>>> +        LSI.push_back(RootName);
>>> +      }
>>> +    }

> This doesn't seem safe. What if the pattern involves target specific  
> load / store nodes? Perhaps you can add a node property, e.g.  
> SDNPHasMemOp, to tell tblgen which operands would add memory  
> operands to the resulting target node?

The problem is that this code really needs an LSBaseSDNode. A target- 
specific
load/store won't have that. I'm looking for better ways to solve this.  
One way is
to require all target-specific load/store instructions to have  
patterns, and that
they must use ld/st/ist to describe their memory references. I'm not  
familiar enough
with all the targets yet to know if that's feasible.

Dan




More information about the llvm-commits mailing list