Small fix for cost analysis of ptrtoint.
authorPatrik Hagglund <patrik.h.hagglund@ericsson.com>
Tue, 12 Mar 2013 13:18:30 +0000 (13:18 +0000)
committerPatrik Hagglund <patrik.h.hagglund@ericsson.com>
Tue, 12 Mar 2013 13:18:30 +0000 (13:18 +0000)
This seems to be a "copy-paste error" introducecd in r156140.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176863 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/TargetTransformInfo.cpp

index 72421a00c767061f19e47029cf8cabffe0895160..976cd873213f98e666e4fc81d8762087e9b3abb0 100644 (file)
@@ -263,8 +263,8 @@ struct NoTTI : ImmutablePass, TargetTransformInfo {
     case Instruction::PtrToInt:
       // A ptrtoint cast is free so long as the result is large enough to store
       // the pointer, and a legal integer type.
-      if (DL && DL->isLegalInteger(OpTy->getScalarSizeInBits()) &&
-          OpTy->getScalarSizeInBits() >= DL->getPointerSizeInBits())
+      if (DL && DL->isLegalInteger(Ty->getScalarSizeInBits()) &&
+          Ty->getScalarSizeInBits() >= DL->getPointerSizeInBits())
         return TCC_Free;
 
       // Otherwise it's not a no-op.