]> granicus.if.org Git - llvm/commit
Eliminate implicit Register->unsigned conversions in VirtRegMap. NFC
authorDaniel Sanders <daniel_l_sanders@apple.com>
Tue, 13 Aug 2019 00:55:24 +0000 (00:55 +0000)
committerDaniel Sanders <daniel_l_sanders@apple.com>
Tue, 13 Aug 2019 00:55:24 +0000 (00:55 +0000)
commit25c2d2fbd9933cd54e6fce81bba891f447f4491e
tree7437618ff2dda39ef4b5581d129777e3490379aa
parent571f30000551435a142cb7937eb8358796ef656c
Eliminate implicit Register->unsigned conversions in VirtRegMap. NFC

Summary:
This was mostly an experiment to assess the feasibility of completely
eliminating a problematic implicit conversion case in 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

Reviewers: arsenm

Subscribers: MatzeB, wdng, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368643 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/llvm/CodeGen/LiveIntervals.h
include/llvm/CodeGen/LiveRegUnits.h
include/llvm/CodeGen/MachineBasicBlock.h
include/llvm/CodeGen/MachineInstr.h
include/llvm/CodeGen/MachineRegisterInfo.h
include/llvm/CodeGen/Register.h
include/llvm/CodeGen/TargetRegisterInfo.h
include/llvm/CodeGen/VirtRegMap.h
include/llvm/MC/MCRegister.h
lib/CodeGen/MachineBasicBlock.cpp
lib/CodeGen/TargetRegisterInfo.cpp
lib/CodeGen/VirtRegMap.cpp