[CodeGenPrepare] Compress a pair. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243759 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2015-07-31 17:00:39 +00:00
parent 8ae0800ae1
commit 3973e4b71b

View File

@ -109,11 +109,7 @@ static cl::opt<bool> StressExtLdPromotion(
namespace { namespace {
typedef SmallPtrSet<Instruction *, 16> SetOfInstrs; typedef SmallPtrSet<Instruction *, 16> SetOfInstrs;
struct TypeIsSExt { typedef PointerIntPair<Type *, 1, bool> TypeIsSExt;
Type *Ty;
bool IsSExt;
TypeIsSExt(Type *Ty, bool IsSExt) : Ty(Ty), IsSExt(IsSExt) {}
};
typedef DenseMap<Instruction *, TypeIsSExt> InstrToOrigTy; typedef DenseMap<Instruction *, TypeIsSExt> InstrToOrigTy;
class TypePromotionTransaction; class TypePromotionTransaction;
@ -2433,8 +2429,8 @@ bool TypePromotionHelper::canGetThrough(const Instruction *Inst,
// #1 get the type of the operand and check the kind of the extended bits. // #1 get the type of the operand and check the kind of the extended bits.
const Type *OpndType; const Type *OpndType;
InstrToOrigTy::const_iterator It = PromotedInsts.find(Opnd); InstrToOrigTy::const_iterator It = PromotedInsts.find(Opnd);
if (It != PromotedInsts.end() && It->second.IsSExt == IsSExt) if (It != PromotedInsts.end() && It->second.getInt() == IsSExt)
OpndType = It->second.Ty; OpndType = It->second.getPointer();
else if ((IsSExt && isa<SExtInst>(Opnd)) || (!IsSExt && isa<ZExtInst>(Opnd))) else if ((IsSExt && isa<SExtInst>(Opnd)) || (!IsSExt && isa<ZExtInst>(Opnd)))
OpndType = Opnd->getOperand(0)->getType(); OpndType = Opnd->getOperand(0)->getType();
else else