Add support for unreachable and undef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17074 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-10-17 02:42:42 +00:00
parent da0a22b7ac
commit d14d5b4223
2 changed files with 12 additions and 0 deletions

View File

@ -90,6 +90,7 @@ namespace {
void visitCallInst(CallInst &I); void visitCallInst(CallInst &I);
void visitReturnInst(ReturnInst &I); void visitReturnInst(ReturnInst &I);
void visitBranchInst(BranchInst &I); void visitBranchInst(BranchInst &I);
void visitUnreachableInst(UnreachableInst &I) {}
void visitCastInst(CastInst &I); void visitCastInst(CastInst &I);
void visitLoadInst(LoadInst &I); void visitLoadInst(LoadInst &I);
void visitStoreInst(StoreInst &I); void visitStoreInst(StoreInst &I);
@ -230,6 +231,11 @@ void V8ISel::copyConstantToRegister(MachineBasicBlock *MBB,
std::cerr << "Copying this constant expr not yet handled: " << *CE; std::cerr << "Copying this constant expr not yet handled: " << *CE;
abort(); abort();
} }
} else if (isa<UndefValue>(C)) {
BuildMI(*MBB, IP, V8::IMPLICIT_DEF, 0, R);
if (getClassB (C->getType ()) == cLong)
BuildMI(*MBB, IP, V8::IMPLICIT_DEF, 0, R+1);
return;
} }
if (C->getType()->isIntegral ()) { if (C->getType()->isIntegral ()) {

View File

@ -90,6 +90,7 @@ namespace {
void visitCallInst(CallInst &I); void visitCallInst(CallInst &I);
void visitReturnInst(ReturnInst &I); void visitReturnInst(ReturnInst &I);
void visitBranchInst(BranchInst &I); void visitBranchInst(BranchInst &I);
void visitUnreachableInst(UnreachableInst &I) {}
void visitCastInst(CastInst &I); void visitCastInst(CastInst &I);
void visitLoadInst(LoadInst &I); void visitLoadInst(LoadInst &I);
void visitStoreInst(StoreInst &I); void visitStoreInst(StoreInst &I);
@ -230,6 +231,11 @@ void V8ISel::copyConstantToRegister(MachineBasicBlock *MBB,
std::cerr << "Copying this constant expr not yet handled: " << *CE; std::cerr << "Copying this constant expr not yet handled: " << *CE;
abort(); abort();
} }
} else if (isa<UndefValue>(C)) {
BuildMI(*MBB, IP, V8::IMPLICIT_DEF, 0, R);
if (getClassB (C->getType ()) == cLong)
BuildMI(*MBB, IP, V8::IMPLICIT_DEF, 0, R+1);
return;
} }
if (C->getType()->isIntegral ()) { if (C->getType()->isIntegral ()) {