https://llvm.org/bugs/show_bug.cgi?id=31393
Kevin W. Harris <kevin.har...@unisys.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #3 from Kevin W. Harris <kevin.har...@unisys.com> --- I forgot to mention - these mdXXX values (mdData, mdControl, mdMemory, mdGRS, ...) are used in the calls to setMetadata() for the various load and store operations that we generate. Anyway, thanks for the hint, I finally figured out the proper change to our code sequence. The Upgrade call for mdData can't be eliminated altogether, because we use it directly for cases where we can't tell which finer grained category it should belong to. However, upgrading it CAN be delayed until all the higher level metadata derived from it has been generated. So the working sequence looks like this: std::vector<Metadata*> elts; /* type-based alias analysis */ NamedMDNode* nmd = pMod->getOrInsertNamedMetadata("tbaa"); // put root at module level elts.resize(1); elts[0] = MDString::get(Context, "tbaa2200"); mdRoot = MDNode::get(Context, elts); // root mdRoot = UpgradeTBAANode(*mdRoot); nmd->addOperand(mdRoot); elts.resize(2); elts[1] = mdRoot; // same root for data and control elts[0] = MDString::get(Context, "data"); mdData = MDNode::get(Context, elts); // 2200 data types elts[0] = MDString::get(Context, "ctrl"); mdControl = MDNode::get(Context, elts); // control types mdControl = UpgradeTBAANode(*mdControl); nmd->addOperand(mdControl); elts[1] = mdData; elts[0] = MDString::get(Context, "mem"); mdMemory = MDNode::get(Context, elts); // 2200 memory type mdMemory = UpgradeTBAANode(*mdMemory); nmd->addOperand(mdMemory); elts[0] = MDString::get(Context, "grs"); mdGRS = MDNode::get(Context, elts); // GRS type mdGRS = UpgradeTBAANode(*mdGRS); nmd->addOperand(mdGRS); . . . /* We delay upgrading mdData, because the mdXXX that derive from it must reference the original form, whereas the references to it from a load or store must use the upgraded form. */ mdData = UpgradeTBAANode(*mdData); nmd->addOperand(mdData); This seems to work for all our tests. Thanks again! -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs