[llvm] da426ea - LiveRangeEdit.h - reduce AliasAnalysis.h include to forward declaration. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 26 02:08:22 PDT 2020
Author: Simon Pilgrim
Date: 2020-06-26T09:58:21+01:00
New Revision: da426ead73aa99202e80423048ace9ceb92312a8
URL: https://github.com/llvm/llvm-project/commit/da426ead73aa99202e80423048ace9ceb92312a8
DIFF: https://github.com/llvm/llvm-project/commit/da426ead73aa99202e80423048ace9ceb92312a8.diff
LOG: LiveRangeEdit.h - reduce AliasAnalysis.h include to forward declaration. NFC.
Move include to LiveRangeEdit.cpp and replace legacy AliasAnalysis typedef with AAResults where necessary.
Added:
Modified:
llvm/include/llvm/CodeGen/LiveRangeEdit.h
llvm/lib/CodeGen/LiveRangeEdit.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/CodeGen/LiveRangeEdit.h b/llvm/include/llvm/CodeGen/LiveRangeEdit.h
index a0c5ecc3a388..7b44637ef746 100644
--- a/llvm/include/llvm/CodeGen/LiveRangeEdit.h
+++ b/llvm/include/llvm/CodeGen/LiveRangeEdit.h
@@ -22,7 +22,6 @@
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
-#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/LiveInterval.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
@@ -33,6 +32,7 @@
namespace llvm {
+class AAResults;
class LiveIntervals;
class MachineBlockFrequencyInfo;
class MachineInstr;
@@ -94,7 +94,7 @@ class LiveRangeEdit : private MachineRegisterInfo::Delegate {
SmallPtrSet<const VNInfo *, 4> Rematted;
/// scanRemattable - Identify the Parent values that may rematerialize.
- void scanRemattable(AliasAnalysis *aa);
+ void scanRemattable(AAResults *aa);
/// allUsesAvailableAt - Return true if all registers used by OrigMI at
/// OrigIdx are also available with the same value at UseIdx.
@@ -110,7 +110,7 @@ class LiveRangeEdit : private MachineRegisterInfo::Delegate {
/// Helper for eliminateDeadDefs.
void eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink,
- AliasAnalysis *AA);
+ AAResults *AA);
/// MachineRegisterInfo callback to notify when new virtual
/// registers are created.
@@ -190,12 +190,12 @@ class LiveRangeEdit : private MachineRegisterInfo::Delegate {
/// anyRematerializable - Return true if any parent values may be
/// rematerializable.
/// This function must be called before any rematerialization is attempted.
- bool anyRematerializable(AliasAnalysis *);
+ bool anyRematerializable(AAResults *);
/// checkRematerializable - Manually add VNI to the list of rematerializable
/// values if DefMI may be rematerializable.
bool checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI,
- AliasAnalysis *);
+ AAResults *);
/// Remat - Information needed to rematerialize at a specific location.
struct Remat {
@@ -244,7 +244,7 @@ class LiveRangeEdit : private MachineRegisterInfo::Delegate {
/// as currently those new intervals are not guaranteed to spill.
void eliminateDeadDefs(SmallVectorImpl<MachineInstr *> &Dead,
ArrayRef<unsigned> RegsBeingSpilled = None,
- AliasAnalysis *AA = nullptr);
+ AAResults *AA = nullptr);
/// calculateRegClassAndHint - Recompute register class and hint for each new
/// register.
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp
index fa2285a1348a..508ab20c8639 100644
--- a/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -12,6 +12,7 @@
#include "llvm/CodeGen/LiveRangeEdit.h"
#include "llvm/ADT/Statistic.h"
+#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/CodeGen/CalcSpillWeights.h"
#include "llvm/CodeGen/LiveIntervals.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
@@ -69,7 +70,7 @@ unsigned LiveRangeEdit::createFrom(unsigned OldReg) {
bool LiveRangeEdit::checkRematerializable(VNInfo *VNI,
const MachineInstr *DefMI,
- AliasAnalysis *aa) {
+ AAResults *aa) {
assert(DefMI && "Missing instruction");
ScannedRemattable = true;
if (!TII.isTriviallyReMaterializable(*DefMI, aa))
@@ -78,7 +79,7 @@ bool LiveRangeEdit::checkRematerializable(VNInfo *VNI,
return true;
}
-void LiveRangeEdit::scanRemattable(AliasAnalysis *aa) {
+void LiveRangeEdit::scanRemattable(AAResults *aa) {
for (VNInfo *VNI : getParent().valnos) {
if (VNI->isUnused())
continue;
@@ -95,7 +96,7 @@ void LiveRangeEdit::scanRemattable(AliasAnalysis *aa) {
ScannedRemattable = true;
}
-bool LiveRangeEdit::anyRematerializable(AliasAnalysis *aa) {
+bool LiveRangeEdit::anyRematerializable(AAResults *aa) {
if (!ScannedRemattable)
scanRemattable(aa);
return !Remattable.empty();
@@ -259,7 +260,7 @@ bool LiveRangeEdit::useIsKill(const LiveInterval &LI,
/// Find all live intervals that need to shrink, then remove the instruction.
void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink,
- AliasAnalysis *AA) {
+ AAResults *AA) {
assert(MI->allDefsAreDead() && "Def isn't really dead");
SlotIndex Idx = LIS.getInstructionIndex(*MI).getRegSlot();
@@ -392,7 +393,7 @@ void LiveRangeEdit::eliminateDeadDef(MachineInstr *MI, ToShrinkSet &ToShrink,
void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr *> &Dead,
ArrayRef<unsigned> RegsBeingSpilled,
- AliasAnalysis *AA) {
+ AAResults *AA) {
ToShrinkSet ToShrink;
for (;;) {
More information about the llvm-commits
mailing list