mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-04 17:47:58 +00:00
minor cleanups to debug code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59989 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8d0d603a0b
commit
4744d85c50
@ -485,40 +485,44 @@ static void EraseDeadInstructions(Value *V) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
/// ExtAddrMode - This is an extended version of TargetLowering::AddrMode
|
||||||
|
/// which holds actual Value*'s for register values.
|
||||||
|
struct ExtAddrMode : public TargetLowering::AddrMode {
|
||||||
|
Value *BaseReg;
|
||||||
|
Value *ScaledReg;
|
||||||
|
ExtAddrMode() : BaseReg(0), ScaledReg(0) {}
|
||||||
|
void print(OStream &OS) const;
|
||||||
|
void dump() const {
|
||||||
|
print(cerr);
|
||||||
|
cerr << '\n';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
} // end anonymous namespace
|
||||||
|
|
||||||
/// ExtAddrMode - This is an extended version of TargetLowering::AddrMode which
|
static OStream &operator<<(OStream &OS, const ExtAddrMode &AM) {
|
||||||
/// holds actual Value*'s for register values.
|
AM.print(OS);
|
||||||
struct ExtAddrMode : public TargetLowering::AddrMode {
|
return OS;
|
||||||
Value *BaseReg;
|
}
|
||||||
Value *ScaledReg;
|
|
||||||
ExtAddrMode() : BaseReg(0), ScaledReg(0) {}
|
|
||||||
void dump() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
static std::ostream &operator<<(std::ostream &OS, const ExtAddrMode &AM) {
|
|
||||||
|
void ExtAddrMode::print(OStream &OS) const {
|
||||||
bool NeedPlus = false;
|
bool NeedPlus = false;
|
||||||
OS << "[";
|
OS << "[";
|
||||||
if (AM.BaseGV)
|
if (BaseGV)
|
||||||
OS << (NeedPlus ? " + " : "")
|
OS << (NeedPlus ? " + " : "")
|
||||||
<< "GV:%" << AM.BaseGV->getName(), NeedPlus = true;
|
<< "GV:%" << BaseGV->getName(), NeedPlus = true;
|
||||||
|
|
||||||
if (AM.BaseOffs)
|
if (BaseOffs)
|
||||||
OS << (NeedPlus ? " + " : "") << AM.BaseOffs, NeedPlus = true;
|
OS << (NeedPlus ? " + " : "") << BaseOffs, NeedPlus = true;
|
||||||
|
|
||||||
if (AM.BaseReg)
|
if (BaseReg)
|
||||||
OS << (NeedPlus ? " + " : "")
|
OS << (NeedPlus ? " + " : "")
|
||||||
<< "Base:%" << AM.BaseReg->getName(), NeedPlus = true;
|
<< "Base:%" << BaseReg->getName(), NeedPlus = true;
|
||||||
if (AM.Scale)
|
if (Scale)
|
||||||
OS << (NeedPlus ? " + " : "")
|
OS << (NeedPlus ? " + " : "")
|
||||||
<< AM.Scale << "*%" << AM.ScaledReg->getName(), NeedPlus = true;
|
<< Scale << "*%" << ScaledReg->getName(), NeedPlus = true;
|
||||||
|
|
||||||
return OS << "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExtAddrMode::dump() const {
|
|
||||||
cerr << *this << "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
OS << ']';
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale,
|
static bool TryMatchingScaledValue(Value *ScaleReg, int64_t Scale,
|
||||||
@ -572,6 +576,11 @@ static bool FindMaximalLegalAddressingMode(Value *Addr, const Type *AccessTy,
|
|||||||
if (Instruction *I = dyn_cast_or_null<Instruction>(AddrInst))
|
if (Instruction *I = dyn_cast_or_null<Instruction>(AddrInst))
|
||||||
AddrModeInsts.push_back(I);
|
AddrModeInsts.push_back(I);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (AddrInst && !AddrInst->hasOneUse())
|
||||||
|
;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
switch (Opcode) {
|
switch (Opcode) {
|
||||||
case Instruction::PtrToInt:
|
case Instruction::PtrToInt:
|
||||||
// PtrToInt is always a noop, as we know that the int type is pointer sized.
|
// PtrToInt is always a noop, as we know that the int type is pointer sized.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user