On Feb 12, 2008, at 10:38 AM, Dan Gohman wrote: > > 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.
Ok, then please just add a SDNPHasMemOp and mark ld, st, and ist with it. tblgen should look for that property instead of EnumName. I don't think there are target specific load / store nodes that might be impacted at this tme. Evan > > > Dan > _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits