[PATCH] D92925: Add SsaContext: Template to access generic IR functionality

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 02:44:52 PST 2020


nhaehnle created this revision.
Herald added subscribers: dexonsmith, hiraditya, mgorny.
nhaehnle requested review of this revision.
Herald added a project: LLVM.

Some functionality cannot be accessed directly from templates in a
straightforward generic way at all, and other functionality could be
accessed but only inefficiently.

Examples are:

- Given an SSA value, determining the basic block in which it is defined (if any) isn't possible in MachineIR without access to MachineRegisterInfo.

- Printing an llvm::Value properly requires a ModuleSlotTracker whose creation is expensive. Printing large functions can become prohibitively slow unless the ModuleSlotTracker is cached.

Each supported IR provides an implementation of the SsaContext
"concept" defined in this patch through which such functionality can be
exposed.

Change-Id: I7ed2b5c7698e6f3784db6201bcdb842173e23379


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D92925

Files:
  llvm/include/llvm/CodeGen/MachineSsaContext.h
  llvm/include/llvm/IR/CFG.h
  llvm/include/llvm/Support/SsaContext.h
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/MachineSsaContext.cpp
  llvm/lib/IR/CFG.cpp
  llvm/lib/IR/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92925.310470.patch
Type: text/x-patch
Size: 12953 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201209/15078c84/attachment.bin>


More information about the llvm-commits mailing list