When printing a SCEVUnknown with pointer type, don't print an
authorDan Gohman <gohman@apple.com>
Fri, 1 May 2009 17:02:22 +0000 (17:02 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 1 May 2009 17:02:22 +0000 (17:02 +0000)
artificial "ptrtoint", as it tends to clutter up complicated
expressions. The cast operators now print both source and
destination types, which is usually sufficient.

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

lib/Analysis/ScalarEvolution.cpp
test/Analysis/ScalarEvolution/max-trip-count.ll

index ba1cbb156d1589c55dffaa0899e03dc9056eaaa3..d458399c0553b5c8192b5fda0f132a933a031cca 100644 (file)
@@ -434,11 +434,7 @@ const Type *SCEVUnknown::getType() const {
 }
 
 void SCEVUnknown::print(raw_ostream &OS) const {
-  if (isa<PointerType>(V->getType()))
-    OS << "(ptrtoint " << *V->getType() << " ";
   WriteAsOperand(OS, V, false);
-  if (isa<PointerType>(V->getType()))
-    OS << " to iPTR)";
 }
 
 //===----------------------------------------------------------------------===//
index ab88f1348abc68daf513c06e603948eae3239c40..05674149da82545b038e5d9cb3eaa1d6560f9ca9 100644 (file)
@@ -1,5 +1,5 @@
 ; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \
-; RUN:   | grep {\{(ptrtoint i32\\* %d to iPTR),+,4\}<bb>}
+; RUN:   | grep {\{%d,+,4\}<bb>}
 
 define void @foo(i32* nocapture %d, i32 %n) nounwind {
 entry: