mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-01 01:30:36 +00:00
Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3323 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
48a4531ee4
commit
0513e9fe03
@ -48,10 +48,9 @@ namespace {
|
|||||||
// instruction being checked. They should return true if a common
|
// instruction being checked. They should return true if a common
|
||||||
// subexpression was folded.
|
// subexpression was folded.
|
||||||
//
|
//
|
||||||
bool visitUnaryOperator(Instruction &I);
|
|
||||||
bool visitBinaryOperator(Instruction &I);
|
bool visitBinaryOperator(Instruction &I);
|
||||||
bool visitGetElementPtrInst(GetElementPtrInst &I);
|
bool visitGetElementPtrInst(GetElementPtrInst &I);
|
||||||
bool visitCastInst(CastInst &I){return visitUnaryOperator((Instruction&)I);}
|
bool visitCastInst(CastInst &I);
|
||||||
bool visitShiftInst(ShiftInst &I) {
|
bool visitShiftInst(ShiftInst &I) {
|
||||||
return visitBinaryOperator((Instruction&)I);
|
return visitBinaryOperator((Instruction&)I);
|
||||||
}
|
}
|
||||||
@ -254,14 +253,14 @@ void GCSE::CommonSubExpressionFound(Instruction *I, Instruction *Other) {
|
|||||||
//
|
//
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
bool GCSE::visitUnaryOperator(Instruction &I) {
|
bool GCSE::visitCastInst(CastInst &I) {
|
||||||
Value *Op = I.getOperand(0);
|
Value *Op = I.getOperand(0);
|
||||||
Function *F = I.getParent()->getParent();
|
Function *F = I.getParent()->getParent();
|
||||||
|
|
||||||
for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
|
for (Value::use_iterator UI = Op->use_begin(), UE = Op->use_end();
|
||||||
UI != UE; ++UI)
|
UI != UE; ++UI)
|
||||||
if (Instruction *Other = dyn_cast<Instruction>(*UI))
|
if (Instruction *Other = dyn_cast<Instruction>(*UI))
|
||||||
// Check to see if this new binary operator is not I, but same operand...
|
// Check to see if this new cast is not I, but has the same operand...
|
||||||
if (Other != &I && Other->getOpcode() == I.getOpcode() &&
|
if (Other != &I && Other->getOpcode() == I.getOpcode() &&
|
||||||
Other->getOperand(0) == Op && // Is the operand the same?
|
Other->getOperand(0) == Op && // Is the operand the same?
|
||||||
// Is it embeded in the same function? (This could be false if LHS
|
// Is it embeded in the same function? (This could be false if LHS
|
||||||
|
@ -84,15 +84,13 @@ namespace {
|
|||||||
// the specified instruction types are hoisted.
|
// the specified instruction types are hoisted.
|
||||||
//
|
//
|
||||||
friend class InstVisitor<LICM>;
|
friend class InstVisitor<LICM>;
|
||||||
void visitUnaryOperator(Instruction &I) {
|
|
||||||
if (isLoopInvariant(I.getOperand(0))) hoist(I);
|
|
||||||
}
|
|
||||||
void visitBinaryOperator(Instruction &I) {
|
void visitBinaryOperator(Instruction &I) {
|
||||||
if (isLoopInvariant(I.getOperand(0)) && isLoopInvariant(I.getOperand(1)))
|
if (isLoopInvariant(I.getOperand(0)) && isLoopInvariant(I.getOperand(1)))
|
||||||
hoist(I);
|
hoist(I);
|
||||||
}
|
}
|
||||||
|
void visitCastInst(CastInst &I) {
|
||||||
void visitCastInst(CastInst &I) { visitUnaryOperator((Instruction&)I); }
|
if (isLoopInvariant(I.getOperand(0))) hoist((Instruction&)I);
|
||||||
|
}
|
||||||
void visitShiftInst(ShiftInst &I) { visitBinaryOperator((Instruction&)I); }
|
void visitShiftInst(ShiftInst &I) { visitBinaryOperator((Instruction&)I); }
|
||||||
|
|
||||||
void visitGetElementPtrInst(GetElementPtrInst &GEPI) {
|
void visitGetElementPtrInst(GetElementPtrInst &GEPI) {
|
||||||
|
@ -35,9 +35,6 @@ const char *Instruction::getOpcodeName(unsigned OpCode) {
|
|||||||
case Switch: return "switch";
|
case Switch: return "switch";
|
||||||
case Invoke: return "invoke";
|
case Invoke: return "invoke";
|
||||||
|
|
||||||
// Standard unary operators...
|
|
||||||
case Not: return "not";
|
|
||||||
|
|
||||||
// Standard binary operators...
|
// Standard binary operators...
|
||||||
case Add: return "add";
|
case Add: return "add";
|
||||||
case Sub: return "sub";
|
case Sub: return "sub";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user