Refine the DefUseManager
authorqining <qining@google.com>
Tue, 16 Aug 2016 17:06:03 +0000 (13:06 -0400)
committerqining <qining@google.com>
Thu, 18 Aug 2016 03:13:01 +0000 (23:13 -0400)
commitb891845b533628d5c2240963d8a59937f800148b
tree39489b28159a081a3fb4e606139d47fedd9e9242
parent6c5bdc9a395e262ee218f3bf1209b62078e3314e
Refine the DefUseManager

* Fix the behavior when analyzing an individual instruction:
  * exisiting instruction:
      Clear the original records and re-analyze it as a new instruction.
  * new instruction with exisiting result id:
      Clear the original records of the exisiting result id. This means
      the records of the analyzed result-id-defining instruction will be
      overwritten by the record of the new instruction with the same
      result id.
  * new instruction with new result id or without result id:
      Just update the internal records to incorperate the new
      instruction.
* Add tests for analyzing individual instruction w/o an exisiting module.
* Refactor ClearInst() implementation
* Remove ClearDef() function.
* Fixed a bug in DefUseManager::ReplaceAllUsesWith() that OpName
  instruction may trigger the assertion incorrectly.
* update the blurbs for EraseUseRecordsOfOperandIds()
source/opt/def_use_manager.cpp
source/opt/def_use_manager.h
test/opt/test_def_use.cpp