[llvm-commits] [llvm] r70405 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/sext-inreg.ll

Dan Gohman gohman at apple.com
Wed Apr 29 13:27:53 PDT 2009


Author: djg
Date: Wed Apr 29 15:27:52 2009
New Revision: 70405

URL: http://llvm.org/viewvc/llvm-project?rev=70405&view=rev
Log:
Include the source type in SCEV cast expression debug output, and
print sext, zext, and trunc, instead of signextend, zeroextend,
and truncate, respectively, for consistency with the main IR.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp
    llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=70405&r1=70404&r2=70405&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Wed Apr 29 15:27:52 2009
@@ -219,7 +219,7 @@
 }
 
 void SCEVTruncateExpr::print(raw_ostream &OS) const {
-  OS << "(truncate " << *Op << " to " << *Ty << ")";
+  OS << "(trunc " << *Op->getType() << " " << *Op << " to " << *Ty << ")";
 }
 
 // SCEVZeroExtends - Only allow the creation of one SCEVZeroExtendExpr for any
@@ -240,7 +240,7 @@
 }
 
 void SCEVZeroExtendExpr::print(raw_ostream &OS) const {
-  OS << "(zeroextend " << *Op << " to " << *Ty << ")";
+  OS << "(zext " << *Op->getType() << " " << *Op << " to " << *Ty << ")";
 }
 
 // SCEVSignExtends - Only allow the creation of one SCEVSignExtendExpr for any
@@ -261,7 +261,7 @@
 }
 
 void SCEVSignExtendExpr::print(raw_ostream &OS) const {
-  OS << "(signextend " << *Op << " to " << *Ty << ")";
+  OS << "(sext " << *Op->getType() << " " << *Op << " to " << *Ty << ")";
 }
 
 // SCEVCommExprs - Only allow the creation of one SCEVCommutativeExpr for any

Modified: llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll?rev=70405&r1=70404&r2=70405&view=diff

==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/sext-inreg.ll Wed Apr 29 15:27:52 2009
@@ -1,5 +1,6 @@
-; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \
-; RUN:  | grep {signextend \{0,+,199\}<bb> to i64} | count 2
+; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output > %t
+; RUN: grep {sext i57 \{0,+,199\}<bb> to i64} %t | count 1
+; RUN: grep {sext i59 \{0,+,199\}<bb> to i64} %t | count 1
 
 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
 target triple = "i386-apple-darwin9.6"





More information about the llvm-commits mailing list