[llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.php
Changes in directory nightlytest-serverside: NightlyTestAccept.php updated: 1.60 -> 1.61 --- Log message: Hack link until log path fixed. --- Diffs of the changes: (+1 -1) NightlyTestAccept.php |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: nightlytest-serverside/NightlyTestAccept.php diff -u nightlytest-serverside/NightlyTestAccept.php:1.60 nightlytest-serverside/NightlyTestAccept.php:1.61 --- nightlytest-serverside/NightlyTestAccept.php:1.60 Wed Oct 18 14:26:22 2006 +++ nightlytest-serverside/NightlyTestAccept.phpMon Dec 4 03:36:35 2006 @@ -933,7 +933,7 @@ } else{ $email .= "\nBuildlog available at http://llvm.org/nightlytest/";. -"machines/$machine_id/$db_date-Build-Log.txt\n"; +"machines/$db_date-Build-Log.txt\n"; } $email_addr = "[EMAIL PROTECTED]"; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/DebugStuff.ll
Changes in directory llvm/test/Regression/CodeGen/Generic: DebugStuff.ll (r1.6) removed --- Log message: Duplicate of Regression/Debugger/funccall.ll. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/DebugInfo/funccall.c funccall.ll
Changes in directory llvm/test/Regression/DebugInfo: funccall.c added (r1.1) funccall.ll added (r1.1) --- Log message: Fixed to use current debug info. --- Diffs of the changes: (+183 -0) funccall.c | 17 ++ funccall.ll | 166 2 files changed, 183 insertions(+) Index: llvm/test/Regression/DebugInfo/funccall.c diff -c /dev/null llvm/test/Regression/DebugInfo/funccall.c:1.1 *** /dev/null Mon Dec 4 06:23:27 2006 --- llvm/test/Regression/DebugInfo/funccall.c Mon Dec 4 06:23:17 2006 *** *** 0 --- 1,17 + + static int q; + + void foo() { + int t = q; + q = t + 1; + } + int main() { + q = 0; + foo(); + q = q - 1; + + return q; + } + + // This is the source that corresponds to funccall.ll + // RUN: echo foo Index: llvm/test/Regression/DebugInfo/funccall.ll diff -c /dev/null llvm/test/Regression/DebugInfo/funccall.ll:1.1 *** /dev/null Mon Dec 4 06:23:32 2006 --- llvm/test/Regression/DebugInfo/funccall.ll Mon Dec 4 06:23:17 2006 *** *** 0 --- 1,166 + ;; RUN: llvm-as < %s | llc + + ;; Debugger type declarations + %llvm.dbg.anchor.type = type { uint, uint } + %llvm.dbg.basictype.type = type { uint, { }*, sbyte*, { }*, uint, ulong, ulong, ulong, uint, uint } + %llvm.dbg.compile_unit.type = type { uint, { }*, uint, sbyte*, sbyte*, sbyte* } + %llvm.dbg.global_variable.type = type { uint, { }*, { }*, sbyte*, sbyte*, sbyte*, { }*, uint, { }*, bool, bool, { }* } + %llvm.dbg.subprogram.type = type { uint, { }*, { }*, sbyte*, sbyte*, sbyte*, { }*, uint, { }*, bool, bool } + %llvm.dbg.variable.type = type { uint, { }*, sbyte*, { }*, uint, { }* } + + ;; Debugger intrinsic declarations... + declare void %llvm.dbg.func.start({ }*) + declare void %llvm.dbg.stoppoint(uint, uint, { }*) + declare void %llvm.dbg.declare({ }*, { }*) + declare void %llvm.dbg.region.start({ }*) + declare void %llvm.dbg.region.end({ }*) + + ;; Debugger anchors + %llvm.dbg.subprograms = linkonce constant %llvm.dbg.anchor.type { + uint 393216, ;; DW_TAG_anchor | version(6) + uint 46 }, section "llvm.metadata" ;; DW_TAG_subprogram + %llvm.dbg.compile_units = linkonce constant %llvm.dbg.anchor.type { + uint 393216, ;; DW_TAG_anchor | version(6) + uint 17 }, section "llvm.metadata" ;; DW_TAG_compile_unit + %llvm.dbg.global_variables = linkonce constant %llvm.dbg.anchor.type { + uint 393216, ;; DW_TAG_anchor | version(6) + uint 52 }, section "llvm.metadata" ;; DW_TAG_variable + + ;; Debug info + %llvm.dbg.subprogram = internal constant %llvm.dbg.subprogram.type { + uint 393262, ;; DW_TAG_subprogram | version(6) + { }* bitcast (%llvm.dbg.anchor.type* %llvm.dbg.subprograms to { }*), ;; Anchor + { }* bitcast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*),;; Context + sbyte* getelementptr ([4 x sbyte]* %str, int 0, int 0), ;; Name + sbyte* getelementptr ([4 x sbyte]* %str, int 0, int 0), ;; Fully quanlified name + sbyte* null, ;; Linkage name + { }* bitcast (%llvm.dbg.compile_unit.type* %llvm.dbg.compile_unit to { }*),;; Compile unit + uint 4, ;; Line number + { }* null, ;; Type descriptor + bool false, ;; Static? + bool true }, section "llvm.metadata" ;; External? + %str = internal constant [4 x sbyte] c"foo\00", section "llvm.metadata" + + %llvm.dbg.compile_unit = internal constant %llvm.dbg.compile_unit.type { + uint 393233, ;; DW_TAG_compile_unit | version(6) + { }* bitcast (%llvm.dbg.anchor.type* %llvm.dbg.compile_units to { }*), ;; Anchor + uint 1, ;; Language + sbyte* getelementptr ([11 x sbyte]* %str, int 0, int 0), ;; Source file + sbyte* getelementptr ([50 x sbyte]* %str, int 0, int 0), ;; Source file directory + sbyte* getelementptr ([45 x sbyte]* %str, int 0, int 0) }, section "llvm.metadata" ;; Produceer + %str = internal constant [11 x sbyte] c"funccall.c\00", section "llvm.metadata" + %str = internal constant [50 x sbyte] c"/Volumes/Big2/
[llvm-commits] CVS: llvm/test/Regression/Debugger/.cvsignore dg.exp funccall.c funccall.ll
Changes in directory llvm/test/Regression/Debugger: .cvsignore (r1.1) removed dg.exp (r1.3) removed funccall.c (r1.4) removed funccall.ll (r1.15) removed --- Log message: Moving to DebugInfo. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll
Changes in directory llvm/test/Regression/Transforms/ADCE: 2005-02-17-PHI-Invoke-Crash.ll updated: 1.2 -> 1.3 --- Log message: Remove debug info. --- Diffs of the changes: (+0 -5) 2005-02-17-PHI-Invoke-Crash.ll |5 - 1 files changed, 5 deletions(-) Index: llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll diff -u llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll:1.2 llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll:1.3 --- llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/Regression/Transforms/ADCE/2005-02-17-PHI-Invoke-Crash.ll Mon Dec 4 11:06:15 2006 @@ -2,12 +2,8 @@ implementation ; Functions: -declare { }* %llvm.dbg.region.end({ }*) - declare void %strlen() - declare void %_ZN10QByteArray6resizeEi() - declare void %q_atomic_decrement() void %_ZNK10QByteArray13leftJustifiedEicb() { @@ -44,6 +40,5 @@ terminate: ; preds = %invoke_catch.1, %invoke_catch.0 %dbg.0.1 = phi { }* [ null, %invoke_catch.1 ], [ null, %invoke_catch.0 ] ; <{ }*> [#uses=1] - %dbg.tmp.43 = call { }* %llvm.dbg.region.end( { }* %dbg.0.1 ) ; <{ }*> [#uses=0] unreachable } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp
Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.61 -> 1.62 --- Log message: Fix inferred casts. --- Diffs of the changes: (+9 -6) ScalarEvolution.cpp | 15 +-- 1 files changed, 9 insertions(+), 6 deletions(-) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.61 llvm/lib/Analysis/ScalarEvolution.cpp:1.62 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.61 Fri Dec 1 20:22:01 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Mon Dec 4 11:05:42 2006 @@ -178,7 +178,8 @@ // Make sure that SCEVConstant instances are all unsigned. if (V->getType()->isSigned()) { const Type *NewTy = V->getType()->getUnsignedVersion(); -V = cast(ConstantExpr::getCast(V, NewTy)); +V = cast( +ConstantExpr::getInferredCast(V, false, NewTy, false)); } SCEVConstant *&R = (*SCEVConstants)[V]; @@ -465,7 +466,7 @@ C = ConstantInt::get(Ty, Val); else { C = ConstantInt::get(Ty->getSignedVersion(), Val); -C = ConstantExpr::getCast(C, Ty); +C = ConstantExpr::getInferredCast(C, true, Ty, false); } return SCEVUnknown::get(C); } @@ -511,7 +512,8 @@ for (; NumSteps; --NumSteps) Result *= Val-(NumSteps-1); Constant *Res = ConstantInt::get(Type::ULongTy, Result); -return SCEVUnknown::get(ConstantExpr::getCast(Res, V->getType())); +return SCEVUnknown::get( +ConstantExpr::getInferredCast(Res, false, V->getType(), true)); } const Type *Ty = V->getType(); @@ -996,10 +998,11 @@ Constant *LHSCV = LHSC->getValue(); Constant *RHSCV = RHSC->getValue(); if (LHSCV->getType()->isUnsigned()) -LHSCV = ConstantExpr::getCast(LHSCV, - LHSCV->getType()->getSignedVersion()); +LHSCV = ConstantExpr::getInferredCast( +LHSCV, false, LHSCV->getType()->getSignedVersion(), true); if (RHSCV->getType()->isUnsigned()) -RHSCV = ConstantExpr::getCast(RHSCV, LHSCV->getType()); +RHSCV = ConstantExpr::getInferredCast( +RHSCV, false, LHSCV->getType(), true); return SCEVUnknown::get(ConstantExpr::getSDiv(LHSCV, RHSCV)); } } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolutionExpander.cpp
Changes in directory llvm/lib/Analysis: ScalarEvolutionExpander.cpp updated: 1.6 -> 1.7 --- Log message: Fix 80 cols violation --- Diffs of the changes: (+3 -2) ScalarEvolutionExpander.cpp |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/ScalarEvolutionExpander.cpp diff -u llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.6 llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.7 --- llvm/lib/Analysis/ScalarEvolutionExpander.cpp:1.6 Tue Nov 28 18:19:40 2006 +++ llvm/lib/Analysis/ScalarEvolutionExpander.cpp Mon Dec 4 11:04:44 2006 @@ -15,6 +15,7 @@ #include "llvm/Analysis/LoopInfo.h" #include "llvm/Analysis/ScalarEvolutionExpander.h" + using namespace llvm; /// InsertCastOfTo - Insert a cast of V to the specified type, doing what @@ -38,8 +39,8 @@ return CI; } } -return CastInst::createInferredCast(V, Ty, V->getName(), - A->getParent()->getEntryBlock().begin()); +return CastInst::createInferredCast( +V, Ty, V->getName(), A->getParent()->getEntryBlock().begin()); } Instruction *I = cast(V); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/x86-64-mem.ll
Changes in directory llvm/test/Regression/CodeGen/X86: x86-64-mem.ll updated: 1.2 -> 1.3 --- Log message: Fix test. --- Diffs of the changes: (+8 -8) x86-64-mem.ll | 16 1 files changed, 8 insertions(+), 8 deletions(-) Index: llvm/test/Regression/CodeGen/X86/x86-64-mem.ll diff -u llvm/test/Regression/CodeGen/X86/x86-64-mem.ll:1.2 llvm/test/Regression/CodeGen/X86/x86-64-mem.ll:1.3 --- llvm/test/Regression/CodeGen/X86/x86-64-mem.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/Regression/CodeGen/X86/x86-64-mem.ll Mon Dec 4 12:06:24 2006 @@ -1,11 +1,11 @@ -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 | grep GOTPCREL | wc -l | grep 4 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 | grep rip | wc -l | grep 6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 | grep movq | wc -l | grep 6 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 | grep leaq | wc -l | grep 1 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 -relocation-model=static | grep rip | wc -l | grep 4 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 -relocation-model=static | grep movl | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86-64 -relocation-model=static | grep movq | wc -l | grep 2 +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep GOTPCREL | wc -l | grep 4 && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep rip | wc -l | grep 6 && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep movq | wc -l | grep 6 && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin | grep leaq | wc -l | grep 1 && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep rip | wc -l | grep 4 && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep movl | wc -l | grep 2 && +; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=x86_64-apple-darwin -relocation-model=static | grep movq | wc -l | grep 2 %ptr = external global int* %src = external global [0 x int] ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
> Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp > diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.557 > llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.558 > --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.557 Fri > Dec 1 18:13:08 2006 > +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Sun Dec 3 > 20:48:01 2006 > @@ -388,7 +388,8 @@ > >// If this is another cast that can be eliminated, it isn't > codegen either. >if (const CastInst *CI = dyn_cast(V)) > -if (isEliminableCastPair(CI, CastInst::getCastOpcode(V, Ty), > Ty, TD)) > +if (isEliminableCastPair(CI, CastInst::getCastOpcode( > +V, V->getType()->isSigned(), Ty, Ty->isSigned()), Ty, > TD)) >return false; >return true; > } Won't this miscompile stuff like: %B = zext sbyte %A to ushort %C = zext ushort %B to uint into a sext? -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll
Changes in directory llvm/test/Regression/CodeGen/X86: 2006-12-04-X86-64-Bitcast.ll added (r1.1) --- Log message: Test case for PR1033: http://llvm.org/PR1033 , x86-64 code gen fails on bitcast. --- Diffs of the changes: (+12 -0) 2006-12-04-X86-64-Bitcast.ll | 12 1 files changed, 12 insertions(+) Index: llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll:1.1 *** /dev/null Mon Dec 4 12:25:06 2006 --- llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll Mon Dec 4 12:24:56 2006 *** *** 0 --- 1,12 + ; PR1033 + ; RUN: llvm-as < %s | llc -march=x86-64 + long %p(double %t) { + %u = bitcast double %t to long + ret long %u + } + + double %q(long %t) { + %u = bitcast long %t to double + ret double %u + } + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
On Mon, 2006-12-04 at 10:22 -0800, Chris Lattner wrote: > >// If this is another cast that can be eliminated, it isn't > > codegen either. > >if (const CastInst *CI = dyn_cast(V)) > > -if (isEliminableCastPair(CI, CastInst::getCastOpcode(V, Ty), > > Ty, TD)) > > +if (isEliminableCastPair(CI, CastInst::getCastOpcode( > > +V, V->getType()->isSigned(), Ty, Ty->isSigned()), Ty, > > TD)) > >return false; > >return true; > > } > > Won't this miscompile stuff like: > > %B = zext sbyte %A to ushort > %C = zext ushort %B to uint > > into a sext? No. This patch doesn't change anything. The only reason for this change is the change in signature for getCastOpcode. See the corresponding change in getCastOpcode. This passed everything on Linux last night before I committed it. Reid. > > -Chris > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits signature.asc Description: This is a digitally signed message part ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/LangRef.html
> Index: llvm/docs/LangRef.html > diff -u llvm/docs/LangRef.html:1.174 llvm/docs/LangRef.html:1.175 > --- llvm/docs/LangRef.html:1.174 Mon Nov 27 15:53:28 2006 > +++ llvm/docs/LangRef.htmlSun Dec 3 10:53:48 2006 > @@ -2491,9 +2491,9 @@ > provided depend on the type of the first pointer argument. The > 'getelementptr' instruction is used to index down through > the type > levels of a structure or to a specific index in an array. When > indexing into a > -structure, only uint > -integer constants are allowed. When indexing into an array or > pointer, > -int and long and ulong indexes are > allowed. > +structure, only uint integer constants are allowed. When > indexing > +into an array or pointer, integers of any size are allowed, and > will be sign > +extended to 64-bit values. I thought only 32- and 64-bit integers were allowed? > For example, let's consider a C code fragment and how it gets > compiled to LLVM: > @@ -2534,9 +2534,10 @@ > > The index types specified for the 'getelementptr' > instruction depend > on the pointer type that is being indexed into. href="#t_pointer">Pointer > -and array types require int, > -ulong, or long values, and href="#t_struct">structure > -types require uint constants. > +and array types can use any > +integer type but the value will always be > sign extended > +to 64-bits. Likewise. Also, please add 'packed' to the list. Thanks, -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
On Dec 4, 2006, at 10:33 AM, Reid Spencer wrote: > On Mon, 2006-12-04 at 10:22 -0800, Chris Lattner wrote: >>>// If this is another cast that can be eliminated, it isn't >>> codegen either. >>>if (const CastInst *CI = dyn_cast(V)) >>> -if (isEliminableCastPair(CI, CastInst::getCastOpcode(V, Ty), >>> Ty, TD)) >>> +if (isEliminableCastPair(CI, CastInst::getCastOpcode( >>> +V, V->getType()->isSigned(), Ty, Ty->isSigned()), Ty, >>> TD)) >>>return false; >>>return true; >>> } >> >> Won't this miscompile stuff like: >> >> %B = zext sbyte %A to ushort >> %C = zext ushort %B to uint >> >> into a sext? > > No. This patch doesn't change anything. I never claimed it wasn't broken before. We have *known* breakage in the tree still from your cast patch that we're still trying to track down. > The only reason for this change > is the change in signature for getCastOpcode. See the corresponding > change in getCastOpcode. This passed everything on Linux last night > before I committed it. Okay, this code isn't miscompiled because it isn't called in this case. After looking at it closer, I still don't see why it's safe. Specifically, why do you think it is safe for the sign of Ty or V to determine whether the cast is a sext or zext? The only way to fix this is for clients to pass in the kind of cast it is interested in. Looking at the callers, the only possibilities are sext/zext/trunc/bitcast. Treating zext and sext incorrectly *can* miscompile code. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/LangRef.html
On Mon, 2006-12-04 at 10:29 -0800, Chris Lattner wrote: > I thought only 32- and 64-bit integers were allowed? I thought we agreed on any size for sequential type indices. See PR950. I codified the rules after we agreed on them. Reid signature.asc Description: This is a digitally signed message part ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll
Changes in directory llvm/test/Regression/CodeGen/X86: 2006-12-04-X86-64-Bitcast.ll updated: 1.1 -> 1.2 --- Log message: XFAIL until PR1033: http://llvm.org/PR1033 is fixed. --- Diffs of the changes: (+1 -0) 2006-12-04-X86-64-Bitcast.ll |1 + 1 files changed, 1 insertion(+) Index: llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll diff -u llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll:1.1 llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll:1.2 --- llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll:1.1 Mon Dec 4 12:24:56 2006 +++ llvm/test/Regression/CodeGen/X86/2006-12-04-X86-64-Bitcast.ll Mon Dec 4 12:39:14 2006 @@ -1,5 +1,6 @@ ; PR1033 ; RUN: llvm-as < %s | llc -march=x86-64 +; XFAIL: * long %p(double %t) { %u = bitcast double %t to long ret long %u ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp
Reid, I don't like this series of patches. You're replacing one evil with another. Please endeavor to figure out what type of cast is actually needed and put it in, rather than changing one sort of inferred cast into another. > Index: llvm/lib/Analysis/ScalarEvolution.cpp > diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.61 llvm/lib/ > Analysis/ScalarEvolution.cpp:1.62 > --- llvm/lib/Analysis/ScalarEvolution.cpp:1.61Fri Dec 1 20:22:01 > 2006 > +++ llvm/lib/Analysis/ScalarEvolution.cpp Mon Dec 4 11:05:42 2006 > @@ -178,7 +178,8 @@ >// Make sure that SCEVConstant instances are all unsigned. >if (V->getType()->isSigned()) { > const Type *NewTy = V->getType()->getUnsignedVersion(); > -V = cast(ConstantExpr::getCast(V, NewTy)); > +V = cast( > +ConstantExpr::getInferredCast(V, false, NewTy, false)); >} This is always a bitcast. >SCEVConstant *&R = (*SCEVConstants)[V]; > @@ -465,7 +466,7 @@ > C = ConstantInt::get(Ty, Val); >else { > C = ConstantInt::get(Ty->getSignedVersion(), Val); > -C = ConstantExpr::getCast(C, Ty); > +C = ConstantExpr::getInferredCast(C, true, Ty, false); With your constantint changes, you can just replace: else if (Ty->isSigned()) C = ConstantInt::get(Ty, Val); else { C = ConstantInt::get(Ty->getSignedVersion(), Val); C = ConstantExpr::getInferredCast(C, true, Ty, false); } with: else C = ConstantInt::get(Ty, Val); Even if you kept the cast (which you shouldn't), it is always a bitcast. > @@ -511,7 +512,8 @@ > for (; NumSteps; --NumSteps) >Result *= Val-(NumSteps-1); > Constant *Res = ConstantInt::get(Type::ULongTy, Result); > -return SCEVUnknown::get(ConstantExpr::getCast(Res, V->getType > ())); > +return SCEVUnknown::get( > +ConstantExpr::getInferredCast(Res, false, V->getType(), > true)); I'd rather this be written as: if (V->getType() != Type::ULongTy) Res = ConstantExpr::getCast(Truncate, Res, V->getType()); return Res; >} > >const Type *Ty = V->getType(); > @@ -996,10 +998,11 @@ >Constant *LHSCV = LHSC->getValue(); >Constant *RHSCV = RHSC->getValue(); >if (LHSCV->getType()->isUnsigned()) > -LHSCV = ConstantExpr::getCast(LHSCV, > - LHSCV->getType()- > >getSignedVersion()); > +LHSCV = ConstantExpr::getInferredCast( > +LHSCV, false, LHSCV->getType()->getSignedVersion(), > true); >if (RHSCV->getType()->isUnsigned()) > -RHSCV = ConstantExpr::getCast(RHSCV, LHSCV->getType()); > +RHSCV = ConstantExpr::getInferredCast( > +RHSCV, false, LHSCV->getType(), true); >return SCEVUnknown::get(ConstantExpr::getSDiv(LHSCV, RHSCV)); > } >} This is all dead now that types are signless for div, replace it with: return SCEVUnknown::get(ConstantExpr::getSDiv(LHSC->getValue (), RHSC->getValue())); -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.176 -> 1.177 --- Log message: Reduce the size of the ExprMapKeyType class. --- Diffs of the changes: (+3 -3) Constants.cpp |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.176 llvm/lib/VMCore/Constants.cpp:1.177 --- llvm/lib/VMCore/Constants.cpp:1.176 Sun Dec 3 23:19:50 2006 +++ llvm/lib/VMCore/Constants.cpp Mon Dec 4 12:38:05 2006 @@ -1359,10 +1359,10 @@ // struct ExprMapKeyType { explicit ExprMapKeyType(unsigned opc, std::vector ops, - unsigned short pred = 0) : opcode(opc), operands(ops), predicate(pred) { } - unsigned opcode; + unsigned short pred = 0) : opcode(opc), predicate(pred), operands(ops) { } + uint16_t opcode; + uint16_t predicate; std::vector operands; - unsigned short predicate; bool operator==(const ExprMapKeyType& that) const { return this->opcode == that.opcode && this->predicate == that.predicate && ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/LangRef.html
On Dec 4, 2006, at 10:40 AM, Reid Spencer wrote: > On Mon, 2006-12-04 at 10:29 -0800, Chris Lattner wrote: > >> I thought only 32- and 64-bit integers were allowed? > > I thought we agreed on any size for sequential type indices. See > PR950. > I codified the rules after we agreed on them. The bc format is currently more efficient due to this restriction. Are going to lose that? -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp
Changes in directory llvm/lib/Target/X86: X86TargetMachine.cpp updated: 1.128 -> 1.129 --- Log message: Non-darwin gcc should default to static relocation to match gcc. --- Diffs of the changes: (+1 -1) X86TargetMachine.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/X86/X86TargetMachine.cpp diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.128 llvm/lib/Target/X86/X86TargetMachine.cpp:1.129 --- llvm/lib/Target/X86/X86TargetMachine.cpp:1.128 Fri Nov 17 01:52:03 2006 +++ llvm/lib/Target/X86/X86TargetMachine.cppMon Dec 4 12:07:10 2006 @@ -113,7 +113,7 @@ if (Subtarget.isTargetDarwin()) setRelocationModel(Reloc::DynamicNoPIC); else - setRelocationModel(Reloc::PIC_); + setRelocationModel(Reloc::Static); if (Subtarget.is64Bit()) { // No DynamicNoPIC support under X86-64. if (getRelocationModel() == Reloc::DynamicNoPIC) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/LowerSetJmp/2005-05-05-OldUses.ll
Changes in directory llvm/test/Regression/Transforms/LowerSetJmp: 2005-05-05-OldUses.ll (r1.2) removed --- Log message: Purpose of test is lost in upgrade. --- Diffs of the changes: (+0 -0) 0 files changed ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
> --- llvm/lib/VMCore/ConstantFolding.cpp:1.105 Fri Dec 1 13:50:54 2006 > +++ llvm/lib/VMCore/ConstantFolding.cpp Sun Dec 3 20:45:43 2006 > @@ -777,7 +777,8 @@ > uint64_t V = >DoubleToBits(cast(CP->getOperand(i))- > >getValue()); > Constant *C = ConstantInt::get(Type::ULongTy, V); > -Result.push_back(ConstantExpr::getCast(C, DstEltTy)); > +Result.push_back( > +ConstantExpr::getInferredCast(C, false, DstEltTy, > false)); >} >return ConstantPacked::get(Result); > } This is always a bitcast. > @@ -786,7 +787,8 @@ > for (unsigned i = 0; i != SrcNumElts; ++i) { >uint32_t V = FloatToBits(cast(CP->getOperand(i))- > >getValue()); >Constant *C = ConstantInt::get(Type::UIntTy, V); > - Result.push_back(ConstantExpr::getCast(C, DstEltTy)); > + Result.push_back( > +ConstantExpr::getInferredCast(C, false, DstEltTy, false)); > } > return ConstantPacked::get(Result); >} Likewise. > @@ -853,6 +854,7 @@ >break; > } >if (isAllNull) > +// This is casting one pointer type to another, always > BitCast > return ConstantExpr::getCast(CE->getOperand(0), DestTy); > } >} If so, why not create a bitcast explicitly? BTW, if you want to add ConstantExpr::getBitCast (and friends) to make it easier to do this, go for it. > @@ -1632,9 +1634,13 @@ > // gep null, C is equal to C*sizeof(nullty). If nullty is > a known llvm > // type, we can statically fold this. > Constant *R = ConstantInt::get(Type::UIntTy, ElSize); > -R = ConstantExpr::getCast(R, Idx0->getType()); > -R = ConstantExpr::getMul(R, Idx0); > -return ConstantExpr::getCast(R, C->getType()); > +// We know R is unsigned, Idx0 is signed because it must > be an index > +// through a sequential type (gep pointer operand) which > is always > +// signed. > +R = ConstantExpr::getInferredCast(R, false, Idx0->getType > (), true); > +R = ConstantExpr::getMul(R, Idx0); // signed multiply > +// R is a signed integer, C is the GEP pointer so -> IntToPtr > +return ConstantExpr::getCast(Instruction::IntToPtr, R, C- > >getType()); >} > } >} Please consider using ConstantExpr::getZExtOrBitCast (as I just emailed to llvm commits). > @@ -1662,11 +1668,16 @@ > // Otherwise it must be an array. > if (!Idx0->isNullValue()) { >const Type *IdxTy = Combined->getType(); > - if (IdxTy != Idx0->getType()) IdxTy = Type::LongTy; > - Combined = > -ConstantExpr::get(Instruction::Add, > - ConstantExpr::getCast(Idx0, IdxTy), > - ConstantExpr::getCast(Combined, > IdxTy)); > + if (IdxTy != Idx0->getType()) { > +Constant *C1 = ConstantExpr::getInferredCast( > +Idx0, true, Type::LongTy, true); > +Constant *C2 = ConstantExpr::getInferredCast( > +Combined, true, Type::LongTy, true); > +Combined = ConstantExpr::get(Instruction::Add, C1, C2); Please use: ConstantExpr::getSExtOrBitCast -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] getInferredCast proposal
Reid, Most of your uses of getInferredCast fall into one of these categories: 1. They can only be one type of cast. 2. They can be a [bitcast or trunc] or [bitcast or zext] or [bitcast or sext]. The former should be eliminated obviously, so I want to talk about the later. As a specific example, consider: // gep null, C is equal to C*sizeof(nullty). If nullty is a known llvm // type, we can statically fold this. Constant *R = ConstantInt::get(Type::UIntTy, ElSize); +// We know R is unsigned, Idx0 is signed because it must be an index +// through a sequential type (gep pointer operand) which is always +// signed. +R = ConstantExpr::getInferredCast(R, false, Idx0->getType(), true); +R = ConstantExpr::getMul(R, Idx0); // signed multiply +// R is a signed integer, C is the GEP pointer so -> IntToPtr +return ConstantExpr::getCast(Instruction::IntToPtr, R, C- >getType()); In this case, we know that the cast is either bitcast to uint/int or a zext to long/ulong [1]. Because you know this, you have a 3 line comment trying to explain what is going on, and that comment is confusing (it talks about the types of values, when values are about to be untyped). What we really want to do is talk about the possible extension happening here. As such, I think it would be much cleaner to split up getInferredCast into: ConstantExpr::getZExtOrBitCast(..) ConstantExpr::getSExtOrBitCast(..) ConstantExpr::getTruncOrBitCast(..) This would allow writing this code as: // gep null, C is equal to C*sizeof(nullty). If nullty is a known llvm // type, we can statically fold this. Constant *R = ConstantInt::get(Type::UIntTy, ElSize); +R = ConstantExpr::getZExtOrBitCast(R, Idx0->getType()); +R = ConstantExpr::getMul(R, Idx0); // signed multiply +// R is a signed integer, C is the GEP pointer so -> IntToPtr +return ConstantExpr::getCast(Instruction::IntToPtr, R, C- >getType()); The need for the comment goes away. Even *better*, the method can assert that the types make sense for this (e.g. a trunc isn't from smaller to larger) as opposed to the totally unconstrained getInferredCast. This makes the code a) more self documenting as to what is going on and b) much more strict about checking itself. What do you think? Would this allow us to completely eliminate getInferredCast? -Chris [1]. As an aside, if you relaxed the type constraints of GEP indices, this gets much messier. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/releases/1.8/index.html
Changes in directory llvm-www/releases/1.8: index.html added (r1.1) --- Log message: Auto redirect --- Diffs of the changes: (+94 -0) index.html | 94 + 1 files changed, 94 insertions(+) Index: llvm-www/releases/1.8/index.html diff -c /dev/null llvm-www/releases/1.8/index.html:1.1 *** /dev/null Mon Dec 4 13:19:00 2006 --- llvm-www/releases/1.8/index.htmlMon Dec 4 13:18:50 2006 *** *** 0 --- 1,94 + + + Download LLVM releases + + + + + + LLVM Download Page + + + + + License + + + + LLVM is distributed under the University of + Illinois Open Source License, an http://www.opensource.org/licenses/UoI-NCSA.php";>OSI-approved + license. + + + + Mailing list + + + If you are interested in LLVM, we strongly encourage you to sign up for the + http://lists.cs.uiuc.edu/mailman/listinfo/llvm-announce";> + LLVM announcements mailing list. This list is an extremely low volume + list (less than one email per month) that is a good way to keep track of the + high-level happenings in the LLVM community. + + + Download + + + + + Always - Anonymous CVS access; release notes. + 19 Nov 2006 - 1.9 release download; release notes. + 9 Aug 2006 - 1.8 release download; release notes. + 20 Apr 2006 - 1.7 release download; release notes. + 08 Nov 2005 - 1.6 release download; release notes. + 18 May 2005 - 1.5 release download; release notes. + 09 Dec 2004 - 1.4 release download; release notes. + 13 Aug 2004 - 1.3 release download; release notes. + 19 Mar 2004 - 1.2 release download; release notes. + 17 Dec 2003 - 1.1 release download; release notes. + 24 Oct 2003 - 1.0 release download; release notes. + + + + + Documentation + + + + LLVM provides extensive documentation in HTML form, which is available in the + source download and online: + + + http://llvm.org";>Current LLVM documentation + Documentation for LLVM 1.9 + Documentation for LLVM 1.8 + Documentation for LLVM 1.7 + Documentation for LLVM 1.6 + Documentation for LLVM 1.5 + Documentation for LLVM 1.4 + Documentation for LLVM 1.3 + Documentation for LLVM 1.2 + Documentation for LLVM 1.1 + Documentation for LLVM 1.0 + + + + + + + + + + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
> Value *visitTruncateExpr(SCEVTruncateExpr *S) { >Value *V = expand(S->getOperand()); > - return CastInst::createInferredCast(V, S->getType(), "tmp.", > InsertPt); > + Instruction::CastOps Opcode = (V->getType()- > >getPrimitiveSizeInBits() == > + S->getType()->getPrimitiveSizeInBits()) ? > Instruction::BitCast : > + Instruction::Trunc; > + return CastInst::create(Opcode, V, S->getType(), "tmp.", > InsertPt); > } > > Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) { >Value *V = expandInTy(S->getOperand(),S->getType()- > >getUnsignedVersion()); > - return CastInst::createInferredCast(V, S->getType(), "tmp.", > InsertPt); > + Instruction::CastOps Opcode = (V->getType()- > >getPrimitiveSizeInBits() == > + S->getType()->getPrimitiveSizeInBits()) ? > Instruction::BitCast : > + Instruction::ZExt; > + return CastInst::create(Opcode, V, S->getType(), "tmp.", > InsertPt); > } These really want CastInst::createZExtOrBitCast methods. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/releases/1.9/index.html
Changes in directory llvm-www/releases/1.9: index.html added (r1.1) --- Log message: Auto redirect --- Diffs of the changes: (+7 -0) index.html |7 +++ 1 files changed, 7 insertions(+) Index: llvm-www/releases/1.9/index.html diff -c /dev/null llvm-www/releases/1.9/index.html:1.1 *** /dev/null Mon Dec 4 13:18:30 2006 --- llvm-www/releases/1.9/index.htmlMon Dec 4 13:18:20 2006 *** *** 0 --- 1,7 + + + + + + + ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/releases/1.8/index.html
Changes in directory llvm-www/releases/1.8: index.html updated: 1.1 -> 1.2 --- Log message: Oops. wrong index.html. Fixed now. --- Diffs of the changes: (+1 -88) index.html | 89 - 1 files changed, 1 insertion(+), 88 deletions(-) Index: llvm-www/releases/1.8/index.html diff -u llvm-www/releases/1.8/index.html:1.1 llvm-www/releases/1.8/index.html:1.2 --- llvm-www/releases/1.8/index.html:1.1Mon Dec 4 13:18:50 2006 +++ llvm-www/releases/1.8/index.htmlMon Dec 4 13:19:54 2006 @@ -1,94 +1,7 @@ - Download LLVM releases - + - - - LLVM Download Page - - - - -License - - - -LLVM is distributed under the University of -Illinois Open Source License, an http://www.opensource.org/licenses/UoI-NCSA.php";>OSI-approved -license. - - - -Mailing list - - -If you are interested in LLVM, we strongly encourage you to sign up for the -http://lists.cs.uiuc.edu/mailman/listinfo/llvm-announce";> -LLVM announcements mailing list. This list is an extremely low volume -list (less than one email per month) that is a good way to keep track of the -high-level happenings in the LLVM community. - - -Download - - - - -Always - Anonymous CVS access; release notes. -19 Nov 2006 - 1.9 release download; release notes. -9 Aug 2006 - 1.8 release download; release notes. -20 Apr 2006 - 1.7 release download; release notes. -08 Nov 2005 - 1.6 release download; release notes. -18 May 2005 - 1.5 release download; release notes. -09 Dec 2004 - 1.4 release download; release notes. -13 Aug 2004 - 1.3 release download; release notes. -19 Mar 2004 - 1.2 release download; release notes. -17 Dec 2003 - 1.1 release download; release notes. -24 Oct 2003 - 1.0 release download; release notes. - - - - -Documentation - - - -LLVM provides extensive documentation in HTML form, which is available in the -source download and online: - - -http://llvm.org";>Current LLVM documentation -Documentation for LLVM 1.9 -Documentation for LLVM 1.8 -Documentation for LLVM 1.7 -Documentation for LLVM 1.6 -Documentation for LLVM 1.5 -Documentation for LLVM 1.4 -Documentation for LLVM 1.3 -Documentation for LLVM 1.2 -Documentation for LLVM 1.1 -Documentation for LLVM 1.0 - - - - - - - - ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.175 -> 1.176 --- Log message: Document the icmp and fcmp constant expressions. --- Diffs of the changes: (+10 -4) LangRef.html | 14 ++ 1 files changed, 10 insertions(+), 4 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.175 llvm/docs/LangRef.html:1.176 --- llvm/docs/LangRef.html:1.175Sun Dec 3 10:53:48 2006 +++ llvm/docs/LangRef.html Mon Dec 4 13:23:19 2006 @@ -1255,7 +1255,13 @@ select ( COND, VAL1, VAL2 ) Perform the select operation on - constants. + constants. + + icmp COND ( VAL1, VAL2 ) + Performs the icmp operation on constants. + + fcmp COND ( VAL1, VAL2 ) + Performs the fcmp operation on constants. extractelement ( VAL, IDX ) @@ -1265,13 +1271,13 @@ insertelement ( VAL, ELT, IDX ) Perform the insertelement - operation on constants. +operation on constants. shufflevector ( VEC1, VEC2, IDXMASK ) Perform the shufflevector - operation on constants. +operation on constants. OPCODE ( LHS, RHS ) @@ -4427,7 +4433,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/03 16:53:48 $ + Last modified: $Date: 2006/12/04 19:23:19 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
> > For PR950: http://llvm.org/PR950 : For ICmp and FCmp constant > expressions, put the predicate outiside the parentheses to match > what llvm-upgrade generates. Please document the syntax of these constant exprs in: http://llvm.org/docs/LangRef.html#constantexprs -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll
Changes in directory llvm/test/Regression/CodeGen/X86: 2006-11-28-Memcpy.ll updated: 1.4 -> 1.5 --- Log message: Make this test succeed on both Darwin and Linux --- Diffs of the changes: (+1 -1) 2006-11-28-Memcpy.ll |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll diff -u llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.4 llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.5 --- llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll:1.4 Fri Dec 1 22:23:08 2006 +++ llvm/test/Regression/CodeGen/X86/2006-11-28-Memcpy.ll Mon Dec 4 14:09:02 2006 @@ -1,6 +1,6 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep 3721182122 | wc -l | grep 2 && -; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep 'movl _bytes2' | wc -l | grep 1 +; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 | grep -E 'movl _?bytes2' | wc -l | grep 1 ; PR1022, 1023 %fmt = constant [4 x sbyte] c"%x\0A\00" ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp Instructions.cpp
Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.177 -> 1.178 Instructions.cpp updated: 1.50 -> 1.51 --- Log message: Implement new cast creation functions for both instructions and constant expressions. These will get used to reduce clutter as we replace various calls to createInferredCast and getCast. --- Diffs of the changes: (+68 -2) Constants.cpp| 22 -- Instructions.cpp | 48 2 files changed, 68 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.177 llvm/lib/VMCore/Constants.cpp:1.178 --- llvm/lib/VMCore/Constants.cpp:1.177 Mon Dec 4 12:38:05 2006 +++ llvm/lib/VMCore/Constants.cpp Mon Dec 4 14:17:56 2006 @@ -1534,6 +1534,24 @@ return 0; } +Constant *ConstantExpr::getZExtOrBitCast(Constant *C, const Type *Ty) { + if (C->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return getCast(Instruction::BitCast, C, Ty); + return getCast(Instruction::ZExt, C, Ty); +} + +Constant *ConstantExpr::getSExtOrBitCast(Constant *C, const Type *Ty) { + if (C->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return getCast(Instruction::BitCast, C, Ty); + return getCast(Instruction::SExt, C, Ty); +} + +Constant *ConstantExpr::getTruncOrBitCast(Constant *C, const Type *Ty) { + if (C->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return getCast(Instruction::BitCast, C, Ty); + return getCast(Instruction::Trunc, C, Ty); +} + Constant *ConstantExpr::getTrunc(Constant *C, const Type *Ty) { assert(C->getType()->isInteger() && "Trunc operand must be integer"); assert(Ty->isIntegral() && "Trunc produces only integral"); @@ -1616,14 +1634,14 @@ // can't cast pointers to anything but pointers. const Type *SrcTy = C->getType(); assert((isa(SrcTy) == isa(DstTy)) && - "Bitcast cannot cast pointer to non-pointer and vice versa"); + "BitCast cannot cast pointer to non-pointer and vice versa"); // Now we know we're not dealing with mismatched pointer casts (ptr->nonptr // or nonptr->ptr). For all the other types, the cast is okay if source and // destination bit widths are identical. unsigned SrcBitSize = SrcTy->getPrimitiveSizeInBits(); unsigned DstBitSize = DstTy->getPrimitiveSizeInBits(); - assert(SrcBitSize == DstBitSize && "Bitcast requies types of same width"); + assert(SrcBitSize == DstBitSize && "BitCast requies types of same width"); return getFoldedCast(Instruction::BitCast, C, DstTy); } Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.50 llvm/lib/VMCore/Instructions.cpp:1.51 --- llvm/lib/VMCore/Instructions.cpp:1.50 Sun Dec 3 20:43:42 2006 +++ llvm/lib/VMCore/Instructions.cppMon Dec 4 14:17:56 2006 @@ -1500,6 +1500,54 @@ return 0; } +CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty, +const std::string &Name, +Instruction *InsertBefore) { + if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return create(Instruction::BitCast, S, Ty, Name, InsertBefore); + return create(Instruction::ZExt, S, Ty, Name, InsertBefore); +} + +CastInst *CastInst::createZExtOrBitCast(Value *S, const Type *Ty, +const std::string &Name, +BasicBlock *InsertAtEnd) { + if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); + return create(Instruction::ZExt, S, Ty, Name, InsertAtEnd); +} + +CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty, +const std::string &Name, +Instruction *InsertBefore) { + if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return create(Instruction::BitCast, S, Ty, Name, InsertBefore); + return create(Instruction::SExt, S, Ty, Name, InsertBefore); +} + +CastInst *CastInst::createSExtOrBitCast(Value *S, const Type *Ty, +const std::string &Name, +BasicBlock *InsertAtEnd) { + if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); + return create(Instruction::SExt, S, Ty, Name, InsertAtEnd); +} + +CastInst *CastInst::createTruncOrBitCast(Value *S, const Type *Ty, + const std::string &Name, + Instruction *InsertBefore) { + if (S->getType()->getPrimitiveSizeInBits() == Ty->getPrimitiveSizeInBits()) +return create(Instruction::BitCast, S, Ty, Name, InsertBefore); + return create(Instruction::Trunc, S, Ty,
[llvm-commits] CVS: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
Changes in directory llvm/include/llvm/Analysis: ScalarEvolutionExpander.h updated: 1.8 -> 1.9 --- Log message: Unclutter this by using new cast creation functions. --- Diffs of the changes: (+2 -8) ScalarEvolutionExpander.h | 10 ++ 1 files changed, 2 insertions(+), 8 deletions(-) Index: llvm/include/llvm/Analysis/ScalarEvolutionExpander.h diff -u llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.8 llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.9 --- llvm/include/llvm/Analysis/ScalarEvolutionExpander.h:1.8Sun Dec 3 20:44:57 2006 +++ llvm/include/llvm/Analysis/ScalarEvolutionExpander.hMon Dec 4 14:18:26 2006 @@ -115,18 +115,12 @@ Value *visitTruncateExpr(SCEVTruncateExpr *S) { Value *V = expand(S->getOperand()); - Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() == - S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast : - Instruction::Trunc; - return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt); + return CastInst::createTruncOrBitCast(V, S->getType(), "tmp.", InsertPt); } Value *visitZeroExtendExpr(SCEVZeroExtendExpr *S) { Value *V = expandInTy(S->getOperand(),S->getType()->getUnsignedVersion()); - Instruction::CastOps Opcode = (V->getType()->getPrimitiveSizeInBits() == - S->getType()->getPrimitiveSizeInBits()) ? Instruction::BitCast : - Instruction::ZExt; - return CastInst::create(Opcode, V, S->getType(), "tmp.", InsertPt); + return CastInst::createZExtOrBitCast(V, S->getType(), "tmp.", InsertPt); } Value *visitAddExpr(SCEVAddExpr *S) { ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/CodeGen/Generic/debug-info.ll
Changes in directory llvm/test/Regression/CodeGen/Generic: debug-info.ll updated: 1.2 -> 1.3 --- Log message: Fix the intrinsic debug call to make this match current definition. --- Diffs of the changes: (+2 -2) debug-info.ll |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/test/Regression/CodeGen/Generic/debug-info.ll diff -u llvm/test/Regression/CodeGen/Generic/debug-info.ll:1.2 llvm/test/Regression/CodeGen/Generic/debug-info.ll:1.3 --- llvm/test/Regression/CodeGen/Generic/debug-info.ll:1.2 Fri Dec 1 22:23:08 2006 +++ llvm/test/Regression/CodeGen/Generic/debug-info.ll Mon Dec 4 14:13:49 2006 @@ -4,7 +4,7 @@ implementation ; Functions: -declare { }* %llvm.dbg.stoppoint({ }*, uint, uint, %lldb.compile_unit*) +declare void %llvm.dbg.stoppoint(uint, uint, %lldb.compile_unit*) void %rb_raise(int, ...) { entry: @@ -14,6 +14,6 @@ ret void strlen.exit: ; preds = %entry - %dbg.tmp.1.i2 = call { }* %llvm.dbg.stoppoint( { }* null, uint 4358, uint 0, %lldb.compile_unit* %d.compile_unit7 ) ; <{ }*> [#uses=0] + call void %llvm.dbg.stoppoint(uint 4358, uint 0, %lldb.compile_unit* %d.compile_unit7 ) ; <{ }*> [#uses=0] unreachable } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/InstrTypes.h Constants.h
Changes in directory llvm/include/llvm: InstrTypes.h updated: 1.50 -> 1.51 Constants.h updated: 1.99 -> 1.100 --- Log message: Implement new cast creation functions for both instructions and constant expressions. These will get used to reduce clutter as we replace various calls to createInferredCast and getCast. --- Diffs of the changes: (+66 -0) Constants.h | 18 ++ InstrTypes.h | 48 2 files changed, 66 insertions(+) Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.50 llvm/include/llvm/InstrTypes.h:1.51 --- llvm/include/llvm/InstrTypes.h:1.50 Sun Dec 3 20:43:42 2006 +++ llvm/include/llvm/InstrTypes.h Mon Dec 4 14:17:56 2006 @@ -299,6 +299,54 @@ BasicBlock *InsertAtEnd ///< The block to insert the instruction into ); + /// @brief Create a ZExt or BitCast cast instruction + static CastInst *createZExtOrBitCast( +Value *S,///< The value to be casted (operand 0) +const Type *Ty, ///< The type to which cast should be made +const std::string &Name = "", ///< Name for the instruction +Instruction *InsertBefore = 0 ///< Place to insert the instruction + ); + + /// @brief Create a ZExt or BitCast cast instruction + static CastInst *createZExtOrBitCast( +Value *S,///< The value to be casted (operand 0) +const Type *Ty, ///< The type to which operand is casted +const std::string &Name, ///< The name for the instruction +BasicBlock *InsertAtEnd ///< The block to insert the instruction into + ); + + /// @brief Create a SExt or BitCast cast instruction + static CastInst *createSExtOrBitCast( +Value *S,///< The value to be casted (operand 0) +const Type *Ty, ///< The type to which cast should be made +const std::string &Name = "", ///< Name for the instruction +Instruction *InsertBefore = 0 ///< Place to insert the instruction + ); + + /// @brief Create a SExt or BitCast cast instruction + static CastInst *createSExtOrBitCast( +Value *S,///< The value to be casted (operand 0) +const Type *Ty, ///< The type to which operand is casted +const std::string &Name, ///< The name for the instruction +BasicBlock *InsertAtEnd ///< The block to insert the instruction into + ); + + /// @brief Create a Trunc or BitCast cast instruction + static CastInst *createTruncOrBitCast( +Value *S,///< The value to be casted (operand 0) +const Type *Ty, ///< The type to which cast should be made +const std::string &Name = "", ///< Name for the instruction +Instruction *InsertBefore = 0 ///< Place to insert the instruction + ); + + /// @brief Create a Trunc or BitCast cast instruction + static CastInst *createTruncOrBitCast( +Value *S,///< The value to be casted (operand 0) +const Type *Ty, ///< The type to which operand is casted +const std::string &Name, ///< The name for the instruction +BasicBlock *InsertAtEnd ///< The block to insert the instruction into + ); + /// Returns the opcode necessary to cast Val into Ty using usual casting /// rules. static Instruction::CastOps getCastOpcode( Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.99 llvm/include/llvm/Constants.h:1.100 --- llvm/include/llvm/Constants.h:1.99 Sun Dec 3 23:19:02 2006 +++ llvm/include/llvm/Constants.h Mon Dec 4 14:17:56 2006 @@ -541,6 +541,24 @@ const Type *Ty ///< The type to which the constant is converted ); + // @brief Create a ZExt or BitCast cast constant expression + static Constant *getZExtOrBitCast( +Constant *C, ///< The constant to zext or bitcast +const Type *Ty ///< The type to zext or bitcast C to + ); + + // @brief Create a SExt or BitCast cast constant expression + static Constant *getSExtOrBitCast( +Constant *C, ///< The constant to zext or bitcast +const Type *Ty ///< The type to zext or bitcast C to + ); + + // @brief Create a Trunc or BitCast cast constant expression + static Constant *getTruncOrBitCast( +Constant *C, ///< The constant to zext or bitcast +const Type *Ty ///< The type to zext or bitcast C to + ); + // This method uses the CastInst::getCastOpcode method to infer the // cast opcode to use. // @brief Get a ConstantExpr Conversion operator that casts C to Ty ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/autoconf/m4/sanity_check.m4
Changes in directory llvm/autoconf/m4: sanity_check.m4 updated: 1.2 -> 1.3 --- Log message: Expose the sanity. --- Diffs of the changes: (+2 -0) sanity_check.m4 |2 ++ 1 files changed, 2 insertions(+) Index: llvm/autoconf/m4/sanity_check.m4 diff -u llvm/autoconf/m4/sanity_check.m4:1.2 llvm/autoconf/m4/sanity_check.m4:1.3 --- llvm/autoconf/m4/sanity_check.m4:1.2Wed Dec 21 20:08:30 2005 +++ llvm/autoconf/m4/sanity_check.m4Mon Dec 4 14:28:07 2006 @@ -14,6 +14,7 @@ sanity=`$1 $2 2>&1 | grep "$3"` if test -z "$sanity" ; then AC_MSG_RESULT([no]) +sanity="0" if test "$4" -eq 1 ; then AC_MSG_WARN([Program ]$1[ failed to pass sanity check.]) else @@ -21,6 +22,7 @@ fi else AC_MSG_RESULT([yes]) +sanity="1" fi else AC_MSG_RESULT([not found]) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/autoconf/configure.ac
Changes in directory llvm-test/autoconf: configure.ac updated: 1.39 -> 1.40 --- Log message: If F95 fails the sanity check then don't set its definition. This works around false positives if gfortran's f95 is discovered instead of NAG's --- Diffs of the changes: (+5 -0) configure.ac |5 + 1 files changed, 5 insertions(+) Index: llvm-test/autoconf/configure.ac diff -u llvm-test/autoconf/configure.ac:1.39 llvm-test/autoconf/configure.ac:1.40 --- llvm-test/autoconf/configure.ac:1.39Thu Sep 21 03:48:02 2006 +++ llvm-test/autoconf/configure.ac Mon Dec 4 14:37:53 2006 @@ -150,6 +150,11 @@ dnl Check for the NAG f95 FORTRAN -> C translator FIND_STD_PROGRAM(f95,,libf97.dylib,[nag fortran]) CHECK_PROGRAM_SANITY([f95],[-V],[NAGWare Fortran 95],1) +if test "$sanity" -eq "0" ; then + AC_SUBST(USE_F95,[[]]) +else + AC_SUBST(USE_F95,[USE_F95=1]) +fi dnl Checks for header files. dnl We don't check for ancient stuff or things that are guaranteed to be there ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/configure
Changes in directory llvm-test: configure updated: 1.41 -> 1.42 --- Log message: If F95 fails the sanity check then don't set its definition. This works around false positives if gfortran's f95 is discovered instead of NAG's --- Diffs of the changes: (+9 -0) configure |9 + 1 files changed, 9 insertions(+) Index: llvm-test/configure diff -u llvm-test/configure:1.41 llvm-test/configure:1.42 --- llvm-test/configure:1.41Thu Sep 21 03:48:02 2006 +++ llvm-test/configure Mon Dec 4 14:37:53 2006 @@ -20458,6 +20458,7 @@ if test -z "$sanity" ; then { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } +sanity="0" if test "1" -eq 1 ; then { echo "$as_me:$LINENO: WARNING: Program f95 failed to pass sanity check." >&5 echo "$as_me: WARNING: Program f95 failed to pass sanity check." >&2;} @@ -20469,12 +20470,20 @@ else { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } +sanity="1" fi else { echo "$as_me:$LINENO: result: not found" >&5 echo "${ECHO_T}not found" >&6; } fi +if test "$sanity" -eq "0" ; then + USE_F95= + +else + USE_F95=USE_F95=1 + +fi { echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp 2006-11-30-Pubnames.cpp
Changes in directory llvm/test/Regression/DebugInfo: 2006-11-30-NoCompileUnit.cpp updated: 1.1 -> 1.2 2006-11-30-Pubnames.cpp updated: 1.2 -> 1.3 --- Log message: These pass on Linux now. --- Diffs of the changes: (+4 -6) 2006-11-30-NoCompileUnit.cpp |8 +++- 2006-11-30-Pubnames.cpp |2 +- 2 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp diff -u llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp:1.1 llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp:1.2 --- llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp:1.1 Thu Nov 30 09:36:44 2006 +++ llvm/test/Regression/DebugInfo/2006-11-30-NoCompileUnit.cpp Mon Dec 4 14:46:05 2006 @@ -1,11 +1,11 @@ -// This is a regression test on debug info to make sure we don't hit a compile unit size -// issue with gdb. +// This is a regression test on debug info to make sure we don't hit a compile +// unit size issue with gdb. // RUN: %llvmgcc -S -O0 -g %s -o - | llvm-as | llc --disable-fp-elim -o Output/NoCompileUnit.s -f // RUN: as Output/NoCompileUnit.s -o Output/NoCompileUnit.o // RUN: g++ Output/NoCompileUnit.o -o Output/NoCompileUnit.exe // RUN: ( echo "break main"; echo "run" ; echo "p NoCompileUnit::pubname" ) > Output/NoCompileUnit.gdbin // RUN: gdb -q -batch -n -x Output/NoCompileUnit.gdbin Output/NoCompileUnit.exe | tee Output/NoCompileUnit.out | not grep '"low == high"' -// XFAIL: i[1-9]86|alpha|ia64|arm +// XFAIL: alpha|ia64|arm class MamaDebugTest { @@ -54,5 +54,3 @@ BabyDebugTest BDT(20); return BDT.doit(); } - - Index: llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp diff -u llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp:1.2 llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp:1.3 --- llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp:1.2 Thu Nov 30 09:31:49 2006 +++ llvm/test/Regression/DebugInfo/2006-11-30-Pubnames.cpp Mon Dec 4 14:46:05 2006 @@ -5,7 +5,7 @@ // RUN: g++ Output/Pubnames.o -o Output/Pubnames.exe // RUN: ( echo "break main"; echo "run" ; echo "p Pubnames::pubname" ) > Output/Pubnames.gdbin // RUN: gdb -q -batch -n -x Output/Pubnames.gdbin Output/Pubnames.exe | tee Output/Pubnames.out | grep '10' -// XFAIL: i[1-9]86|alpha|ia64|arm +// XFAIL: alpha|ia64|arm struct Pubnames { static int pubname; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] getInferredCast proposal
Implemented. I'll start using them. Reid. On Mon, 2006-12-04 at 11:11 -0800, Chris Lattner wrote: > Reid, > > Most of your uses of getInferredCast fall into one of these categories: > > 1. They can only be one type of cast. > 2. They can be a [bitcast or trunc] or [bitcast or zext] or [bitcast > or sext]. > > The former should be eliminated obviously, so I want to talk about > the later. > > As a specific example, consider: > > // gep null, C is equal to C*sizeof(nullty). If nullty is > a known llvm > // type, we can statically fold this. > Constant *R = ConstantInt::get(Type::UIntTy, ElSize); > +// We know R is unsigned, Idx0 is signed because it must be > an index > +// through a sequential type (gep pointer operand) which is > always > +// signed. > +R = ConstantExpr::getInferredCast(R, false, Idx0->getType(), > true); > +R = ConstantExpr::getMul(R, Idx0); // signed multiply > +// R is a signed integer, C is the GEP pointer so -> IntToPtr > +return ConstantExpr::getCast(Instruction::IntToPtr, R, C- > >getType()); > > In this case, we know that the cast is either bitcast to uint/int or > a zext to long/ulong [1]. Because you know this, you have a 3 line > comment trying to explain what is going on, and that comment is > confusing (it talks about the types of values, when values are about > to be untyped). > > What we really want to do is talk about the possible extension > happening here. As such, I think it would be much cleaner to split > up getInferredCast into: > > ConstantExpr::getZExtOrBitCast(..) > ConstantExpr::getSExtOrBitCast(..) > ConstantExpr::getTruncOrBitCast(..) > > This would allow writing this code as: > > // gep null, C is equal to C*sizeof(nullty). If nullty is > a known llvm > // type, we can statically fold this. > Constant *R = ConstantInt::get(Type::UIntTy, ElSize); > +R = ConstantExpr::getZExtOrBitCast(R, Idx0->getType()); > +R = ConstantExpr::getMul(R, Idx0); // signed multiply > +// R is a signed integer, C is the GEP pointer so -> IntToPtr > +return ConstantExpr::getCast(Instruction::IntToPtr, R, C- > >getType()); > > The need for the comment goes away. Even *better*, the method can > assert that the types make sense for this (e.g. a trunc isn't from > smaller to larger) as opposed to the totally unconstrained > getInferredCast. > > This makes the code a) more self documenting as to what is going on > and b) much more strict about checking itself. What do you think? > Would this allow us to completely eliminate getInferredCast? > > -Chris > > [1]. As an aside, if you relaxed the type constraints of GEP indices, > this gets much messier. > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y
Done. On Mon, 2006-12-04 at 11:19 -0800, Chris Lattner wrote: > > > > For PR950: http://llvm.org/PR950 : For ICmp and FCmp constant > > expressions, put the predicate outiside the parentheses to match > > what llvm-upgrade generates. > > Please document the syntax of these constant exprs in: > http://llvm.org/docs/LangRef.html#constantexprs > > -Chris > ___ > llvm-commits mailing list > llvm-commits@cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/IPA/CallGraph.cpp
Changes in directory llvm/lib/Analysis/IPA: CallGraph.cpp updated: 1.59 -> 1.60 --- Log message: Add a comment and fix a memory leak. Thanks to Vikram for pointing this out. --- Diffs of the changes: (+5 -4) CallGraph.cpp |9 + 1 files changed, 5 insertions(+), 4 deletions(-) Index: llvm/lib/Analysis/IPA/CallGraph.cpp diff -u llvm/lib/Analysis/IPA/CallGraph.cpp:1.59 llvm/lib/Analysis/IPA/CallGraph.cpp:1.60 --- llvm/lib/Analysis/IPA/CallGraph.cpp:1.59Tue Nov 28 18:19:40 2006 +++ llvm/lib/Analysis/IPA/CallGraph.cpp Mon Dec 4 15:22:45 2006 @@ -20,6 +20,9 @@ #include using namespace llvm; +/// isOnlyADirectCall - Return true if this callsite is *just* a direct call to +/// the specified function. Specifically return false if the callsite also +/// takes the address of the function. static bool isOnlyADirectCall(Function *F, CallSite CS) { if (!CS.getInstruction()) return false; for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); I != E; ++I) @@ -179,10 +182,8 @@ // // destroy - Release memory for the call graph virtual void destroy() { -if (!CallsExternalNode) { - delete CallsExternalNode; - CallsExternalNode = 0; -} +delete CallsExternalNode; +CallsExternalNode = 0; } }; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/docs/LangRef.html
Changes in directory llvm/docs: LangRef.html updated: 1.176 -> 1.177 --- Log message: We only support 32-bit or 64-bit sequential type indices for GEP. Document it as so. --- Diffs of the changes: (+5 -5) LangRef.html | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm/docs/LangRef.html diff -u llvm/docs/LangRef.html:1.176 llvm/docs/LangRef.html:1.177 --- llvm/docs/LangRef.html:1.176Mon Dec 4 13:23:19 2006 +++ llvm/docs/LangRef.html Mon Dec 4 15:29:24 2006 @@ -2492,14 +2492,14 @@ Arguments: -This instruction takes a list of integer constants that indicate what +This instruction takes a list of integer operands that indicate what elements of the aggregate object to index to. The actual types of the arguments provided depend on the type of the first pointer argument. The 'getelementptr' instruction is used to index down through the type levels of a structure or to a specific index in an array. When indexing into a structure, only uint integer constants are allowed. When indexing -into an array or pointer, integers of any size are allowed, and will be sign -extended to 64-bit values. +into an array or pointer, only integers of 32 or 64 bits are allowed, and will +be sign extended to 64-bit values. For example, let's consider a C code fragment and how it gets compiled to LLVM: @@ -2540,7 +2540,7 @@ The index types specified for the 'getelementptr' instruction depend on the pointer type that is being indexed into. Pointer -and array types can use any +and array types can use a 32-bit or 64-bit integer type but the value will always be sign extended to 64-bits. Structure types, require uint constants. @@ -4433,7 +4433,7 @@ mailto:[EMAIL PROTECTED]">Chris Lattner http://llvm.org";>The LLVM Compiler Infrastructure - Last modified: $Date: 2006/12/04 19:23:19 $ + Last modified: $Date: 2006/12/04 21:29:24 $ ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Analysis/ScalarEvolution.cpp
Changes in directory llvm/lib/Analysis: ScalarEvolution.cpp updated: 1.62 -> 1.63 --- Log message: Fix comment grammaro --- Diffs of the changes: (+2 -2) ScalarEvolution.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/Analysis/ScalarEvolution.cpp diff -u llvm/lib/Analysis/ScalarEvolution.cpp:1.62 llvm/lib/Analysis/ScalarEvolution.cpp:1.63 --- llvm/lib/Analysis/ScalarEvolution.cpp:1.62 Mon Dec 4 11:05:42 2006 +++ llvm/lib/Analysis/ScalarEvolution.cpp Mon Dec 4 15:33:23 2006 @@ -1925,9 +1925,9 @@ } } - // Okay, this is a some expression that we cannot symbolically evaluate + // Okay, this is an expression that we cannot symbolically evaluate // into a SCEV. Check to see if it's possible to symbolically evaluate - // the arguments into constants, and if see, try to constant propagate the + // the arguments into constants, and if so, try to constant propagate the // result. This is particularly useful for computing loop exit values. if (CanConstantFold(I)) { std::vector Operands; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Constants.h
Changes in directory llvm/include/llvm: Constants.h updated: 1.100 -> 1.101 --- Log message: Separate the get and getTy functions for ICmp and FCmp into getCompare and getCompareTy. Also, fix some incorrect comments. --- Diffs of the changes: (+12 -7) Constants.h | 19 --- 1 files changed, 12 insertions(+), 7 deletions(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.100 llvm/include/llvm/Constants.h:1.101 --- llvm/include/llvm/Constants.h:1.100 Mon Dec 4 14:17:56 2006 +++ llvm/include/llvm/Constants.h Mon Dec 4 15:34:17 2006 @@ -498,7 +498,9 @@ // These private methods are used by the type resolution code to create // ConstantExprs in intermediate forms. static Constant *getTy(const Type *Ty, unsigned Opcode, - Constant *C1, Constant *C2, unsigned short pred = 0); + Constant *C1, Constant *C2); + static Constant *getCompareTy(unsigned Opcode, unsigned short pred, +Constant *C1, Constant *C2); static Constant *getShiftTy(const Type *Ty, unsigned Opcode, Constant *C1, Constant *C2); static Constant *getSelectTy(const Type *Ty, @@ -549,14 +551,14 @@ // @brief Create a SExt or BitCast cast constant expression static Constant *getSExtOrBitCast( -Constant *C, ///< The constant to zext or bitcast -const Type *Ty ///< The type to zext or bitcast C to +Constant *C, ///< The constant to sext or bitcast +const Type *Ty ///< The type to sext or bitcast C to ); // @brief Create a Trunc or BitCast cast constant expression static Constant *getTruncOrBitCast( -Constant *C, ///< The constant to zext or bitcast -const Type *Ty ///< The type to zext or bitcast C to +Constant *C, ///< The constant to trunc or bitcast +const Type *Ty ///< The type to trunc or bitcast C to ); // This method uses the CastInst::getCastOpcode method to infer the @@ -593,8 +595,11 @@ /// ConstantExpr::get - Return a binary or shift operator constant expression, /// folding if possible. /// - static Constant *get(unsigned Opcode, Constant *C1, Constant *C2, - unsigned short pred = 0); + static Constant *get(unsigned Opcode, Constant *C1, Constant *C2); + + /// @brief Return an ICmp or FCmp comparison operator constante expression. + static Constant *getCompare(unsigned Opcode, unsigned short pred, + Constant *C1, Constant *C2); /// ConstantExpr::get* - Return some common constants without having to /// specify the full Instruction::OPCODE identifier. ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.178 -> 1.179 --- Log message: Separate getCompare from get and getCompareTy from getTy. --- Diffs of the changes: (+17 -16) Constants.cpp | 33 + 1 files changed, 17 insertions(+), 16 deletions(-) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.178 llvm/lib/VMCore/Constants.cpp:1.179 --- llvm/lib/VMCore/Constants.cpp:1.178 Mon Dec 4 14:17:56 2006 +++ llvm/lib/VMCore/Constants.cpp Mon Dec 4 15:35:24 2006 @@ -1660,14 +1660,10 @@ } Constant *ConstantExpr::getTy(const Type *ReqTy, unsigned Opcode, - Constant *C1, Constant *C2, unsigned short pred) { + Constant *C1, Constant *C2) { if (Opcode == Instruction::Shl || Opcode == Instruction::LShr || Opcode == Instruction::AShr) return getShiftTy(ReqTy, Opcode, C1, C2); - if (Opcode == Instruction::ICmp) -return getICmp(pred, C1, C2); - if (Opcode == Instruction::FCmp) -return getFCmp(pred, C1, C2); // Check the operands for consistency first assert(Opcode >= Instruction::BinaryOpsBegin && @@ -1682,11 +1678,18 @@ return FC; // Fold a few common cases... std::vector argVec(1, C1); argVec.push_back(C2); - ExprMapKeyType Key(Opcode, argVec, pred); + ExprMapKeyType Key(Opcode, argVec); return ExprConstants->getOrCreate(ReqTy, Key); } -Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2, unsigned short pred) { +Constant *ConstantExpr::getCompareTy(unsigned Opcode, unsigned short predicate, + Constant *C1, Constant *C2) { + if (Opcode == Instruction::ICmp) +return getICmp(predicate, C1, C2); + return getFCmp(predicate, C1, C2); +} + +Constant *ConstantExpr::get(unsigned Opcode, Constant *C1, Constant *C2) { #ifndef NDEBUG switch (Opcode) { case Instruction::Add: @@ -1734,10 +1737,6 @@ case Instruction::SetGE: case Instruction::SetEQ: case Instruction::SetNE: assert(C1->getType() == C2->getType() && "Op types should be identical!"); break; - case Instruction::FCmp: - case Instruction::ICmp: -assert(C1->getType() == C2->getType() && "Op types should be identical!"); -break; case Instruction::Shl: case Instruction::LShr: case Instruction::AShr: @@ -1750,10 +1749,13 @@ } #endif - if (Instruction::isComparison(Opcode)) -return getTy(Type::BoolTy, Opcode, C1, C2, pred); - else -return getTy(C1->getType(), Opcode, C1, C2, pred); + return getTy(C1->getType(), Opcode, C1, C2); +} + +Constant *ConstantExpr::getCompare(unsigned Opcode, unsigned short pred, +Constant *C1, Constant *C2) { + assert(C1->getType() == C2->getType() && "Op types should be identical!"); + return getCompareTy(Opcode, pred, C1, C2); } Constant *ConstantExpr::getSelectTy(const Type *ReqTy, Constant *C, @@ -1793,7 +1795,6 @@ return ExprConstants->getOrCreate(ReqTy, Key); } - Constant *ConstantExpr::getGetElementPtrTy(const Type *ReqTy, Constant *C, const std::vector &IdxList) { assert(GetElementPtrInst::getIndexedType(C->getType(), IdxList, true) && ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Changes in directory llvm/lib/Target/PowerPC: PPCISelLowering.cpp updated: 1.239 -> 1.240 --- Log message: Restoration of the stack pointer after a deallocation of a alloca was not updating the SP link. --- Diffs of the changes: (+28 -1) PPCISelLowering.cpp | 29 - 1 files changed, 28 insertions(+), 1 deletion(-) Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.239 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.240 --- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.239 Fri Dec 1 10:30:47 2006 +++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Mon Dec 4 16:04:42 2006 @@ -170,7 +170,7 @@ setOperationAction(ISD::VACOPY, MVT::Other, Expand); setOperationAction(ISD::VAEND , MVT::Other, Expand); setOperationAction(ISD::STACKSAVE , MVT::Other, Expand); - setOperationAction(ISD::STACKRESTORE , MVT::Other, Expand); + setOperationAction(ISD::STACKRESTORE , MVT::Other, Custom); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i32 , Custom); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i64 , Custom); @@ -1606,6 +1606,32 @@ return DAG.getNode(PPCISD::RET_FLAG, MVT::Other, Copy, Copy.getValue(1)); } +static SDOperand LowerSTACKRESTORE(SDOperand Op, SelectionDAG &DAG, + const PPCSubtarget &Subtarget) { + // When we pop the dynamic allocation we need to restore the SP link. + + // Get the corect type for pointers. + MVT::ValueType PtrVT = DAG.getTargetLoweringInfo().getPointerTy(); + + // Construct the stack pointer operand. + bool IsPPC64 = Subtarget.isPPC64(); + unsigned SP = IsPPC64 ? PPC::X1 : PPC::R1; + SDOperand StackPtr = DAG.getRegister(SP, PtrVT); + + // Get the operands for the STACKRESTORE. + SDOperand Chain = Op.getOperand(0); + SDOperand SaveSP = Op.getOperand(1); + + // Load the old link SP. + SDOperand LoadLinkSP = DAG.getLoad(PtrVT, Chain, StackPtr, NULL, 0); + + // Restore the stack pointer. + Chain = DAG.getCopyToReg(LoadLinkSP.getValue(1), SP, SaveSP); + + // Store the old link SP. + return DAG.getStore(Chain, LoadLinkSP, StackPtr, NULL, 0); +} + static SDOperand LowerDYNAMIC_STACKALLOC(SDOperand Op, SelectionDAG &DAG, const PPCSubtarget &Subtarget) { MachineFunction &MF = DAG.getMachineFunction(); @@ -2587,6 +2613,7 @@ return LowerFORMAL_ARGUMENTS(Op, DAG, VarArgsFrameIndex); case ISD::CALL: return LowerCALL(Op, DAG); case ISD::RET:return LowerRET(Op, DAG); + case ISD::STACKRESTORE: return LowerSTACKRESTORE(Op, DAG, PPCSubTarget); case ISD::DYNAMIC_STACKALLOC: return LowerDYNAMIC_STACKALLOC(Op, DAG, PPCSubTarget); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/docs/LangRef.html
On Mon, 2006-12-04 at 10:45 -0800, Chris Lattner wrote: > On Dec 4, 2006, at 10:40 AM, Reid Spencer wrote: > > > On Mon, 2006-12-04 at 10:29 -0800, Chris Lattner wrote: > > > >> I thought only 32- and 64-bit integers were allowed? > > > > I thought we agreed on any size for sequential type indices. See > > PR950. > > I codified the rules after we agreed on them. > > The bc format is currently more efficient due to this restriction. > Are going to lose that? Ah, you're right, and it encodes in only 2 bits for the 4 combinations so I'll fix the documentation. Reid. > > -Chris > signature.asc Description: This is a digitally signed message part ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/External/SPEC/CFP2000/183.equake/Makefile
Changes in directory llvm-test/External/SPEC/CFP2000/183.equake: Makefile updated: 1.5 -> 1.6 --- Log message: Provide an output file filter for this test because 183.equake prints out the program name in its messages. The program name has a different suffix for native, llc, jit, and cbe. The filter wipes out the program name. --- Diffs of the changes: (+2 -0) Makefile |2 ++ 1 files changed, 2 insertions(+) Index: llvm-test/External/SPEC/CFP2000/183.equake/Makefile diff -u llvm-test/External/SPEC/CFP2000/183.equake/Makefile:1.5 llvm-test/External/SPEC/CFP2000/183.equake/Makefile:1.6 --- llvm-test/External/SPEC/CFP2000/183.equake/Makefile:1.5 Mon Sep 6 22:41:15 2004 +++ llvm-test/External/SPEC/CFP2000/183.equake/Makefile Mon Dec 4 16:09:39 2006 @@ -6,3 +6,5 @@ CPPFLAGS = include ../../Makefile.spec2000 + +SPEC_OUTPUT_FILE_FILTER := sed -e 's/^\.\.\/183.equake.*://' ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/SingleSource/UnitTests/2006-12-04-DynAllocAndRestore.cpp
Changes in directory llvm-test/SingleSource/UnitTests: 2006-12-04-DynAllocAndRestore.cpp added (r1.1) --- Log message: Make sure that restore stack does the right thing. --- Diffs of the changes: (+47 -0) 2006-12-04-DynAllocAndRestore.cpp | 47 ++ 1 files changed, 47 insertions(+) Index: llvm-test/SingleSource/UnitTests/2006-12-04-DynAllocAndRestore.cpp diff -c /dev/null llvm-test/SingleSource/UnitTests/2006-12-04-DynAllocAndRestore.cpp:1.1 *** /dev/null Mon Dec 4 16:01:04 2006 --- llvm-test/SingleSource/UnitTests/2006-12-04-DynAllocAndRestore.cpp Mon Dec 4 16:00:54 2006 *** *** 0 --- 1,47 + class MamaDebugTest { + private: + int N; + + protected: + MamaDebugTest(int n) : N(n) {} + + int getN() const { return N; } + + }; + + class BabyDebugTest : public MamaDebugTest { + private: + + public: + BabyDebugTest(int n) : MamaDebugTest(n) {} + + static int doh; + + int doit() { + int N = getN(); + int Table[N]; + + int sum = 0; + + for (int i = 0; i < N; ++i) { + int j = i; + Table[i] = j; + } + for (int i = 0; i < N; ++i) { + int j = Table[i]; + sum += j; + } + + return sum; + } + + }; + + int BabyDebugTest::doh; + + + int main(int argc, const char *argv[]) { + BabyDebugTest BDT(20); + BDT.doit(); + return 0; + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/External/SPEC/Makefile.spec
Changes in directory llvm-test/External/SPEC: Makefile.spec updated: 1.59 -> 1.60 --- Log message: Implement a new feature: output file filtering. A makefile can override the default filter (cat) to contort the test's output. This is necessary for things like 183.equake that put out the program name in its output messages. --- Diffs of the changes: (+21 -8) Makefile.spec | 29 + 1 files changed, 21 insertions(+), 8 deletions(-) Index: llvm-test/External/SPEC/Makefile.spec diff -u llvm-test/External/SPEC/Makefile.spec:1.59 llvm-test/External/SPEC/Makefile.spec:1.60 --- llvm-test/External/SPEC/Makefile.spec:1.59 Sat Dec 2 07:40:36 2006 +++ llvm-test/External/SPEC/Makefile.spec Mon Dec 4 16:07:46 2006 @@ -19,6 +19,11 @@ REF_OUT_DIR := $(SPEC_BENCH_DIR)/data/$(RUN_TYPE)/output/ LOCAL_OUTPUTS := $(notdir $(wildcard $(REF_OUT_DIR)/*)) +# Sometimes a test will output its program name or some other gunk that +# we don't want to diff against. Tests can override this definition to +# provide a filter for the output files. +SPEC_OUTPUT_FILE_FILTER = cat + # Specify how to generate output from the SPEC programs. Basically we just run # the program in a sandbox (a special directory we create), then we cat all of @@ -29,7 +34,8 @@ -$(SPEC_SANDBOX) nat-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../$*.native $(RUN_OPTIONS) - -(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -(cd Output/nat-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \ + $(SPEC_OUTPUT_FILE_FILTER) > $@ -cp Output/nat-$(RUN_TYPE)/$(STDOUT_FILENAME).time [EMAIL PROTECTED] $(PROGRAMS_TO_TEST:%=Output/%.out-lli): \ @@ -37,7 +43,8 @@ -$(SPEC_SANDBOX) lli-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ $(LLI) $(LLI_OPTS) ../$*.llvm.bc $(RUN_OPTIONS) - -(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -(cd Output/lli-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \ + $(SPEC_OUTPUT_FILE_FILTER) > $@ -cp Output/lli-$(RUN_TYPE)/$(STDOUT_FILENAME).time [EMAIL PROTECTED] $(PROGRAMS_TO_TEST:%=Output/%.out-jit): \ @@ -45,7 +52,8 @@ -$(SPEC_SANDBOX) jit-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ $(LLI) $(JIT_OPTS) ../$*.llvm.bc $(RUN_OPTIONS) - -(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -(cd Output/jit-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \ + $(SPEC_OUTPUT_FILE_FILTER) > $@ -cp Output/jit-$(RUN_TYPE)/$(STDOUT_FILENAME).time [EMAIL PROTECTED] $(PROGRAMS_TO_TEST:%=Output/%.out-jit-beta): \ @@ -53,7 +61,8 @@ -$(SPEC_SANDBOX) jit-beta-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ $(LLI) $(LLCBETAOPTION) $(JIT_OPTS) ../$*.llvm.bc $(RUN_OPTIONS) - -(cd Output/jit-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -(cd Output/jit-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \ + $(SPEC_OUTPUT_FILE_FILTER) > $@ -cp Output/jit-beta-$(RUN_TYPE)/$(STDOUT_FILENAME).time [EMAIL PROTECTED] $(PROGRAMS_TO_TEST:%=Output/%.out-llc): \ @@ -61,7 +70,8 @@ -$(SPEC_SANDBOX) llc-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../$*.llc $(RUN_OPTIONS) - -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -(cd Output/llc-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \ + $(SPEC_OUTPUT_FILE_FILTER) > $@ -cp Output/llc-$(RUN_TYPE)/$(STDOUT_FILENAME).time [EMAIL PROTECTED] $(PROGRAMS_TO_TEST:%=Output/%.out-llc-beta): \ @@ -69,7 +79,8 @@ -$(SPEC_SANDBOX) llc-beta-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../$*.llc-beta $(RUN_OPTIONS) - -(cd Output/llc-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -(cd Output/llc-beta-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \ + $(SPEC_OUTPUT_FILE_FILTER) > $@ -cp Output/llc-beta-$(RUN_TYPE)/$(STDOUT_FILENAME).time [EMAIL PROTECTED] $(PROGRAMS_TO_TEST:%=Output/%.out-cbe): \ @@ -77,7 +88,8 @@ -$(SPEC_SANDBOX) cbe-$(RUN_TYPE) $@ $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) \ ../$*.cbe $(RUN_OPTIONS) - -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) > $@ + -(cd Output/cbe-$(RUN_TYPE); cat $(LOCAL_OUTPUTS)) | \ + $(SPEC_OUTPUT_FILE_FILTER) > $@ -cp Output/cbe-$(RUN_TYPE)/$(STDOUT_FILENAME).time [EMAIL PROTECTED] # The RunSafely.sh script puts an "exit " line at the end of @@ -159,7 +171,8 @@ $(SPEC_SANDBOX) profile-$(RUN_TYPE) Output/$*.out-prof $(REF_IN_DIR) \ $(RUNSAFELY) $(STDIN_FILENAME) $(STDOUT_FILENAME) $(LLI) $(JIT_OPTS)\ -fake-arg
[llvm-commits] CVS: llvm/test/Regression/CodeGen/X86/x86-64-asm.ll
Changes in directory llvm/test/Regression/CodeGen/X86: x86-64-asm.ll added (r1.1) --- Log message: Testcase for PR1029: http://llvm.org/PR1029 , patch by Rafael vila de EspÃndola --- Diffs of the changes: (+15 -0) x86-64-asm.ll | 15 +++ 1 files changed, 15 insertions(+) Index: llvm/test/Regression/CodeGen/X86/x86-64-asm.ll diff -c /dev/null llvm/test/Regression/CodeGen/X86/x86-64-asm.ll:1.1 *** /dev/null Mon Dec 4 16:37:58 2006 --- llvm/test/Regression/CodeGen/X86/x86-64-asm.ll Mon Dec 4 16:37:48 2006 *** *** 0 --- 1,15 + ; RUN: llvm-as < %s | llc + ; PR1029 + + target datalayout = "e-p:64:64" + target endian = little + target pointersize = 64 + target triple = "x86_64-unknown-linux-gnu" + + implementation ; Functions: + + void %frame_dummy() { + entry: + %tmp1 = tail call void (sbyte*)* (void (sbyte*)*)* asm "", "=r,0,~{dirflag},~{fpsr},~{flags}"( void (sbyte*)* null ); [#uses=0] + ret void + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86ISelLowering.cpp
Changes in directory llvm/lib/Target/X86: X86ISelLowering.cpp updated: 1.299 -> 1.300 --- Log message: Add support for 64-bit 'r' constraint. Patch by by Rafael ~Avila de EspÃndol! This fixes PR1029: http://llvm.org/PR1029 and Regression/CodeGen/X86/x86-64-asm.ll --- Diffs of the changes: (+5 -0) X86ISelLowering.cpp |5 + 1 files changed, 5 insertions(+) Index: llvm/lib/Target/X86/X86ISelLowering.cpp diff -u llvm/lib/Target/X86/X86ISelLowering.cpp:1.299 llvm/lib/Target/X86/X86ISelLowering.cpp:1.300 --- llvm/lib/Target/X86/X86ISelLowering.cpp:1.299 Thu Nov 30 15:55:46 2006 +++ llvm/lib/Target/X86/X86ISelLowering.cpp Mon Dec 4 16:38:21 2006 @@ -5528,6 +5528,11 @@ break; case 'r': // GENERAL_REGS case 'R': // LEGACY_REGS + if (VT == MVT::i64 && Subtarget->is64Bit()) +return make_vector(X86::RAX, X86::RDX, X86::RCX, X86::RBX, + X86::RSI, X86::RDI, X86::RBP, X86::RSP, + X86::R8, X86::R9, X86::R10, X86::R11, + X86::R12, X86::R13, X86::R14, X86::R15, 0); if (VT == MVT::i32) return make_vector(X86::EAX, X86::EDX, X86::ECX, X86::EBX, X86::ESI, X86::EDI, X86::EBP, X86::ESP, 0); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Constants.h InstrTypes.h
Changes in directory llvm/include/llvm: Constants.h updated: 1.101 -> 1.102 InstrTypes.h updated: 1.51 -> 1.52 --- Log message: Add cast creation functions for Pointer Casts, either BitCast or PtrToInt --- Diffs of the changes: (+23 -1) Constants.h |8 +++- InstrTypes.h | 16 2 files changed, 23 insertions(+), 1 deletion(-) Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.101 llvm/include/llvm/Constants.h:1.102 --- llvm/include/llvm/Constants.h:1.101 Mon Dec 4 15:34:17 2006 +++ llvm/include/llvm/Constants.h Mon Dec 4 17:14:27 2006 @@ -561,6 +561,12 @@ const Type *Ty ///< The type to trunc or bitcast C to ); + /// @brief Create a BitCast or a PtrToInt cast constant expression + static Constant *getPointerCast( +Constant *C, ///< The pointer value to be casted (operand 0) +const Type *Ty ///< The type to which cast should be made + ); + // This method uses the CastInst::getCastOpcode method to infer the // cast opcode to use. // @brief Get a ConstantExpr Conversion operator that casts C to Ty @@ -597,7 +603,7 @@ /// static Constant *get(unsigned Opcode, Constant *C1, Constant *C2); - /// @brief Return an ICmp or FCmp comparison operator constante expression. + /// @brief Return an ICmp or FCmp comparison operator constant expression. static Constant *getCompare(unsigned Opcode, unsigned short pred, Constant *C1, Constant *C2); Index: llvm/include/llvm/InstrTypes.h diff -u llvm/include/llvm/InstrTypes.h:1.51 llvm/include/llvm/InstrTypes.h:1.52 --- llvm/include/llvm/InstrTypes.h:1.51 Mon Dec 4 14:17:56 2006 +++ llvm/include/llvm/InstrTypes.h Mon Dec 4 17:14:27 2006 @@ -323,6 +323,22 @@ Instruction *InsertBefore = 0 ///< Place to insert the instruction ); + /// @brief Create a BitCast or a PtrToInt cast instruction + static CastInst *createPointerCast( +Value *S,///< The pointer value to be casted (operand 0) +const Type *Ty, ///< The type to which operand is casted +const std::string &Name, ///< The name for the instruction +BasicBlock *InsertAtEnd ///< The block to insert the instruction into + ); + + /// @brief Create a BitCast or a PtrToInt cast instruction + static CastInst *createPointerCast( +Value *S,///< The pointer value to be casted (operand 0) +const Type *Ty, ///< The type to which cast should be made +const std::string &Name = "", ///< Name for the instruction +Instruction *InsertBefore = 0 ///< Place to insert the instruction + ); + /// @brief Create a SExt or BitCast cast instruction static CastInst *createSExtOrBitCast( Value *S,///< The value to be casted (operand 0) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/SCCP/2006-12-04-PackedType.ll
Changes in directory llvm/test/Regression/Transforms/SCCP: 2006-12-04-PackedType.ll added (r1.1) --- Log message: SCCP does not handle Packed Type properly. Disable Packed Type handling for now. --- Diffs of the changes: (+149 -0) 2006-12-04-PackedType.ll | 149 +++ 1 files changed, 149 insertions(+) Index: llvm/test/Regression/Transforms/SCCP/2006-12-04-PackedType.ll diff -c /dev/null llvm/test/Regression/Transforms/SCCP/2006-12-04-PackedType.ll:1.1 *** /dev/null Mon Dec 4 17:55:09 2006 --- llvm/test/Regression/Transforms/SCCP/2006-12-04-PackedType.ll Mon Dec 4 17:54:59 2006 *** *** 0 --- 1,149 + ; Test PackedType handling by SCCP. + ; SCCP ignores PackedTypes until PR 1034 is fixed + ; + ; RUN: llvm-upgrade < %s | llvm-as | opt -sccp + target datalayout = "E-p:32:32" + target endian = big + target pointersize = 32 + target triple = "powerpc-apple-darwin8" + %struct.GLDAlphaTest = type { float, ushort, ubyte, ubyte } + %struct.GLDArrayRange = type { ubyte, ubyte, ubyte, ubyte } + %struct.GLDBlendMode = type { ushort, ushort, ushort, ushort, %struct.GLTColor4, ushort, ushort, ubyte, ubyte, ubyte, ubyte } + %struct.GLDBufferRec = type opaque + %struct.GLDBufferstate = type { %struct.GLTDimensions, %struct.GLTDimensions, %struct.GLTFixedColor4, %struct.GLTFixedColor4, ubyte, ubyte, ubyte, ubyte, [2 x %struct.GLSBuffer], [4 x %struct.GLSBuffer], %struct.GLSBuffer, %struct.GLSBuffer, %struct.GLSBuffer, [4 x %struct.GLSBuffer*], %struct.GLSBuffer*, %struct.GLSBuffer*, %struct.GLSBuffer*, ubyte, ubyte } + %struct.GLDClearColor = type { double, %struct.GLTColor4, %struct.GLTColor4, float, int } + %struct.GLDClipPlane = type { uint, [6 x %struct.GLTColor4] } + %struct.GLDColorBuffer = type { ushort, ushort, [4 x ushort] } + %struct.GLDColorMatrix = type { [16 x float]*, %struct.GLDImagingColorScale } + %struct.GLDContextRec = type { float, float, float, float, float, float, float, float, %struct.GLTColor4, %struct.GLTColor4, %struct.GLVMFPContext, %struct.GLDTextureMachine, %struct.GLGProcessor, %struct._GLVMConstants*, void (%struct.GLDContextRec*, int, int, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, int)*, %struct._GLVMFunction*, void (%struct.GLDContextRec*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*)*, void (%struct.GLDContextRec*, %struct.GLDVertex*, %struct.GLDVertex*, %struct.GLDVertex*)*, %struct._GLVMFunction*, %struct._GLVMFunction*, %struct._GLVMFunction*, uint, uint, uint, float, float, float, uint, %struct.GLSDrawable, %struct.GLDRect, %struct.GLDFormat, %struct.GLDBufferstate, %struct.GLDSharedRec*, %struct.GLDState*, %struct.GLDPluginState*, %struct.GLTDimensions, %struct.GLTColor4*, %struct.GLTColor4*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentAttribRec*, %struct.GLVMFragmentA! ttribRec*, %struct.GLDPipelineProgramRec*, %struct.GLDStateProgramRec, %struct.GLVMTextures, { [4 x sbyte*], sbyte*, sbyte* }, [64 x float], %struct.GLDStippleData, ushort, ubyte, ubyte, uint, %struct.GLDFramebufferRec*, ubyte, %struct.GLDQueryRec*, %struct.GLDQueryRec* } + %struct.GLDConvolution = type { %struct.GLTColor4, %struct.GLDImagingColorScale, ushort, ushort, float*, int, int } + %struct.GLDDepthTest = type { ushort, ushort, ubyte, ubyte, ubyte, ubyte, double, double } + %struct.GLDFogMode = type { %struct.GLTColor4, float, float, float, float, float, ushort, ushort, ushort, ubyte, ubyte } + %struct.GLDFormat = type { int, int, int, int, int, int, uint, uint, ubyte, ubyte, ubyte, ubyte, int, int, int } + %struct.GLDFramebufferAttachment = type { uint, uint, uint, int, uint, uint } + %struct.GLDFramebufferData = type { [6 x %struct.GLDFramebufferAttachment], [4 x ushort], ushort, ushort, ushort, ushort, uint } + %struct.GLDFramebufferRec = type { %struct.GLDFramebufferData*, %struct.GLDPluginFramebufferData*, %struct.GLDPixelFormat } + %struct.GLDHintMode = type { ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort, ushort } + %struct.GLDHistogram = type { %struct.GLTFixedColor4*, int, ushort, ubyte, ubyte } + %struct.GLDImagingColorScale = type { { float, float }, { float, float }, { float, float }, { float, float } } + %struct.GLDImagingSubset = type { %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDConvolution, %struct.GLDColorMatrix, %struct.GLDMinmax, %struct.GLDHistogram, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, %struct.GLDImagingColorScale, uint } + %struct.GLDLight = type { %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTColor4, %struct.GLTCoord3, float, float, float, float, float, %struct.GLTCoord3, float, float, float, float, float } + %struct.GLDLightModel = type
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp
Changes in directory llvm/lib/Transforms/Scalar: SCCP.cpp updated: 1.137 -> 1.138 --- Log message: SCCP does not handle Packed Type properly. Disable Packed Type handling for now. --- Diffs of the changes: (+17 -1) SCCP.cpp | 18 +- 1 files changed, 17 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/SCCP.cpp diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.137 llvm/lib/Transforms/Scalar/SCCP.cpp:1.138 --- llvm/lib/Transforms/Scalar/SCCP.cpp:1.137 Sun Nov 26 03:46:52 2006 +++ llvm/lib/Transforms/Scalar/SCCP.cpp Mon Dec 4 17:54:59 2006 @@ -749,6 +749,11 @@ } void SCCPSolver::visitExtractElementInst(ExtractElementInst &I) { + // FIXME : SCCP does not handle vectors properly. + markOverdefined(&I); + return; + +#if 0 LatticeVal &ValState = getValueState(I.getOperand(0)); LatticeVal &IdxState = getValueState(I.getOperand(1)); @@ -757,9 +762,14 @@ else if(ValState.isConstant() && IdxState.isConstant()) markConstant(&I, ConstantExpr::getExtractElement(ValState.getConstant(), IdxState.getConstant())); +#endif } void SCCPSolver::visitInsertElementInst(InsertElementInst &I) { + // FIXME : SCCP does not handle vectors properly. + markOverdefined(&I); + return; +#if 0 LatticeVal &ValState = getValueState(I.getOperand(0)); LatticeVal &EltState = getValueState(I.getOperand(1)); LatticeVal &IdxState = getValueState(I.getOperand(2)); @@ -773,13 +783,18 @@ EltState.getConstant(), IdxState.getConstant())); else if (ValState.isUndefined() && EltState.isConstant() && - IdxState.isConstant()) + IdxState.isConstant()) markConstant(&I, ConstantExpr::getInsertElement(UndefValue::get(I.getType()), EltState.getConstant(), IdxState.getConstant())); +#endif } void SCCPSolver::visitShuffleVectorInst(ShuffleVectorInst &I) { + // FIXME : SCCP does not handle vectors properly. + markOverdefined(&I); + return; +#if 0 LatticeVal &V1State = getValueState(I.getOperand(0)); LatticeVal &V2State = getValueState(I.getOperand(1)); LatticeVal &MaskState = getValueState(I.getOperand(2)); @@ -801,6 +816,7 @@ MaskState.getConstant() : UndefValue::get(I.getOperand(2)->getType()); markConstant(&I, ConstantExpr::getShuffleVector(V1, V2, Mask)); } +#endif } // Handle getelementptr instructions... if all operands are constants then we ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Regression/Transforms/InstCombine/shl-trunc.ll
Changes in directory llvm/test/Regression/Transforms/InstCombine: shl-trunc.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+7 -0) shl-trunc.ll |7 +++ 1 files changed, 7 insertions(+) Index: llvm/test/Regression/Transforms/InstCombine/shl-trunc.ll diff -c /dev/null llvm/test/Regression/Transforms/InstCombine/shl-trunc.ll:1.1 *** /dev/null Mon Dec 4 19:29:11 2006 --- llvm/test/Regression/Transforms/InstCombine/shl-trunc.llMon Dec 4 19:29:01 2006 *** *** 0 --- 1,7 + ; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep shl + + bool %test(int %X, ubyte %A) { + %B = lshr int %X, ubyte %A + %D = trunc int %B to bool + ret bool %D + } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.558 -> 1.559 --- Log message: add an instcombine xform. This speeds up 462.libquantum from 9.78s to 7.48s. This regression is due to unforseen consequences of the cast patch. --- Diffs of the changes: (+17 -0) InstructionCombining.cpp | 17 + 1 files changed, 17 insertions(+) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.558 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.559 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.558 Sun Dec 3 20:48:01 2006 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Mon Dec 4 19:26:29 2006 @@ -6023,6 +6023,23 @@ Value *V = InsertCastBefore(SrcI->getOperand(0), Ty, CI); return new ShiftInst(Instruction::LShr, V, SrcI->getOperand(1)); } + } else { // This is a variable shr. + +// Turn 'trunc (lshr X, Y) to bool' into '(X & (1 << Y)) != 0'. This is +// more LLVM instructions, but allows '1 << Y' to be hoisted if +// loop-invariant and CSE'd. +if (CI.getType() == Type::BoolTy && SrcI->hasOneUse()) { + Value *One = ConstantInt::get(SrcI->getType(), 1); + + Value *V = InsertNewInstBefore(new ShiftInst(Instruction::Shl, One, + SrcI->getOperand(1), + "tmp"), CI); + V = InsertNewInstBefore(BinaryOperator::createAnd(V, + SrcI->getOperand(0), +"tmp"), CI); + Value *Zero = Constant::getNullValue(V->getType()); + return BinaryOperator::createSetNE(V, Zero); +} } break; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp
Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.51 -> 1.52 --- Log message: Implement createPointerCast. --- Diffs of the changes: (+25 -0) Instructions.cpp | 25 + 1 files changed, 25 insertions(+) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.51 llvm/lib/VMCore/Instructions.cpp:1.52 --- llvm/lib/VMCore/Instructions.cpp:1.51 Mon Dec 4 14:17:56 2006 +++ llvm/lib/VMCore/Instructions.cppMon Dec 4 21:28:26 2006 @@ -1548,6 +1548,31 @@ return create(Instruction::Trunc, S, Ty, Name, InsertAtEnd); } +CastInst *CastInst::createPointerCast(Value *S, const Type *Ty, + const std::string &Name, + BasicBlock *InsertAtEnd) { + assert(isa(S->getType()) && "Invalid cast"); + assert((Ty->isIntegral() || Ty->getTypeID() == Type::PointerTyID) && + "Invalid cast"); + + if (Ty->isIntegral()) +return create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd); + return create(Instruction::BitCast, S, Ty, Name, InsertAtEnd); +} + +/// @brief Create a BitCast or a PtrToInt cast instruction +CastInst *CastInst::createPointerCast(Value *S, const Type *Ty, + const std::string &Name, + Instruction *InsertBefore) { + assert(isa(S->getType()) && "Invalid cast"); + assert((Ty->isIntegral() || Ty->getTypeID() == Type::PointerTyID) && + "Invalid cast"); + + if (Ty->isIntegral()) +return create(Instruction::PtrToInt, S, Ty, Name, InsertBefore); + return create(Instruction::BitCast, S, Ty, Name, InsertBefore); +} + // Provide a way to get a "cast" where the cast opcode is inferred from the // types and size of the operand. This, basically, is a parallel of the // logic in the checkCast function below. This axiom should hold: ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Constants.cpp
Changes in directory llvm/lib/VMCore: Constants.cpp updated: 1.179 -> 1.180 --- Log message: Implement getPointerCast. --- Diffs of the changes: (+10 -0) Constants.cpp | 10 ++ 1 files changed, 10 insertions(+) Index: llvm/lib/VMCore/Constants.cpp diff -u llvm/lib/VMCore/Constants.cpp:1.179 llvm/lib/VMCore/Constants.cpp:1.180 --- llvm/lib/VMCore/Constants.cpp:1.179 Mon Dec 4 15:35:24 2006 +++ llvm/lib/VMCore/Constants.cpp Mon Dec 4 21:25:26 2006 @@ -1552,6 +1552,16 @@ return getCast(Instruction::Trunc, C, Ty); } +Constant *ConstantExpr::getPointerCast(Constant *S, const Type *Ty) { + assert(isa(S->getType()) && "Invalid cast"); + assert((Ty->isIntegral() || Ty->getTypeID() == Type::PointerTyID) && + "Invalid cast"); + + if (Ty->isIntegral()) +return getCast(Instruction::PtrToInt, S, Ty); + return getCast(Instruction::BitCast, S, Ty); +} + Constant *ConstantExpr::getTrunc(Constant *C, const Type *Ty) { assert(C->getType()->isInteger() && "Trunc operand must be integer"); assert(Ty->isIntegral() && "Trunc produces only integral"); ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.107 -> 1.108 --- Log message: Remove the last inferred casts from VMCore. --- Diffs of the changes: (+7 -10) ConstantFolding.cpp | 17 +++-- 1 files changed, 7 insertions(+), 10 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.107 llvm/lib/VMCore/ConstantFolding.cpp:1.108 --- llvm/lib/VMCore/ConstantFolding.cpp:1.107 Sun Dec 3 23:19:34 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Mon Dec 4 21:30:09 2006 @@ -777,8 +777,7 @@ uint64_t V = DoubleToBits(cast(CP->getOperand(i))->getValue()); Constant *C = ConstantInt::get(Type::ULongTy, V); -Result.push_back( -ConstantExpr::getInferredCast(C, false, DstEltTy, false)); +Result.push_back(ConstantExpr::getTruncOrBitCast(C, DstEltTy )); } return ConstantPacked::get(Result); } @@ -787,8 +786,7 @@ for (unsigned i = 0; i != SrcNumElts; ++i) { uint32_t V = FloatToBits(cast(CP->getOperand(i))->getValue()); Constant *C = ConstantInt::get(Type::UIntTy, V); - Result.push_back( -ConstantExpr::getInferredCast(C, false, DstEltTy, false)); + Result.push_back(ConstantExpr::getTruncOrBitCast(C, DstEltTy)); } return ConstantPacked::get(Result); } @@ -855,7 +853,7 @@ } if (isAllNull) // This is casting one pointer type to another, always BitCast -return ConstantExpr::getCast(CE->getOperand(0), DestTy); +return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy); } } @@ -1644,7 +1642,7 @@ // We know R is unsigned, Idx0 is signed because it must be an index // through a sequential type (gep pointer operand) which is always // signed. -R = ConstantExpr::getInferredCast(R, false, Idx0->getType(), true); +R = ConstantExpr::getSExtOrBitCast(R, Idx0->getType()); R = ConstantExpr::getMul(R, Idx0); // signed multiply // R is a signed integer, C is the GEP pointer so -> IntToPtr return ConstantExpr::getCast(Instruction::IntToPtr, R, C->getType()); @@ -1676,10 +1674,9 @@ if (!Idx0->isNullValue()) { const Type *IdxTy = Combined->getType(); if (IdxTy != Idx0->getType()) { -Constant *C1 = ConstantExpr::getInferredCast( -Idx0, true, Type::LongTy, true); -Constant *C2 = ConstantExpr::getInferredCast( -Combined, true, Type::LongTy, true); +Constant *C1 = ConstantExpr::getSExtOrBitCast(Idx0, Type::LongTy); +Constant *C2 = ConstantExpr::getSExtOrBitCast(Combined, + Type::LongTy); Combined = ConstantExpr::get(Instruction::Add, C1, C2); } else { Combined = ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/README-X86-64.txt
Changes in directory llvm/lib/Target/X86: README-X86-64.txt updated: 1.1 -> 1.2 --- Log message: Update --- Diffs of the changes: (+10 -0) README-X86-64.txt | 10 ++ 1 files changed, 10 insertions(+) Index: llvm/lib/Target/X86/README-X86-64.txt diff -u llvm/lib/Target/X86/README-X86-64.txt:1.1 llvm/lib/Target/X86/README-X86-64.txt:1.2 --- llvm/lib/Target/X86/README-X86-64.txt:1.1 Fri Sep 8 01:48:29 2006 +++ llvm/lib/Target/X86/README-X86-64.txt Mon Dec 4 21:58:23 2006 @@ -252,6 +252,16 @@ possible. The above is actually one byte shorter than movq $_dst, _ptr +A better example is the code from PR1018. We are generating: + leaq xcalloc2(%rip), %rax + movq %rax, 8(%rsp) +when we should be generating: + movq $xcalloc2, 8(%rsp) + +The reason the better codegen isn't done now is support for static small +code model in JIT mode. The JIT cannot ensure that all GV's are placed in the +lower 4G so we are not treating GV labels as 32-bit values. + //===-===// Right now the asm printer assumes GlobalAddress are accessed via RIP relative ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp X86ISelDAGToDAG.cpp X86ISelLowering.cpp X86InstrInfo.h X86InstrX86-64.td X86JITInfo.cpp X86Relocations.h
Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.124 -> 1.125 X86ISelDAGToDAG.cpp updated: 1.133 -> 1.134 X86ISelLowering.cpp updated: 1.300 -> 1.301 X86InstrInfo.h updated: 1.60 -> 1.61 X86InstrX86-64.td updated: 1.9 -> 1.10 X86JITInfo.cpp updated: 1.32 -> 1.33 X86Relocations.h updated: 1.3 -> 1.4 --- Log message: - Fix X86-64 JIT by temporarily disabling code that treats GV address as 32-bit immediate in small code model. The JIT cannot ensure GV's are placed in the lower 4G. - Some preliminary support for large code model. --- Diffs of the changes: (+126 -129) X86CodeEmitter.cpp | 171 ++-- X86ISelDAGToDAG.cpp | 18 ++--- X86ISelLowering.cpp | 39 +-- X86InstrInfo.h |4 - X86InstrX86-64.td | 13 --- X86JITInfo.cpp |3 X86Relocations.h|7 +- 7 files changed, 126 insertions(+), 129 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.124 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.125 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.124Fri Dec 1 15:52:58 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Mon Dec 4 22:01:03 2006 @@ -59,12 +59,12 @@ void emitPCRelativeBlockAddress(MachineBasicBlock *MBB); void emitPCRelativeValue(intptr_t Address); void emitGlobalAddressForCall(GlobalValue *GV, bool DoesntNeedStub); -void emitGlobalAddressForPtr(GlobalValue *GV, bool isPCRelative, +void emitGlobalAddressForPtr(GlobalValue *GV, unsigned Reloc, int Disp = 0, unsigned PCAdj = 0); -void emitExternalSymbolAddress(const char *ES, bool isPCRelative); -void emitPCRelativeConstPoolAddress(unsigned CPI, int Disp = 0, -unsigned PCAdj = 0); -void emitPCRelativeJumpTableAddress(unsigned JTI, unsigned PCAdj = 0); +void emitExternalSymbolAddress(const char *ES, unsigned Reloc); +void emitConstPoolAddress(unsigned CPI, unsigned Reloc, int Disp = 0, + unsigned PCAdj = 0); +void emitJumpTableAddress(unsigned JTI, unsigned Reloc, unsigned PCAdj = 0); void emitDisplacementField(const MachineOperand *RelocOp, int DispVal, unsigned PCAdj = 0); @@ -144,41 +144,45 @@ /// emitGlobalAddress - Emit the specified address to the code stream assuming /// this is part of a "take the address of a global" instruction. /// -void Emitter::emitGlobalAddressForPtr(GlobalValue *GV, bool isPCRelative, +void Emitter::emitGlobalAddressForPtr(GlobalValue *GV, unsigned Reloc, int Disp /* = 0 */, unsigned PCAdj /* = 0 */) { - unsigned rt = isPCRelative ? X86::reloc_pcrel_word : X86::reloc_absolute_word; - MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), rt, + MCE.addRelocation(MachineRelocation::getGV(MCE.getCurrentPCOffset(), Reloc, GV, PCAdj)); + if (Reloc == X86::reloc_absolute_dword) +MCE.emitWordLE(0); MCE.emitWordLE(Disp); // The relocated value will be added to the displacement } /// emitExternalSymbolAddress - Arrange for the address of an external symbol to /// be emitted to the current location in the function, and allow it to be PC /// relative. -void Emitter::emitExternalSymbolAddress(const char *ES, bool isPCRelative) { +void Emitter::emitExternalSymbolAddress(const char *ES, unsigned Reloc) { MCE.addRelocation(MachineRelocation::getExtSym(MCE.getCurrentPCOffset(), - isPCRelative ? X86::reloc_pcrel_word : X86::reloc_absolute_word, ES)); + Reloc, ES)); + if (Reloc == X86::reloc_absolute_dword) +MCE.emitWordLE(0); MCE.emitWordLE(0); } -/// emitPCRelativeConstPoolAddress - Arrange for the address of an constant pool +/// emitConstPoolAddress - Arrange for the address of an constant pool /// to be emitted to the current location in the function, and allow it to be PC /// relative. -void Emitter::emitPCRelativeConstPoolAddress(unsigned CPI, int Disp /* = 0 */, - unsigned PCAdj /* = 0 */) { +void Emitter::emitConstPoolAddress(unsigned CPI, unsigned Reloc, + int Disp /* = 0 */, + unsigned PCAdj /* = 0 */) { MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(), -X86::reloc_pcrel_word, CPI, PCAdj)); +Reloc, CPI, PCAdj)); MCE.emitWordLE(Disp); // The relocated value will be added to the displacement } -/// emitPCRelativeJumpTableAddress - Arrange for the address of a jump table to +/// emitJumpTableAddress - Arrange for the address of a jump table to /// be emitted to the current location in the functi
[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/McCat/05-eks/main.c
Changes in directory llvm-test/MultiSource/Benchmarks/McCat/05-eks: main.c updated: 1.1 -> 1.2 --- Log message: Make this program return 0 reliably. --- Diffs of the changes: (+2 -1) main.c |3 ++- 1 files changed, 2 insertions(+), 1 deletion(-) Index: llvm-test/MultiSource/Benchmarks/McCat/05-eks/main.c diff -u llvm-test/MultiSource/Benchmarks/McCat/05-eks/main.c:1.1 llvm-test/MultiSource/Benchmarks/McCat/05-eks/main.c:1.2 --- llvm-test/MultiSource/Benchmarks/McCat/05-eks/main.c:1.1Mon May 12 13:56:38 2003 +++ llvm-test/MultiSource/Benchmarks/McCat/05-eks/main.cTue Dec 5 00:17:20 2006 @@ -47,7 +47,7 @@ else return 0; } -main () +int main () { double a,b,c,d; int i,j,k,l,m; @@ -116,6 +116,7 @@ freeMatrix(U); freeMatrix(A); } + return 0; } void Check(Matrix A, Matrix U, int l) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/McCat/09-vor/vor.c
Changes in directory llvm-test/MultiSource/Benchmarks/McCat/09-vor: vor.c updated: 1.1 -> 1.2 --- Log message: Make this test return 0 reliably. --- Diffs of the changes: (+2 -2) vor.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-test/MultiSource/Benchmarks/McCat/09-vor/vor.c diff -u llvm-test/MultiSource/Benchmarks/McCat/09-vor/vor.c:1.1 llvm-test/MultiSource/Benchmarks/McCat/09-vor/vor.c:1.2 --- llvm-test/MultiSource/Benchmarks/McCat/09-vor/vor.c:1.1 Mon May 12 13:25:11 2003 +++ llvm-test/MultiSource/Benchmarks/McCat/09-vor/vor.c Tue Dec 5 00:15:53 2006 @@ -355,9 +355,9 @@ /* * */ /* PROCEDURE: main - starts the program */ -void main(int argc, char *argv[]) +int main(int argc, char *argv[]) { get_file(); construct_vor(); - + return 0; } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp
Changes in directory llvm/lib/Target/X86: X86ATTAsmPrinter.cpp updated: 1.76 -> 1.77 --- Log message: Asm printing bug. --- Diffs of the changes: (+4 -6) X86ATTAsmPrinter.cpp | 10 -- 1 files changed, 4 insertions(+), 6 deletions(-) Index: llvm/lib/Target/X86/X86ATTAsmPrinter.cpp diff -u llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.76 llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.77 --- llvm/lib/Target/X86/X86ATTAsmPrinter.cpp:1.76 Fri Dec 1 01:38:23 2006 +++ llvm/lib/Target/X86/X86ATTAsmPrinter.cppTue Dec 5 00:43:58 2006 @@ -192,7 +192,7 @@ if (X86PICStyle == PICStyle::Stub && TM.getRelocationModel() == Reloc::PIC_) O << "-\"L" << getFunctionNumber() << "$pb\""; -if (Subtarget->is64Bit()) +if (isMemOp && Subtarget->is64Bit()) O << "(%rip)"; return; } @@ -210,7 +210,7 @@ else if (Offset < 0) O << Offset; -if (Subtarget->is64Bit()) +if (isMemOp && Subtarget->is64Bit()) O << "(%rip)"; return; } @@ -265,8 +265,7 @@ else if (Offset < 0) O << Offset; -if (isMemOp && -Subtarget->is64Bit()) { +if (isMemOp && Subtarget->is64Bit()) { if (isExt && TM.getRelocationModel() != Reloc::Static) O << "@GOTPCREL"; O << "(%rip)"; @@ -288,8 +287,7 @@ if (!isCallOp) O << '$'; O << TAI->getGlobalPrefix() << MO.getSymbolName(); -if (!isCallOp && -Subtarget->is64Bit()) +if (!isCallOp && Subtarget->is64Bit()) O << "(%rip)"; return; ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
> Index: llvm/lib/VMCore/ConstantFolding.cpp > diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.107 llvm/lib/VMCore/ > ConstantFolding.cpp:1.108 > --- llvm/lib/VMCore/ConstantFolding.cpp:1.107 Sun Dec 3 23:19:34 2006 > +++ llvm/lib/VMCore/ConstantFolding.cpp Mon Dec 4 21:30:09 2006 > @@ -777,8 +777,7 @@ > uint64_t V = >DoubleToBits(cast(CP->getOperand(i))- > >getValue()); > Constant *C = ConstantInt::get(Type::ULongTy, V); > -Result.push_back( > -ConstantExpr::getInferredCast(C, false, DstEltTy, > false)); > +Result.push_back(ConstantExpr::getTruncOrBitCast(C, > DstEltTy )); >} >return ConstantPacked::get(Result); > } > @@ -787,8 +786,7 @@ > for (unsigned i = 0; i != SrcNumElts; ++i) { >uint32_t V = FloatToBits(cast(CP->getOperand(i))- > >getValue()); >Constant *C = ConstantInt::get(Type::UIntTy, V); > - Result.push_back( > -ConstantExpr::getInferredCast(C, false, DstEltTy, false)); > + Result.push_back(ConstantExpr::getTruncOrBitCast(C, DstEltTy)); > } > return ConstantPacked::get(Result); >} Again, these should only be bitcast. They can never be truncates. > @@ -855,7 +853,7 @@ > } >if (isAllNull) > // This is casting one pointer type to another, always > BitCast > -return ConstantExpr::getCast(CE->getOperand(0), DestTy); > +return ConstantExpr::getPointerCast(CE->getOperand(0), > DestTy); > } >} Likewise. -Chris ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/ConstantFolding.cpp
Changes in directory llvm/lib/VMCore: ConstantFolding.cpp updated: 1.108 -> 1.109 --- Log message: Can't make these fail now with just BitCast. Previous failures must have been in conjunction with something else. By right, they should just be BitCasts. --- Diffs of the changes: (+2 -2) ConstantFolding.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm/lib/VMCore/ConstantFolding.cpp diff -u llvm/lib/VMCore/ConstantFolding.cpp:1.108 llvm/lib/VMCore/ConstantFolding.cpp:1.109 --- llvm/lib/VMCore/ConstantFolding.cpp:1.108 Mon Dec 4 21:30:09 2006 +++ llvm/lib/VMCore/ConstantFolding.cpp Tue Dec 5 01:18:07 2006 @@ -777,7 +777,7 @@ uint64_t V = DoubleToBits(cast(CP->getOperand(i))->getValue()); Constant *C = ConstantInt::get(Type::ULongTy, V); -Result.push_back(ConstantExpr::getTruncOrBitCast(C, DstEltTy )); +Result.push_back(ConstantExpr::getBitCast(C, DstEltTy )); } return ConstantPacked::get(Result); } @@ -786,7 +786,7 @@ for (unsigned i = 0; i != SrcNumElts; ++i) { uint32_t V = FloatToBits(cast(CP->getOperand(i))->getValue()); Constant *C = ConstantInt::get(Type::UIntTy, V); - Result.push_back(ConstantExpr::getTruncOrBitCast(C, DstEltTy)); + Result.push_back(ConstantExpr::getBitCast(C, DstEltTy)); } return ConstantPacked::get(Result); } ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/X86/X86CodeEmitter.cpp
Changes in directory llvm/lib/Target/X86: X86CodeEmitter.cpp updated: 1.125 -> 1.126 --- Log message: JIT large code model support. --- Diffs of the changes: (+13 -7) X86CodeEmitter.cpp | 20 +--- 1 files changed, 13 insertions(+), 7 deletions(-) Index: llvm/lib/Target/X86/X86CodeEmitter.cpp diff -u llvm/lib/Target/X86/X86CodeEmitter.cpp:1.125 llvm/lib/Target/X86/X86CodeEmitter.cpp:1.126 --- llvm/lib/Target/X86/X86CodeEmitter.cpp:1.125Mon Dec 4 22:01:03 2006 +++ llvm/lib/Target/X86/X86CodeEmitter.cpp Tue Dec 5 01:29:55 2006 @@ -173,6 +173,8 @@ unsigned PCAdj /* = 0 */) { MCE.addRelocation(MachineRelocation::getConstPool(MCE.getCurrentPCOffset(), Reloc, CPI, PCAdj)); + if (Reloc == X86::reloc_absolute_dword) +MCE.emitWordLE(0); MCE.emitWordLE(Disp); // The relocated value will be added to the displacement } @@ -183,6 +185,8 @@ unsigned PCAdj /* = 0 */) { MCE.addRelocation(MachineRelocation::getJumpTable(MCE.getCurrentPCOffset(), Reloc, JTI, PCAdj)); + if (Reloc == X86::reloc_absolute_dword) +MCE.emitWordLE(0); MCE.emitWordLE(0); // The relocated value will be added to the displacement } @@ -617,7 +621,7 @@ unsigned CurOp = 0; if (NumOps > 1 && Desc->getOperandConstraint(1, TOI::TIED_TO) != -1) CurOp++; - + unsigned char BaseOpcode = II->getBaseOpcodeFor(Desc); switch (Desc->TSFlags & X86II::FormMask) { default: assert(0 && "Unknown FormMask value in X86 MachineCodeEmitter!"); @@ -675,9 +679,8 @@ emitConstant(MO1.getImm(), Size); else { unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_absolute_word; -// FIXME if (Opcode == X86::MOV64ri) - rt = X86::reloc_absolute_dword; + rt = X86::reloc_absolute_dword; // FIXME: add X86II flag? if (MO1.isGlobalAddress()) emitGlobalAddressForPtr(MO1.getGlobal(), rt, MO1.getOffset()); else if (MO1.isExternalSymbol()) @@ -743,10 +746,10 @@ if (MO1.isImmediate()) emitConstant(MO1.getImm(), Size); else { -unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_absolute_word; -// FIXME +unsigned rt = Is64BitMode ? X86::reloc_pcrel_word + : X86::reloc_absolute_word; if (Opcode == X86::MOV64ri32) - rt = X86::reloc_absolute_word; + rt = X86::reloc_absolute_word; // FIXME: add X86II flag? if (MO1.isGlobalAddress()) emitGlobalAddressForPtr(MO1.getGlobal(), rt, MO1.getOffset()); else if (MO1.isExternalSymbol()) @@ -777,7 +780,10 @@ if (MO.isImmediate()) emitConstant(MO.getImm(), Size); else { -unsigned rt = Is64BitMode ? X86::reloc_pcrel_word : X86::reloc_absolute_word; +unsigned rt = Is64BitMode ? X86::reloc_pcrel_word + : X86::reloc_absolute_word; +if (Opcode == X86::MOV64mi32) + rt = X86::reloc_absolute_word; // FIXME: add X86II flag? if (MO.isGlobalAddress()) emitGlobalAddressForPtr(MO.getGlobal(), rt, MO.getOffset()); else if (MO.isExternalSymbol()) ___ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits