From: Dan Gohman Date: Wed, 29 Apr 2009 20:27:52 +0000 (+0000) Subject: Include the source type in SCEV cast expression debug output, and X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=36b8e53fe069862627cd06d82767a4253e24638d;p=oota-llvm.git 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70405 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 42d2fdd3629..b81df12b4c6 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -219,7 +219,7 @@ SCEVTruncateExpr::~SCEVTruncateExpr() { } 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 @@ SCEVZeroExtendExpr::~SCEVZeroExtendExpr() { } 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 @@ SCEVSignExtendExpr::~SCEVSignExtendExpr() { } 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 diff --git a/test/Analysis/ScalarEvolution/sext-inreg.ll b/test/Analysis/ScalarEvolution/sext-inreg.ll index c482fe6cf57..8a88f0f7d96 100644 --- a/test/Analysis/ScalarEvolution/sext-inreg.ll +++ b/test/Analysis/ScalarEvolution/sext-inreg.ll @@ -1,5 +1,6 @@ -; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output \ -; RUN: | grep {signextend \{0,+,199\} to i64} | count 2 +; RUN: llvm-as < %s | opt -analyze -scalar-evolution -disable-output > %t +; RUN: grep {sext i57 \{0,+,199\} to i64} %t | count 1 +; RUN: grep {sext i59 \{0,+,199\} 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"