This is an archive of the discontinued LLVM Phabricator instance.

Teach MemDepPrinter about NonLocal MemDepResults
Needs ReviewPublic

Authored by njw45 on Oct 22 2014, 10:24 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

MemDepPrinter currently fails an assertion when it tries to print a NonLocal MemDepResult. This commit adds support for printing NonLocal results, but as there are now five DepTypes it can print I had to change the std::pair of PointerIntPair and basic block pointer it used into a std::tuple.

(lldb) f 5
frame #5: 0x000000010182744b opt`(anonymous namespace)::MemDepPrinter::getInstTypePair(dep=MemDepResult at   0x00007fff5fbfd510) + 267 at MemDepPrinter.cpp:70
   67  	        return InstTypePair(dep.getInst(), Def);
   68  	      if (dep.isNonFuncLocal())
   69  	        return InstTypePair(dep.getInst(), NonFuncLocal);
-> 70  	      assert(dep.isUnknown() && "unexpected dependence type");
   71  	      return InstTypePair(dep.getInst(), Unknown);
   72  	    }
   73  	    static InstTypePair getInstTypePair(const Instruction* inst, DepType type) {
(lldb) p dep
(llvm::MemDepResult) $0 = {
  Value = (Value = 7)
}

Diff Detail

Event Timeline

njw45 updated this revision to Diff 15255.Oct 22 2014, 10:24 AM
njw45 retitled this revision from to Add NonLocal to MemDepPrinter.
njw45 updated this object.
njw45 edited the test plan for this revision. (Show Details)
njw45 retitled this revision from Add NonLocal to MemDepPrinter to Teach MemDepPrinter about NonLocal MemDepResults.Oct 22 2014, 10:29 AM
njw45 updated this object.
njw45 added a subscriber: Unknown Object (MLST).
njw45 updated this object.Oct 22 2014, 11:01 AM
njw45 added a comment.Oct 24 2014, 7:04 AM

Hi committers - could someone review http://reviews.llvm.org/D5914 for me?
I was using the MemDepPrinter to diagnose an issue with the
MemoryDependenceAnalysis and noticed the MemDepPrinter kept failing an
assert condition as it isn't capable of printing NonLocal dependencies.
Thanks -

Nick