summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
diff options
context:
space:
mode:
authorVikram S. Adve <vadve@cs.uiuc.edu>2003-07-06 22:50:31 +0000
committerVikram S. Adve <vadve@cs.uiuc.edu>2003-07-06 22:50:31 +0000
commit55c8e210732e1248ec793c8d4bad17432b44d31e (patch)
tree884be7e153adfc4c13d9e92794fa455feaf10cf8 /llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
parent3bb921e8df7e473f1653f0046e066df103d6e75a (diff)
downloadbcm5719-llvm-55c8e210732e1248ec793c8d4bad17432b44d31e.tar.gz
bcm5719-llvm-55c8e210732e1248ec793c8d4bad17432b44d31e.zip
Correction to last fix: Pointer types do not return true in Type::IsIntegral().
llvm-svn: 7113
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcRegClassInfo.cpp')
-rw-r--r--llvm/lib/Target/Sparc/SparcRegClassInfo.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp b/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
index 1640dcab6c6..8c20ab04c82 100644
--- a/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
+++ b/llvm/lib/Target/Sparc/SparcRegClassInfo.cpp
@@ -136,17 +136,20 @@ void SparcIntCCRegClass::colorIGNode(IGNode *Node,
// Choose whether to use %xcc or %icc based on type of value compared
const LiveRange* ccLR = Node->getParentLR();
const Type* setCCType = (* ccLR->begin())->getType(); // any Value in LR
- assert(setCCType->isIntegral());
- int ccReg = (setCCType == Type::LongTy)? xcc : icc;
+ assert(setCCType->isIntegral() || isa<PointerType>(setCCType));
+ int ccReg = ((isa<PointerType>(setCCType) || setCCType == Type::LongTy)
+ ? xcc : icc);
#ifndef NDEBUG
// Let's just make sure values of two different types have not been
// coalesced into this LR.
- for (ValueSet::const_iterator I=ccLR->begin(), E=ccLR->end(); I != E; ++I)
- assert(setCCType->isIntegral() &&
- ((ccReg == xcc && (*I)->getType() == Type::LongTy) ||
- (ccReg == icc && (*I)->getType() != Type::LongTy))
+ for (ValueSet::const_iterator I=ccLR->begin(), E=ccLR->end(); I!=E; ++I) {
+ const Type* ccType = (*I)->getType();
+ assert((ccReg == xcc && (isa<PointerType>(ccType)
+ || ccType == Type::LongTy)) ||
+ (ccReg == icc && ccType->isIntegral() && ccType != Type::LongTy)
&& "Comparisons needing different intCC regs coalesced in LR!");
+ }
#endif
Node->setColor(ccReg); // only one int cc reg is available
OpenPOWER on IntegriCloud