[llvm] r243759 - [CodeGenPrepare] Compress a pair. No functional change.
Benjamin Kramer
benny.kra at googlemail.com
Fri Jul 31 10:00:40 PDT 2015
Author: d0k
Date: Fri Jul 31 12:00:39 2015
New Revision: 243759
URL: http://llvm.org/viewvc/llvm-project?rev=243759&view=rev
Log:
[CodeGenPrepare] Compress a pair. No functional change.
Modified:
llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
Modified: llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp?rev=243759&r1=243758&r2=243759&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/CodeGenPrepare.cpp Fri Jul 31 12:00:39 2015
@@ -109,11 +109,7 @@ static cl::opt<bool> StressExtLdPromotio
namespace {
typedef SmallPtrSet<Instruction *, 16> SetOfInstrs;
-struct TypeIsSExt {
- Type *Ty;
- bool IsSExt;
- TypeIsSExt(Type *Ty, bool IsSExt) : Ty(Ty), IsSExt(IsSExt) {}
-};
+typedef PointerIntPair<Type *, 1, bool> TypeIsSExt;
typedef DenseMap<Instruction *, TypeIsSExt> InstrToOrigTy;
class TypePromotionTransaction;
@@ -2433,8 +2429,8 @@ bool TypePromotionHelper::canGetThrough(
// #1 get the type of the operand and check the kind of the extended bits.
const Type *OpndType;
InstrToOrigTy::const_iterator It = PromotedInsts.find(Opnd);
- if (It != PromotedInsts.end() && It->second.IsSExt == IsSExt)
- OpndType = It->second.Ty;
+ if (It != PromotedInsts.end() && It->second.getInt() == IsSExt)
+ OpndType = It->second.getPointer();
else if ((IsSExt && isa<SExtInst>(Opnd)) || (!IsSExt && isa<ZExtInst>(Opnd)))
OpndType = Opnd->getOperand(0)->getType();
else
More information about the llvm-commits
mailing list