mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-26 02:22:29 +00:00
Fix povray and minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22397 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -590,51 +590,37 @@ void AlphaISel::EmitFunctionEntryCode(Function &Fn, MachineFunction &MF) {
|
|||||||
|
|
||||||
static void getValueInfo(const Value* v, int& type, int& fun, int& offset)
|
static void getValueInfo(const Value* v, int& type, int& fun, int& offset)
|
||||||
{
|
{
|
||||||
|
fun = type = offset = 0;
|
||||||
if (v == NULL) {
|
if (v == NULL) {
|
||||||
type = 0;
|
type = 0;
|
||||||
fun = 0;
|
|
||||||
offset = 0;
|
|
||||||
} else if (const GlobalValue* GV = dyn_cast<GlobalValue>(v)) {
|
} else if (const GlobalValue* GV = dyn_cast<GlobalValue>(v)) {
|
||||||
type = 1;
|
type = 1;
|
||||||
fun = 0;
|
|
||||||
const Module* M = GV->getParent();
|
const Module* M = GV->getParent();
|
||||||
int i = 0;
|
|
||||||
for(Module::const_global_iterator ii = M->global_begin(); &*ii != GV; ++ii)
|
for(Module::const_global_iterator ii = M->global_begin(); &*ii != GV; ++ii)
|
||||||
++i;
|
++offset;
|
||||||
offset = i;
|
|
||||||
} else if (const Argument* Arg = dyn_cast<Argument>(v)) {
|
} else if (const Argument* Arg = dyn_cast<Argument>(v)) {
|
||||||
type = 2;
|
type = 2;
|
||||||
const Function* F = Arg->getParent();
|
const Function* F = Arg->getParent();
|
||||||
const Module* M = F->getParent();
|
const Module* M = F->getParent();
|
||||||
int i = 0;
|
|
||||||
for(Module::const_iterator ii = M->begin(); &*ii != F; ++ii)
|
for(Module::const_iterator ii = M->begin(); &*ii != F; ++ii)
|
||||||
++i;
|
++fun;
|
||||||
fun = i;
|
|
||||||
i = 0;
|
|
||||||
for(Function::const_arg_iterator ii = F->arg_begin(); &*ii != Arg; ++ii)
|
for(Function::const_arg_iterator ii = F->arg_begin(); &*ii != Arg; ++ii)
|
||||||
++i;
|
++offset;
|
||||||
offset = i;
|
|
||||||
} else if (const Instruction* I = dyn_cast<Instruction>(v)) {
|
} else if (const Instruction* I = dyn_cast<Instruction>(v)) {
|
||||||
assert(dyn_cast<PointerType>(I->getType()));
|
assert(dyn_cast<PointerType>(I->getType()));
|
||||||
type = 3;
|
type = 3;
|
||||||
const BasicBlock* bb = I->getParent();
|
const BasicBlock* bb = I->getParent();
|
||||||
const Function* F = bb->getParent();
|
const Function* F = bb->getParent();
|
||||||
const Module* M = F->getParent();
|
const Module* M = F->getParent();
|
||||||
int i = 0;
|
|
||||||
for(Module::const_iterator ii = M->begin(); &*ii != F; ++ii)
|
for(Module::const_iterator ii = M->begin(); &*ii != F; ++ii)
|
||||||
++i;
|
++fun;
|
||||||
fun = i;
|
|
||||||
i = 0;
|
|
||||||
for(Function::const_iterator ii = F->begin(); &*ii != bb; ++ii)
|
for(Function::const_iterator ii = F->begin(); &*ii != bb; ++ii)
|
||||||
i += ii->size();
|
offset += ii->size();
|
||||||
for(BasicBlock::const_iterator ii = bb->begin(); &*ii != I; ++ii)
|
for(BasicBlock::const_iterator ii = bb->begin(); &*ii != I; ++ii)
|
||||||
++i;
|
++offset;
|
||||||
offset = i;
|
|
||||||
} else if (const Constant* C = dyn_cast<Constant>(v)) {
|
} else if (const Constant* C = dyn_cast<Constant>(v)) {
|
||||||
//Don't know how to look these up yet
|
//Don't know how to look these up yet
|
||||||
type = 0;
|
type = 0;
|
||||||
fun = 0;
|
|
||||||
offset = 0;
|
|
||||||
} else {
|
} else {
|
||||||
assert(0 && "Error in value marking");
|
assert(0 && "Error in value marking");
|
||||||
}
|
}
|
||||||
@@ -1485,7 +1471,7 @@ unsigned AlphaISel::SelectExpr(SDOperand N) {
|
|||||||
//FIXME: first check for Scaled Adds and Subs!
|
//FIXME: first check for Scaled Adds and Subs!
|
||||||
ConstantSDNode* CSD = NULL;
|
ConstantSDNode* CSD = NULL;
|
||||||
if(!isMul && N.getOperand(0).getOperand(0).getOpcode() == ISD::SHL &&
|
if(!isMul && N.getOperand(0).getOperand(0).getOpcode() == ISD::SHL &&
|
||||||
(CSD = cast<ConstantSDNode>(N.getOperand(0).getOperand(0).getOperand(1))) &&
|
(CSD = dyn_cast<ConstantSDNode>(N.getOperand(0).getOperand(0).getOperand(1))) &&
|
||||||
(CSD->getValue() == 2 || CSD->getValue() == 3))
|
(CSD->getValue() == 2 || CSD->getValue() == 3))
|
||||||
{
|
{
|
||||||
bool use4 = CSD->getValue() == 2;
|
bool use4 = CSD->getValue() == 2;
|
||||||
@@ -1495,7 +1481,7 @@ unsigned AlphaISel::SelectExpr(SDOperand N) {
|
|||||||
2,Result).addReg(Tmp1).addReg(Tmp2);
|
2,Result).addReg(Tmp1).addReg(Tmp2);
|
||||||
}
|
}
|
||||||
else if(isAdd && N.getOperand(0).getOperand(1).getOpcode() == ISD::SHL &&
|
else if(isAdd && N.getOperand(0).getOperand(1).getOpcode() == ISD::SHL &&
|
||||||
(CSD = cast<ConstantSDNode>(N.getOperand(0).getOperand(1).getOperand(1))) &&
|
(CSD = dyn_cast<ConstantSDNode>(N.getOperand(0).getOperand(1).getOperand(1))) &&
|
||||||
(CSD->getValue() == 2 || CSD->getValue() == 3))
|
(CSD->getValue() == 2 || CSD->getValue() == 3))
|
||||||
{
|
{
|
||||||
bool use4 = CSD->getValue() == 2;
|
bool use4 = CSD->getValue() == 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user