mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-19 03:29:22 +00:00
remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25237 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
05f1fe8d44
commit
17e82d2858
@ -189,14 +189,6 @@ static bool isIntImmediate(SDNode *N, unsigned& Imm) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// isOprShiftImm - Returns true if the specified operand is a shift opcode with
|
|
||||||
// a immediate shift count less than 32.
|
|
||||||
static bool isOprShiftImm(SDNode *N, unsigned& Opc, unsigned& SH) {
|
|
||||||
Opc = N->getOpcode();
|
|
||||||
return (Opc == ISD::SHL || Opc == ISD::SRL || Opc == ISD::SRA) &&
|
|
||||||
isIntImmediate(N->getOperand(1).Val, SH) && SH < 32;
|
|
||||||
}
|
|
||||||
|
|
||||||
// isRunOfOnes - Returns true iff Val consists of one contiguous run of 1s with
|
// isRunOfOnes - Returns true iff Val consists of one contiguous run of 1s with
|
||||||
// any number of 0s on either side. The 1s are allowed to wrap from LSB to
|
// any number of 0s on either side. The 1s are allowed to wrap from LSB to
|
||||||
// MSB, so 0x000FFF0, 0x0000FFFF, and 0xFF0000FF are all runs. 0x0F0F0000 is
|
// MSB, so 0x000FFF0, 0x0000FFFF, and 0xFF0000FF are all runs. 0x0F0F0000 is
|
||||||
@ -270,21 +262,6 @@ static bool isOpcWithIntImmediate(SDNode *N, unsigned Opc, unsigned& Imm) {
|
|||||||
return N->getOpcode() == Opc && isIntImmediate(N->getOperand(1).Val, Imm);
|
return N->getOpcode() == Opc && isIntImmediate(N->getOperand(1).Val, Imm);
|
||||||
}
|
}
|
||||||
|
|
||||||
// isOprNot - Returns true if the specified operand is an xor with immediate -1.
|
|
||||||
static bool isOprNot(SDNode *N) {
|
|
||||||
unsigned Imm;
|
|
||||||
return isOpcWithIntImmediate(N, ISD::XOR, Imm) && (signed)Imm == -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Immediate constant composers.
|
|
||||||
// Lo16 - grabs the lo 16 bits from a 32 bit constant.
|
|
||||||
// Hi16 - grabs the hi 16 bits from a 32 bit constant.
|
|
||||||
// HA16 - computes the hi bits required if the lo bits are add/subtracted in
|
|
||||||
// arithmethically.
|
|
||||||
static unsigned Lo16(unsigned x) { return x & 0x0000FFFF; }
|
|
||||||
static unsigned Hi16(unsigned x) { return Lo16(x >> 16); }
|
|
||||||
static unsigned HA16(unsigned x) { return Hi16((signed)x - (signed short)x); }
|
|
||||||
|
|
||||||
// isIntImmediate - This method tests to see if a constant operand.
|
// isIntImmediate - This method tests to see if a constant operand.
|
||||||
// If so Imm will receive the 32 bit value.
|
// If so Imm will receive the 32 bit value.
|
||||||
static bool isIntImmediate(SDOperand N, unsigned& Imm) {
|
static bool isIntImmediate(SDOperand N, unsigned& Imm) {
|
||||||
@ -410,7 +387,7 @@ bool PPCDAGToDAGISel::SelectAddrImm(SDOperand N, SDOperand &Disp,
|
|||||||
if (N.getOpcode() == ISD::ADD) {
|
if (N.getOpcode() == ISD::ADD) {
|
||||||
unsigned imm = 0;
|
unsigned imm = 0;
|
||||||
if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm)) {
|
if (isIntImmediate(N.getOperand(1), imm) && isInt16(imm)) {
|
||||||
Disp = getI32Imm(Lo16(imm));
|
Disp = getI32Imm(imm & 0xFFFF);
|
||||||
if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(N.getOperand(0))) {
|
if (FrameIndexSDNode *FI = dyn_cast<FrameIndexSDNode>(N.getOperand(0))) {
|
||||||
Base = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32);
|
Base = CurDAG->getTargetFrameIndex(FI->getIndex(), MVT::i32);
|
||||||
} else {
|
} else {
|
||||||
@ -488,7 +465,7 @@ SDOperand PPCDAGToDAGISel::SelectCC(SDOperand LHS, SDOperand RHS,
|
|||||||
if (isIntImmediate(RHS, Imm) &&
|
if (isIntImmediate(RHS, Imm) &&
|
||||||
((U && isUInt16(Imm)) || (!U && isInt16(Imm))))
|
((U && isUInt16(Imm)) || (!U && isInt16(Imm))))
|
||||||
return CurDAG->getTargetNode(U ? PPC::CMPLWI : PPC::CMPWI, MVT::i32,
|
return CurDAG->getTargetNode(U ? PPC::CMPLWI : PPC::CMPWI, MVT::i32,
|
||||||
LHS, getI32Imm(Lo16(Imm)));
|
LHS, getI32Imm(Imm & 0xFFFF));
|
||||||
return CurDAG->getTargetNode(U ? PPC::CMPLW : PPC::CMPW, MVT::i32,
|
return CurDAG->getTargetNode(U ? PPC::CMPLW : PPC::CMPW, MVT::i32,
|
||||||
LHS, Select(RHS));
|
LHS, Select(RHS));
|
||||||
} else if (LHS.getValueType() == MVT::f32) {
|
} else if (LHS.getValueType() == MVT::f32) {
|
||||||
|
Loading…
Reference in New Issue
Block a user