1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/lib
Daniel Sanders f380a26222 [globalisel][combiner] Make the CombinerChangeObserver a MachineFunction::Delegate
Summary:
This allows us to register it with the MachineFunction delegate and be
notified automatically about erasure and creation of instructions. However,
we still need explicit notification for modifications such as those caused
by setReg() or replaceRegWith().

There is a catch with this though. The notification for creation is
delivered before any operands can be added. While appropriate for
scheduling combiner work. This is unfortunate for debug output since an
opcode by itself doesn't provide sufficient information on what happened.
As a result, the work list remembers the instructions (when debug output is
requested) and emits a more complete dump later.

Another nit is that the MachineFunction::Delegate provides const pointers
which is inconvenient since we want to use it to schedule future
modification. To resolve this GISelWorkList now has an optional pointer to
the MachineFunction which describes the scope of the work it is permitted
to schedule. If a given MachineInstr* is in this function then it is
permitted to schedule work to be performed on the MachineInstr's. An
alternative to this would be to remove the const from the
MachineFunction::Delegate interface, however delegates are not permitted
to modify the MachineInstr's they receive.

In addition to this, the observer has three interface changes.
* erasedInstr() is now erasingInstr() to indicate it is about to be erased
  but still exists at the moment.
* changingInstr() and changedInstr() have been added to report changes
  before and after they are made. This allows us to trace the changes
  in the debug output.
* As a convenience changingAllUsesOfReg() and
  finishedChangingAllUsesOfReg() will report changingInstr() and
  changedInstr() for each use of a given register. This is primarily useful
  for changes caused by MachineRegisterInfo::replaceRegWith()

With this in place, both combine rules have been updated to report their
changes to the observer.

Finally, make some cosmetic changes to the debug output and make Combiner
and CombinerHelp

Reviewers: aditya_nandakumar, bogner, volkan, rtereshin, javed.absar

Reviewed By: aditya_nandakumar

Subscribers: mgorny, rovka, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D52947

llvm-svn: 349167
2018-12-14 17:50:14 +00:00
..
Analysis [SampleFDO] handle ProfileSampleAccurate when initializing function entry count 2018-12-13 21:51:42 +00:00
AsmParser [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
BinaryFormat [AMDGPU] Emit MessagePack HSA Metadata for v3 code object 2018-12-12 19:39:27 +00:00
Bitcode [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
CodeGen [globalisel][combiner] Make the CombinerChangeObserver a MachineFunction::Delegate 2018-12-14 17:50:14 +00:00
DebugInfo DebugInfo/DWARF: Pretty print subroutine types 2018-12-12 19:53:03 +00:00
Demangle Fix a crash in llvm-undname with invalid types. 2018-12-14 17:43:56 +00:00
ExecutionEngine Implement IMAGE_REL_AMD64_SECREL for RuntimeDyldCOFFX86_64 2018-12-12 00:04:06 +00:00
Fuzzer
FuzzMutate [New PM] Introducing PassInstrumentation framework 2018-09-20 17:08:45 +00:00
IR Implement -frecord-command-line (-frecord-gcc-switches) 2018-12-14 15:38:15 +00:00
IRReader
LineEditor
Linker ThinLTO: Do not import debug info for imported global constants 2018-12-05 21:42:17 +00:00
LTO [ThinLTO] Compute synthetic function entry count 2018-12-13 19:54:27 +00:00
MC [macho] save the SDK version stored in module metadata into the version min and 2018-12-14 01:14:10 +00:00
Object [Object] Rename getRelrRelocationType to getRelativeRelocationType 2018-12-14 07:46:58 +00:00
ObjectYAML [WebAssembly] Update dylink section parsing 2018-12-12 23:40:58 +00:00
Option [opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>" 2018-10-10 00:15:31 +00:00
OptRemarks Reland: [OptRemarks] Add library for parsing optimization remarks 2018-10-10 18:43:42 +00:00
Passes [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes. 2018-12-12 17:32:52 +00:00
ProfileData Support for remapping profile data when symbols change, for sample-based 2018-10-10 21:31:01 +00:00
Support [Support] Fix FileNameLength passed to SetFileInformationByHandle 2018-12-13 00:08:25 +00:00
TableGen [TableGen] Preprocessing support 2018-11-27 18:57:43 +00:00
Target NFC. Adding an empty line to test the updated commit credentials. 2018-12-14 16:19:02 +00:00
Testing Fix error with SmallString implicit conversion. 2018-09-06 22:47:32 +00:00
TextAPI [TextAPI][elfabi] Make SoName optional 2018-12-11 01:00:16 +00:00
ToolDrivers [opt] Change the parameter of OptTable::PrintHelp from Name to Usage and don't append "[options] <inputs>" 2018-10-10 00:15:31 +00:00
Transforms Revert "[hwasan] Android: Switch from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)" 2018-12-13 23:47:50 +00:00
WindowsManifest
XRay [Object] Rename getRelrRelocationType to getRelativeRelocationType 2018-12-14 07:46:58 +00:00
CMakeLists.txt [llvm-tapi] initial commit, supports ELF text stubs 2018-12-03 19:30:52 +00:00
LLVMBuild.txt [llvm-tapi] initial commit, supports ELF text stubs 2018-12-03 19:30:52 +00:00