[PATCH] D65685: Eliminate implicit Register->unsigned conversions in VirtRegMap. NFC

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 17:28:39 PDT 2019


dsanders created this revision.
dsanders added a reviewer: arsenm.
Herald added subscribers: hiraditya, wdng, MatzeB.
Herald added a project: LLVM.

This was mostly an experiment to assess the feasibility of completely
eliminating a problematic implicit conversion case in D61321 <https://reviews.llvm.org/D61321> in advance of
landing that* but it also happens to align with the goal of propagating the
use of Register/MCRegister instead of unsigned so I believe it makes sense
to commit it.

The overall process for eliminating the implicit conversions from
Register/MCRegister -> unsigned was to:

1. Add an explicit conversion to support genuinely required conversions to unsigned. For example, using them as an index for IndexedMap. Sadly it's not possible to have an explicit and implicit conversion to the same type and only deprecate the implicit one so I called the explicit conversion get().
2. Temporarily annotate the implicit conversion to unsigned with LLVM_ATTRIBUTE_DEPRECATED to make them visible
3. Eliminate implicit conversions by propagating Register/MCRegister/ explicit-conversions appropriately
4. Remove the deprecation added in 2.

- My conclusion is that it isn't feasible as there's too much code to update in one go.

Depends on D65678 <https://reviews.llvm.org/D65678>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65685

Files:
  llvm/include/llvm/CodeGen/LiveIntervals.h
  llvm/include/llvm/CodeGen/LiveRegUnits.h
  llvm/include/llvm/CodeGen/MachineBasicBlock.h
  llvm/include/llvm/CodeGen/MachineInstr.h
  llvm/include/llvm/CodeGen/MachineOperand.h
  llvm/include/llvm/CodeGen/MachineRegisterInfo.h
  llvm/include/llvm/CodeGen/Register.h
  llvm/include/llvm/CodeGen/TargetRegisterInfo.h
  llvm/include/llvm/CodeGen/VirtRegMap.h
  llvm/include/llvm/MC/MCRegister.h
  llvm/lib/CodeGen/MachineBasicBlock.cpp
  llvm/lib/CodeGen/MachineInstr.cpp
  llvm/lib/CodeGen/MachineOperand.cpp
  llvm/lib/CodeGen/TargetRegisterInfo.cpp
  llvm/lib/CodeGen/VirtRegMap.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65685.213150.patch
Type: text/x-patch
Size: 27336 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190803/8625249d/attachment.bin>


More information about the llvm-commits mailing list