[llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp

2007-02-02 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMRegisterInfo.cpp updated: 1.53 - 1.54
---
Log message:

Ugh. Only meant to do this in thumb mode.

---
Diffs of the changes:  (+10 -5)

 ARMRegisterInfo.cpp |   15 ++-
 1 files changed, 10 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.53 
llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.54
--- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.53Wed Jan 31 20:18:36 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Fri Feb  2 02:58:48 2007
@@ -1159,12 +1159,17 @@
   }
 
   if (VARegSaveSize) {
-// Epilogue for vararg functions: pop LR to R3 and branch off it.
-// FIXME: Verify this is still ok when R3 is no longer being reserved.
-BuildMI(MBB, MBBI, TII.get(ARM::tPOP)).addReg(ARM::R3);
+if (isThumb)
+  // Epilogue for vararg functions: pop LR to R3 and branch off it.
+  // FIXME: Verify this is still ok when R3 is no longer being reserved.
+  BuildMI(MBB, MBBI, TII.get(ARM::tPOP)).addReg(ARM::R3);
+
 emitSPUpdate(MBB, MBBI, VARegSaveSize, isThumb, TII);
-BuildMI(MBB, MBBI, TII.get(ARM::tBX_RET_vararg)).addReg(ARM::R3);
-MBB.erase(MBBI);
+
+if (isThumb) {
+  BuildMI(MBB, MBBI, TII.get(ARM::tBX_RET_vararg)).addReg(ARM::R3);
+  MBB.erase(MBBI);
+}
   }
 }
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp

2007-02-02 Thread Reid Spencer


Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.258 - 1.259
---
Log message:

Fix a comment that needed to change after SHIFT patch landed.


---
Diffs of the changes:  (+1 -2)

 AsmWriter.cpp |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.258 llvm/lib/VMCore/AsmWriter.cpp:1.259
--- llvm/lib/VMCore/AsmWriter.cpp:1.258 Thu Feb  1 20:16:22 2007
+++ llvm/lib/VMCore/AsmWriter.cpp   Fri Feb  2 07:54:55 2007
@@ -1270,8 +1270,7 @@
 bool PrintAllTypes = false;
 const Type *TheType = Operand-getType();
 
-// Shift Left  Right print both types even for Ubyte LHS, and select 
prints
-// types even if all operands are bools.
+// Select, Store and ShuffleVector always print all types.
 if (isaSelectInst(I) || isaStoreInst(I) || isaShuffleVectorInst(I)) {
   PrintAllTypes = true;
 } else {



___
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

2007-02-02 Thread Reid Spencer


Changes in directory llvm/docs:

LangRef.html updated: 1.206 - 1.207
---
Log message:

Put the Shift instructions in the right section.


---
Diffs of the changes:  (+17 -16)

 LangRef.html |   33 +
 1 files changed, 17 insertions(+), 16 deletions(-)


Index: llvm/docs/LangRef.html
diff -u llvm/docs/LangRef.html:1.206 llvm/docs/LangRef.html:1.207
--- llvm/docs/LangRef.html:1.206Wed Jan 31 15:39:12 2007
+++ llvm/docs/LangRef.html  Fri Feb  2 07:57:07 2007
@@ -85,13 +85,13 @@
   lia href=#i_urem'tturem/tt' Instruction/a/li
   lia href=#i_srem'ttsrem/tt' Instruction/a/li
   lia href=#i_frem'ttfrem/tt' Instruction/a/li
-  lia href=#i_shl'ttshl/tt' Instruction/a/li
-  lia href=#i_lshr'ttlshr/tt' Instruction/a/li
-  lia href=#i_ashr'ttashr/tt' Instruction/a/li
 /ol
   /li
   lia href=#bitwiseopsBitwise Binary Operations/a
 ol
+  lia href=#i_shl'ttshl/tt' Instruction/a/li
+  lia href=#i_lshr'ttlshr/tt' Instruction/a/li
+  lia href=#i_ashr'ttashr/tt' Instruction/a/li
   lia href=#i_and'ttand/tt' Instruction/a/li
   lia href=#i_or'ttor/tt'  Instruction/a/li
   lia href=#i_xor'ttxor/tt' Instruction/a/li
@@ -1952,6 +1952,18 @@
 /pre
 /div
 
+!-- === 
--
+div class=doc_subsection a name=bitwiseopsBitwise Binary
+Operations/a /div
+div class=doc_text
+pBitwise binary operators are used to do various forms of
+bit-twiddling in a program.  They are generally very efficient
+instructions and can commonly be strength reduced from other
+instructions.  They require two operands, execute an operation on them,
+and produce a single value.  The resulting value of the bitwise binary
+operators is always the same type as its first operand./p
+/div
+
 !-- ___ 
--
 div class=doc_subsubsection a name=i_shl'ttshl/tt'
 Instruction/a /div
@@ -2003,7 +2015,7 @@
 /pre
 /div
 
-!-- === 
--
+!-- ___ 
--
 div class=doc_subsubsection a name=i_ashr'ttashr/tt'
 Instruction/a /div
 div class=doc_text
@@ -2034,17 +2046,6 @@
 /pre
 /div
 
-!-- === 
--
-div class=doc_subsection a name=bitwiseopsBitwise Binary
-Operations/a /div
-div class=doc_text
-pBitwise binary operators are used to do various forms of
-bit-twiddling in a program.  They are generally very efficient
-instructions and can commonly be strength reduced from other
-instructions.  They require two operands, execute an operation on them,
-and produce a single value.  The resulting value of the bitwise binary
-operators is always the same type as its first operand./p
-/div
 !-- ___ 
--
 div class=doc_subsubsection a name=i_and'ttand/tt'
 Instruction/a /div
@@ -4507,7 +4508,7 @@
 
   a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/01/31 21:39:12 $
+  Last modified: $Date: 2007/02/02 13:57:07 $
 /address
 /body
 /html



___
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 ScalarReplAggregates.cpp

2007-02-02 Thread Reid Spencer


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.621 - 1.622
ScalarReplAggregates.cpp updated: 1.69 - 1.70
---
Log message:

Use short form of binary operator create functions.


---
Diffs of the changes:  (+25 -25)

 InstructionCombining.cpp |   46 +++---
 ScalarReplAggregates.cpp |4 ++--
 2 files changed, 25 insertions(+), 25 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.621 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.622
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.621   Thu Feb  1 
23:29:55 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Feb  2 08:08:20 2007
@@ -1200,7 +1200,7 @@
 // the shift amount is = the size of the datatype, which is undefined.
 if (DemandedMask == 1) {
   // Perform the logical shift right.
-  Value *NewVal = BinaryOperator::create(Instruction::LShr, 
+  Value *NewVal = BinaryOperator::createLShr(
 I-getOperand(0), I-getOperand(1), I-getName());
   InsertNewInstBefore(castInstruction(NewVal), *I);
   return UpdateValueUsesWith(I, NewVal);
@@ -1232,7 +1232,7 @@
   // are demanded, turn this into an unsigned shift right.
   if ((KnownZero  SignBit) || (HighBits  ~DemandedMask) == HighBits) {
 // Perform the logical shift right.
-Value *NewVal = BinaryOperator::create(Instruction::LShr, 
+Value *NewVal = BinaryOperator::createLShr(
   I-getOperand(0), SA, I-getName());
 InsertNewInstBefore(castInstruction(NewVal), *I);
 return UpdateValueUsesWith(I, NewVal);
@@ -1549,7 +1549,7 @@
   AddRHS(Value *rhs) : RHS(rhs) {}
   bool shouldApply(Value *LHS) const { return LHS == RHS; }
   Instruction *apply(BinaryOperator Add) const {
-return BinaryOperator::create(Instruction::Shl, Add.getOperand(0),
+return BinaryOperator::createShl(Add.getOperand(0),
   ConstantInt::get(Add.getType(), 1));
   }
 };
@@ -1973,7 +1973,7 @@
 if (CU-getZExtValue() == 
 SI-getType()-getPrimitiveSizeInBits()-1) {
   // Ok, the transformation is safe.  Insert LShr. 
-  return BinaryOperator::create(Instruction::LShr, 
+  return BinaryOperator::createLShr(
   SI-getOperand(0), CU, 
SI-getName());
 }
   }
@@ -2126,7 +2126,7 @@
   int64_t Val = (int64_t)castConstantInt(CI)-getZExtValue();
   if (isPowerOf2_64(Val)) {  // Replace X*(2^C) with X  C
 uint64_t C = Log2_64(Val);
-return BinaryOperator::create(Instruction::Shl, Op0,
+return BinaryOperator::createShl(Op0,
   ConstantInt::get(Op0-getType(), C));
   }
 } else if (ConstantFP *Op1F = dyn_castConstantFP(Op1)) {
@@ -2322,7 +2322,7 @@
 if (uint64_t Val = C-getZExtValue())// Don't break X / 0
   if (isPowerOf2_64(Val)) {
 uint64_t ShiftAmt = Log2_64(Val);
-return BinaryOperator::create(Instruction::LShr, Op0, 
+return BinaryOperator::createLShr(Op0, 
 ConstantInt::get(Op0-getType(), 
ShiftAmt));
   }
   }
@@ -2339,7 +2339,7 @@
   Constant *C2V = ConstantInt::get(NTy, C2);
   N = InsertNewInstBefore(BinaryOperator::createAdd(N, C2V, tmp), I);
 }
-return BinaryOperator::create(Instruction::LShr, Op0, N);
+return BinaryOperator::createLShr(Op0, N);
   }
 }
   }
@@ -2356,13 +2356,13 @@
 unsigned TSA = Log2_64(TVA), FSA = Log2_64(FVA);
 // Construct the on true case of the select
 Constant *TC = ConstantInt::get(Op0-getType(), TSA);
-Instruction *TSI = BinaryOperator::create(Instruction::LShr, 
+Instruction *TSI = BinaryOperator::createLShr(
Op0, TC, 
SI-getName()+.t);
 TSI = InsertNewInstBefore(TSI, I);
 
 // Construct the on false case of the select
 Constant *FC = ConstantInt::get(Op0-getType(), FSA); 
-Instruction *FSI = BinaryOperator::create(Instruction::LShr,
+Instruction *FSI = BinaryOperator::createLShr(
Op0, FC, 
SI-getName()+.f);
 FSI = InsertNewInstBefore(FSI, I);
 
@@ -2916,7 +2916,7 @@
 // Make the argument unsigned.
 Value *ShVal = Op-getOperand(0);
 ShVal = InsertNewInstBefore(
-BinaryOperator::create(Instruction::LShr, ShVal, OpRHS, 
+BinaryOperator::createLShr(ShVal, OpRHS, 
Op-getName()), TheAnd);
 return BinaryOperator::createAnd(ShVal, AndRHS, TheAnd.getName());
   }
@@ -4681,11 +4681,11 @@
 // Compute C  Y.
   

[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp

2007-02-02 Thread Reid Spencer


Changes in directory llvm/lib/Transforms/Scalar:

InstructionCombining.cpp updated: 1.622 - 1.623
---
Log message:

Remove dead code and fix indentation per Chris' review comments.


---
Diffs of the changes:  (+12 -31)

 InstructionCombining.cpp |   43 ---
 1 files changed, 12 insertions(+), 31 deletions(-)


Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.622 
llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.623
--- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.622   Fri Feb  2 
08:08:20 2007
+++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Feb  2 08:41:37 2007
@@ -4605,16 +4605,6 @@
   if (Shift  !Shift-isShift())
 Shift = 0;
 
-  // Check to see if there is a noop-cast between the shift and the 
and.
-  if (!Shift) {
-if (CastInst *CI = dyn_castCastInst(LHSI-getOperand(0)))
-  if (CI-getOpcode() == Instruction::BitCast) {
-Shift = dyn_castBinaryOperator(CI-getOperand(0));
-if (Shift  !Shift-isShift())
-  Shift = 0;
-  }
-  }
-
   ConstantInt *ShAmt;
   ShAmt = Shift ? dyn_castConstantInt(Shift-getOperand(1)) : 0;
   const Type *Ty = Shift ? Shift-getType() : 0;  // Type of the shift.
@@ -5487,7 +5477,7 @@
 case Instruction::Add:
 case Instruction::And:
 case Instruction::Or:
-case Instruction::Xor:
+case Instruction::Xor: {
   // These operators commute.
   // Turn (Y + (X  C))  C  -  (X + (Y  C))  (~0  C)
   if (isLeftShift  Op0BO-getOperand(1)-hasOneUse() 
@@ -5507,10 +5497,11 @@
   }
   
   // Turn (Y + ((X  C)  CC))  C  -  ((X  (CC  C)) + (Y  C))
-  if (isLeftShift  Op0BO-getOperand(1)-hasOneUse() 
-  match(Op0BO-getOperand(1), m_And(m_Shr(m_Value(V1), 
m_Value(V2)),
-m_ConstantInt(CC)))  V2 == Op1 
-  castBinaryOperator(Op0BO-getOperand(1))-getOperand(0)-hasOneUse()) {
+  Value *Op0BOOp1 = Op0BO-getOperand(1);
+  if (isLeftShift  Op0BOOp1-hasOneUse()  V2 == Op1 
+  match(Op0BOOp1, 
+m_And(m_Shr(m_Value(V1), m_Value(V2)),m_ConstantInt(CC))) 

+  castBinaryOperator(Op0BOOp1)-getOperand(0)- hasOneUse()) {
 Instruction *YS = BinaryOperator::createShl(
  Op0BO-getOperand(0), Op1,
  Op0BO-getName());
@@ -5522,9 +5513,10 @@
 
 return BinaryOperator::create(Op0BO-getOpcode(), YS, XM);
   }
+}
   
-  // FALL THROUGH.
-case Instruction::Sub:
+// FALL THROUGH.
+case Instruction::Sub: {
   // Turn ((X  C) + Y)  C  -  (X + (Y  C))  (~0  C)
   if (isLeftShift  Op0BO-getOperand(0)-hasOneUse() 
   match(Op0BO-getOperand(0),
@@ -5562,6 +5554,7 @@
   }
   
   break;
+}
   }
   
   
@@ -5616,12 +5609,6 @@
   BinaryOperator *ShiftOp = dyn_castBinaryOperator(Op0);
   if (ShiftOp  !ShiftOp-isShift())
 ShiftOp = 0;
-  if (!ShiftOp)
-if (BitCastInst *CI = dyn_castBitCastInst(Op0))
-  // If this is a noop-integer cast of a shift instruction, use the shift.
-  if (BinaryOperator *SI = dyn_castBinaryOperator(CI-getOperand(0)))
-if (SI-isShift())
-  ShiftOp = SI;
   
   if (ShiftOp  isaConstantInt(ShiftOp-getOperand(1))) {
 // Find the operands and properties of the input shift.  Note that the
@@ -6594,14 +6581,8 @@
 else
   return BinaryOperator::create(BO-getOpcode(), NewSI, MatchOp);
   }
-
-  assert(TI-isShift()  Should only have Shift here);
-  if (MatchIsOpZero)
-return BinaryOperator::create(Instruction::BinaryOps(TI-getOpcode()), 
-  MatchOp, NewSI);
-  else
-return BinaryOperator::create(Instruction::BinaryOps(TI-getOpcode()), 
-  NewSI, MatchOp);
+  assert(0  Shouldn't get here);
+  return 0;
 }
 
 Instruction *InstCombiner::visitSelectInst(SelectInst SI) {



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/opt/opt.cpp

2007-02-02 Thread Reid Spencer


Changes in directory llvm/tools/opt:

opt.cpp updated: 1.127 - 1.128
---
Log message:

For PR1152: http://llvm.org/PR1152 :
Step 1: Copy gccas functionality to opt. This endows opt with a new
-std-compile-opts option to get the set of optimization passes that
gccas used. It also adds -disable-inlining and -disable-opt which
both apply only if -std-compile-opts is given. The -strip-debug option
was also removed. It just makes sure that -strip gets done early and
is mostly there for compatibility with gccas. Finally, a new 
-verify-each option will cause the verify pass to be run after each pass.


---
Diffs of the changes:  (+100 -2)

 opt.cpp |  102 ++--
 1 files changed, 100 insertions(+), 2 deletions(-)


Index: llvm/tools/opt/opt.cpp
diff -u llvm/tools/opt/opt.cpp:1.127 llvm/tools/opt/opt.cpp:1.128
--- llvm/tools/opt/opt.cpp:1.127Tue Jan 30 22:45:28 2007
+++ llvm/tools/opt/opt.cpp  Fri Feb  2 08:46:29 2007
@@ -68,6 +68,24 @@
 NoVerify(disable-verify, cl::desc(Do not verify result module), 
cl::Hidden);
 
 static cl::optbool
+VerifyEach(verify-each, cl::desc(Verify after each transform));
+
+static cl::optbool
+StripDebug(strip-debug,
+   cl::desc(Strip debugger symbol info from translation unit));
+
+static cl::optbool
+DisableInline(disable-inlining, cl::desc(Do not run the inliner pass));
+
+static cl::optbool 
+DisableOptimizations(disable-opt, 
+ cl::desc(Do not run any optimization passes));
+
+static cl::optbool
+StandardCompileOpts(std-compile-opts, 
+   cl::desc(Include the standard compile time 
optimizations));
+
+static cl::optbool
 Quiet(q, cl::desc(Obsolete option), cl::Hidden);
 
 static cl::alias
@@ -148,6 +166,76 @@
   }
 };
 
+inline void addPass(PassManager PM, Pass *P) {
+  // Add the pass to the pass manager...
+  PM.add(P);
+
+  // If we are verifying all of the intermediate steps, add the verifier...
+  if (VerifyEach) PM.add(createVerifierPass());
+}
+
+void AddStandardCompilePasses(PassManager PM) {
+  PM.add(createVerifierPass());  // Verify that input is 
correct
+
+  addPass(PM, createLowerSetJmpPass());  // Lower llvm.setjmp/.longjmp
+  addPass(PM, createFunctionResolvingPass());// Resolve (...) functions
+
+  // If the -strip-debug command line option was specified, do it.
+  if (StripDebug)
+addPass(PM, createStripSymbolsPass(true));
+
+  if (DisableOptimizations) return;
+
+  addPass(PM, createRaiseAllocationsPass()); // call %malloc - malloc inst
+  addPass(PM, createCFGSimplificationPass());// Clean up disgusting code
+  addPass(PM, createPromoteMemoryToRegisterPass());// Kill useless allocas
+  addPass(PM, createGlobalOptimizerPass());  // Optimize out global vars
+  addPass(PM, createGlobalDCEPass());// Remove unused fns and globs
+  addPass(PM, createIPConstantPropagationPass());// IP Constant Propagation
+  addPass(PM, createDeadArgEliminationPass());   // Dead argument elimination
+  addPass(PM, createInstructionCombiningPass()); // Clean up after IPCP  DAE
+  addPass(PM, createCFGSimplificationPass());// Clean up after IPCP  DAE
+
+  addPass(PM, createPruneEHPass());  // Remove dead EH info
+
+  if (!DisableInline)
+addPass(PM, createFunctionInliningPass());   // Inline small functions
+  addPass(PM, createArgumentPromotionPass());// Scalarize uninlined fn args
+
+  addPass(PM, createRaisePointerReferencesPass());// Recover type information
+  addPass(PM, createTailDuplicationPass());  // Simplify cfg by copying 
code
+  addPass(PM, createInstructionCombiningPass()); // Cleanup for scalarrepl.
+  addPass(PM, createCFGSimplificationPass());// Merge  remove BBs
+  addPass(PM, createScalarReplAggregatesPass()); // Break up aggregate allocas
+  addPass(PM, createInstructionCombiningPass()); // Combine silly seq's
+  addPass(PM, createCondPropagationPass());  // Propagate conditionals
+
+  addPass(PM, createTailCallEliminationPass());  // Eliminate tail calls
+  addPass(PM, createCFGSimplificationPass());// Merge  remove BBs
+  addPass(PM, createReassociatePass());  // Reassociate expressions
+  addPass(PM, createLICMPass()); // Hoist loop invariants
+  addPass(PM, createLoopUnswitchPass()); // Unswitch loops.
+  addPass(PM, createInstructionCombiningPass()); // Clean up after LICM/reassoc
+  addPass(PM, createIndVarSimplifyPass());   // Canonicalize indvars
+  addPass(PM, createLoopUnrollPass());   // Unroll small loops
+  addPass(PM, createInstructionCombiningPass()); // Clean up after the unroller
+  addPass(PM, createLoadValueNumberingPass());   // GVN for load instructions
+  addPass(PM, createGCSEPass()); // Remove common subexprs
+  addPass(PM, createSCCPPass()); // Constant prop with SCCP
+
+  // Run instcombine after redundancy elimination to exploit opportunities
+  // 

[llvm-commits] CVS: llvm/tools/gccas/gccas.sh Makefile gccas.cpp

2007-02-02 Thread Reid Spencer


Changes in directory llvm/tools/gccas:

gccas.sh added (r1.1)
Makefile updated: 1.27 - 1.28
gccas.cpp (r1.126) removed
---
Log message:

For PR1152: http://llvm.org/PR1152 :
Step 2: Make plug compatible shell script to replace gccas binary.


---
Diffs of the changes:  (+76 -6)

 Makefile |   19 +--
 gccas.sh |   63 +++
 2 files changed, 76 insertions(+), 6 deletions(-)


Index: llvm/tools/gccas/gccas.sh
diff -c /dev/null llvm/tools/gccas/gccas.sh:1.1
*** /dev/null   Fri Feb  2 09:51:08 2007
--- llvm/tools/gccas/gccas.sh   Fri Feb  2 09:50:58 2007
***
*** 0 
--- 1,63 
+ #!/bin/sh
+ ##===- tools/gccas.sh --*- bash 
-*-===##
+ # 
+ # The LLVM Compiler Infrastructure
+ #
+ # This file was developed by Reid Spencer and is distributed under the
+ # University of Illinois Open Source License. See LICENSE.TXT for details.
+ # 
+ 
##===--===##
+ #
+ # Synopsis: This shell script is a replacement for the old gccas tool that
+ #   existed in LLVM versions before 2.0. The functionality of gccas 
has
+ #   now been moved to opt and llvm-as. This shell script provides 
+ #   backwards compatibility so build environments invoking gccas can
+ #   still get the net effect of llvm-as/opt by running gccas.
+ #
+ # Syntax:   gccas OPTIONS... [asm file]
+ # 
+ 
##===--===##
+ #
+ [EMAIL PROTECTED]@
+ OPTOPTS=-std-compile-opts -f
+ ASOPTS=
+ lastwasdasho=0
+ for option in $@ ; do
+   case $option in
+ -disable-opt)
+OPTOPTS=$OPTOPTS $option
+;;
+ -disable-inlining)
+OPTOPTS=$OPTOPTS $option
+;;
+ -verify)
+OPTOPTS=$OPTOPTS -verify-each
+;;
+ -strip-debug)
+OPTOPTS=$OPTOPTS $option
+;;
+ -o)
+OPTOPTS=$OPTOPTS -o
+lastwasdasho=1
+;;
+ -disable-compression)
+# ignore
+;;
+ -traditional-format)
+# ignore
+;;
+ -*)
+echo gccas: Unrecognized option '$option'
+exit 1
+;;
+ *)
+if test $lastwasdasho -eq 1 ; then
+  OPTOPTS=$OPTOPTS $option
+  lastwasdasho=0
+else
+  ASOPTS=$ASOPTS $option
+fi
+;;
+   esac
+ done
+ ${TOOLDIR}/llvm-as $ASOPTS -o - | ${TOOLDIR}/opt $OPTOPTS


Index: llvm/tools/gccas/Makefile
diff -u llvm/tools/gccas/Makefile:1.27 llvm/tools/gccas/Makefile:1.28
--- llvm/tools/gccas/Makefile:1.27  Mon Sep  4 00:59:09 2006
+++ llvm/tools/gccas/Makefile   Fri Feb  2 09:50:58 2007
@@ -2,14 +2,21 @@
 # 
 # The LLVM Compiler Infrastructure
 #
-# This file was developed by the LLVM research group and is distributed under
-# the University of Illinois Open Source License. See LICENSE.TXT for details.
+# This file was developed by Reid Spencer and is distributed under the
+# University of Illinois Open Source License. See LICENSE.TXT for details.
 # 
 
##===--===##
 LEVEL = ../..
 
-TOOLNAME = gccas
-LINK_COMPONENTS = asmparser bcwriter scalaropts ipo ipa transforms
-REQUIRES_EH := 1
-
 include $(LEVEL)/Makefile.common
+
+install-local:: $(PROJ_bindir)/gccas
+   
+$(PROJ_bindir)/gccas : gccas.sh
+   sed [EMAIL PROTECTED]@#$(PROJ_bindir)# $  $@
+
+all-local:: $(ToolDir)/gccas
+   
+$(ToolDir)/gccas : gccas.sh
+   sed [EMAIL PROTECTED]@#$(ToolDir)# $  $@
+



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp

2007-02-02 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMConstantIslandPass.cpp updated: 1.21 - 1.22
---
Log message:

Watch out for empty BB.

---
Diffs of the changes:  (+1 -0)

 ARMConstantIslandPass.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.21 
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.22
--- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.21  Thu Feb  1 14:44:52 2007
+++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp   Fri Feb  2 12:49:02 2007
@@ -352,6 +352,7 @@
 // In thumb mode, if this block is a constpool island, pessmisticly assume
 // it needs to be padded by two byte so it's aligned on 4 byte boundary.
 if (AFI-isThumbFunction() 
+MBB.size() 
 MBB.begin()-getOpcode() == ARM::CONSTPOOL_ENTRY)
   MBBSize += 2;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp

2007-02-02 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMConstantIslandPass.cpp updated: 1.22 - 1.23
---
Log message:

Use MBB.empty() instead of MBB.size() for speed.

---
Diffs of the changes:  (+1 -1)

 ARMConstantIslandPass.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.22 
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.23
--- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.22  Fri Feb  2 12:49:02 2007
+++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp   Fri Feb  2 13:09:19 2007
@@ -352,7 +352,7 @@
 // In thumb mode, if this block is a constpool island, pessmisticly assume
 // it needs to be padded by two byte so it's aligned on 4 byte boundary.
 if (AFI-isThumbFunction() 
-MBB.size() 
+!MBB.empty() 
 MBB.begin()-getOpcode() == ARM::CONSTPOOL_ENTRY)
   MBBSize += 2;
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/ADT/DenseMap.h

2007-02-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/ADT:

DenseMap.h updated: 1.11 - 1.12
---
Log message:

add iterators


---
Diffs of the changes:  (+82 -22)

 DenseMap.h |  104 -
 1 files changed, 82 insertions(+), 22 deletions(-)


Index: llvm/include/llvm/ADT/DenseMap.h
diff -u llvm/include/llvm/ADT/DenseMap.h:1.11 
llvm/include/llvm/ADT/DenseMap.h:1.12
--- llvm/include/llvm/ADT/DenseMap.h:1.11   Thu Feb  1 01:49:59 2007
+++ llvm/include/llvm/ADT/DenseMap.hFri Feb  2 13:27:13 2007
@@ -16,6 +16,7 @@
 
 #include llvm/Support/DataTypes.h
 #include cassert
+#include utility
 
 namespace llvm {
   
@@ -38,10 +39,12 @@
   static bool isPod() { return true; }
 };
 
+templatetypename KeyT, typename ValueT
+class DenseMapIterator;
 
 templatetypename KeyT, typename ValueT
 class DenseMap {
-  struct BucketT { KeyT Key; ValueT Value; };
+  typedef std::pairKeyT, ValueT BucketT;
   unsigned NumBuckets;
   BucketT *Buckets;
   
@@ -54,21 +57,26 @@
   ~DenseMap() {
 const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
 for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
-  if (P-Key != EmptyKey  P-Key != TombstoneKey)
-P-Value.~ValueT();
-  P-Key.~KeyT();
+  if (P-first != EmptyKey  P-first != TombstoneKey)
+P-second.~ValueT();
+  P-first.~KeyT();
 }
 delete[] (char*)Buckets;
   }
   
+  typedef DenseMapIteratorKeyT, ValueT iterator;
+  typedef DenseMapIteratorKeyT, ValueT const_iterator;
+  inline iterator begin() const;
+  inline iterator end() const;
+  
   unsigned size() const { return NumEntries; }
   
   void clear() {
 const KeyT EmptyKey = getEmptyKey(), TombstoneKey = getTombstoneKey();
 for (BucketT *P = Buckets, *E = Buckets+NumBuckets; P != E; ++P) {
-  if (P-Key != EmptyKey  P-Key != TombstoneKey) {
-P-Key = EmptyKey;
-P-Value.~ValueT();
+  if (P-first != EmptyKey  P-first != TombstoneKey) {
+P-first = EmptyKey;
+P-second.~ValueT();
 --NumEntries;
   }
 }
@@ -84,7 +92,7 @@
   ValueT operator[](const KeyT Val) {
 BucketT *TheBucket;
 if (LookupBucketFor(Val, TheBucket))
-  return TheBucket-Value;
+  return TheBucket-second;
 
 // If the load of the hash table is more than 3/4, grow it.
 if (NumEntries*4 = NumBuckets*3) {
@@ -92,9 +100,9 @@
   LookupBucketFor(Val, TheBucket);
 }
 ++NumEntries;
-TheBucket-Key = Val;
-new (TheBucket-Value) ValueT();
-return TheBucket-Value;
+TheBucket-first = Val;
+new (TheBucket-second) ValueT();
+return TheBucket-second;
   }
   
 private:
@@ -125,14 +133,14 @@
 while (1) {
   BucketT *ThisBucket = BucketsPtr + (BucketNo  (NumBuckets-1));
   // Found Val's bucket?  If so, return it.
-  if (ThisBucket-Key == Val) {
+  if (ThisBucket-first == Val) {
 FoundBucket = ThisBucket;
 return true;
   }
   
   // If we found an empty bucket, the key doesn't exist in the set.
   // Insert it and return the default value.
-  if (ThisBucket-Key == EmptyKey) {
+  if (ThisBucket-first == EmptyKey) {
 // If we've already seen a tombstone while probing, fill it in instead
 // of the empty bucket we eventually probed to.
 if (FoundTombstone) ThisBucket = FoundTombstone;
@@ -142,7 +150,7 @@
   
   // If this is a tombstone, remember it.  If Val ends up not in the map, 
we
   // prefer to return it than something that would require more probing.
-  if (ThisBucket-Key == TombstoneKey  !FoundTombstone)
+  if (ThisBucket-first == TombstoneKey  !FoundTombstone)
 FoundTombstone = ThisBucket;  // Remember the first tombstone found.
   
   // Otherwise, it's a hash collision or a tombstone, continue quadratic
@@ -160,7 +168,7 @@
 // Initialize all the keys to EmptyKey.
 const KeyT EmptyKey = getEmptyKey();
 for (unsigned i = 0; i != InitBuckets; ++i)
-  new (Buckets[i].Key) KeyT(EmptyKey);
+  new (Buckets[i].first) KeyT(EmptyKey);
   }
   
   void grow() {
@@ -174,23 +182,23 @@
 // Initialize all the keys to EmptyKey.
 const KeyT EmptyKey = getEmptyKey();
 for (unsigned i = 0, e = NumBuckets; i != e; ++i)
-  new (Buckets[i].Key) KeyT(EmptyKey);
+  new (Buckets[i].first) KeyT(EmptyKey);
 
 // Insert all the old elements.
 const KeyT TombstoneKey = getTombstoneKey();
 for (BucketT *B = OldBuckets, *E = OldBuckets+OldNumBuckets; B != E; ++B) {
-  if (B-Key != EmptyKey  B-Key != TombstoneKey) {
+  if (B-first != EmptyKey  B-first != TombstoneKey) {
 // Insert the key/value into the new table.
 BucketT *DestBucket;
-bool FoundVal = LookupBucketFor(B-Key, DestBucket);
+bool FoundVal = LookupBucketFor(B-first, DestBucket);
 assert(!FoundVal  Key already in new map?);
-DestBucket-Key = B-Key;
-new 

[llvm-commits] CVS: llvm/include/llvm/ADT/DenseMap.h

2007-02-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/ADT:

DenseMap.h updated: 1.12 - 1.13
---
Log message:

add find/erase, add const iterators, fix bugs in iterators.


---
Diffs of the changes:  (+67 -19)

 DenseMap.h |   86 +++--
 1 files changed, 67 insertions(+), 19 deletions(-)


Index: llvm/include/llvm/ADT/DenseMap.h
diff -u llvm/include/llvm/ADT/DenseMap.h:1.12 
llvm/include/llvm/ADT/DenseMap.h:1.13
--- llvm/include/llvm/ADT/DenseMap.h:1.12   Fri Feb  2 13:27:13 2007
+++ llvm/include/llvm/ADT/DenseMap.hFri Feb  2 14:34:32 2007
@@ -41,6 +41,8 @@
 
 templatetypename KeyT, typename ValueT
 class DenseMapIterator;
+templatetypename KeyT, typename ValueT
+class DenseMapConstIterator;
 
 templatetypename KeyT, typename ValueT
 class DenseMap {
@@ -65,10 +67,23 @@
   }
   
   typedef DenseMapIteratorKeyT, ValueT iterator;
-  typedef DenseMapIteratorKeyT, ValueT const_iterator;
-  inline iterator begin() const;
-  inline iterator end() const;
+  typedef DenseMapConstIteratorKeyT, ValueT const_iterator;
+  inline iterator begin() {
+ return DenseMapIteratorKeyT, ValueT(Buckets, Buckets+NumBuckets);
+  }
+  inline iterator end() {
+return DenseMapIteratorKeyT, ValueT(Buckets+NumBuckets, 
+  Buckets+NumBuckets);
+  }
+  inline const_iterator begin() const {
+return DenseMapConstIteratorKeyT, ValueT(Buckets, Buckets+NumBuckets);
+  }
+  inline const_iterator end() const {
+return DenseMapConstIteratorKeyT, ValueT(Buckets+NumBuckets, 
+   Buckets+NumBuckets);
+  }
   
+  bool empty() const { return NumEntries == 0; }
   unsigned size() const { return NumEntries; }
   
   void clear() {
@@ -89,6 +104,31 @@
 return LookupBucketFor(Val, TheBucket);
   }
   
+  iterator find(const KeyT Val) const {
+BucketT *TheBucket;
+if (LookupBucketFor(Val, TheBucket))
+  return iterator(TheBucket, Buckets+NumBuckets);
+return end();
+  }
+  
+  bool erase(const KeyT Val) {
+BucketT *TheBucket;
+if (!LookupBucketFor(Val, TheBucket))
+  return false; // not in map.
+
+TheBucket-second.~ValueT();
+TheBucket-first = getTombstoneKey();
+--NumEntries;
+return true;
+  }
+  bool erase(iterator I) {
+BucketT *TheBucket = *I;
+TheBucket-second.~ValueT();
+TheBucket-first = getTombstoneKey();
+--NumEntries;
+return true;
+  }
+  
   ValueT operator[](const KeyT Val) {
 BucketT *TheBucket;
 if (LookupBucketFor(Val, TheBucket))
@@ -106,11 +146,13 @@
   }
   
 private:
-  unsigned getHashValue(const KeyT Val) const {
+  static unsigned getHashValue(const KeyT Val) {
 return DenseMapKeyInfoKeyT::getHashValue(Val);
   }
-  const KeyT getEmptyKey() const { return 
DenseMapKeyInfoKeyT::getEmptyKey();}
-  const KeyT getTombstoneKey() const {
+  static const KeyT getEmptyKey() {
+return DenseMapKeyInfoKeyT::getEmptyKey();
+  }
+  static const KeyT getTombstoneKey() {
 return DenseMapKeyInfoKeyT::getTombstoneKey();
   }
   
@@ -209,17 +251,18 @@
 templatetypename KeyT, typename ValueT
 class DenseMapIterator {
   typedef std::pairKeyT, ValueT BucketT;
+protected:
   const BucketT *Ptr, *End;
 public:
   DenseMapIterator(const BucketT *Pos, const BucketT *E) : Ptr(Pos), End(E) {
 AdvancePastEmptyBuckets();
   }
   
-  const std::pairKeyT, ValueT operator*() const {
-return *Ptr;
+  std::pairKeyT, ValueT operator*() const {
+return *const_castBucketT*(Ptr);
   }
-  const std::pairKeyT, ValueT *operator-() const {
-return Ptr;
+  std::pairKeyT, ValueT *operator-() const {
+return const_castBucketT*(Ptr);
   }
   
   bool operator==(const DenseMapIterator RHS) const {
@@ -243,20 +286,25 @@
 const KeyT Empty = DenseMapKeyInfoKeyT::getEmptyKey();
 const KeyT Tombstone = DenseMapKeyInfoKeyT::getTombstoneKey();
 
-while (Ptr != End  Ptr-first != Empty  Ptr-first != Tombstone)
+while (Ptr != End  (Ptr-first == Empty || Ptr-first == Tombstone))
   ++Ptr;
   }
 };
 
-
-templatetypename KeyT, typename ValueT
-inline DenseMapIteratorKeyT, ValueT DenseMapKeyT, ValueT::begin() const {
-  return DenseMapIteratorKeyT, ValueT(Buckets, Buckets+NumBuckets);
-}
 templatetypename KeyT, typename ValueT
-inline DenseMapIteratorKeyT, ValueT DenseMapKeyT, ValueT::end() const {
-  return DenseMapIteratorKeyT, ValueT(Buckets+NumBuckets, 
Buckets+NumBuckets);
-}
+class DenseMapConstIterator : public DenseMapIteratorKeyT, ValueT {
+public:
+  DenseMapConstIterator(const std::pairKeyT, ValueT *Pos,
+const std::pairKeyT, ValueT *E)
+: DenseMapIteratorKeyT, ValueT(Pos, E) {
+  }
+  const std::pairKeyT, ValueT operator*() const {
+return *this-Ptr;
+  }
+  const std::pairKeyT, ValueT *operator-() const {
+return this-Ptr;
+  }
+};
 
 } // end namespace llvm
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu

[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.156 - 1.157
---
Log message:

switch hash_map's over to DenseMap in SCCP.  This speeds up SCCP by 30% in
a release-assert build on kimwitu++.


---
Diffs of the changes:  (+21 -19)

 SCCP.cpp |   40 +---
 1 files changed, 21 insertions(+), 19 deletions(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.156 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.157
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.156   Thu Feb  1 20:16:22 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Feb  2 14:38:30 2007
@@ -33,7 +33,7 @@
 #include llvm/Support/CallSite.h
 #include llvm/Support/Debug.h
 #include llvm/Support/InstVisitor.h
-#include llvm/ADT/hash_map
+#include llvm/ADT/DenseMap.h
 #include llvm/ADT/SmallVector.h
 #include llvm/ADT/Statistic.h
 #include llvm/ADT/STLExtras.h
@@ -138,18 +138,18 @@
 ///
 class SCCPSolver : public InstVisitorSCCPSolver {
   std::setBasicBlock* BBExecutable;// The basic blocks that are 
executable
-  hash_mapValue*, LatticeVal ValueState;  // The state each value is in...
+  DenseMapValue*, LatticeVal ValueState;  // The state each value is in.
 
   /// GlobalValue - If we are tracking any values for the contents of a global
   /// variable, we keep a mapping from the constant accessor to the element of
   /// the global, to the currently known value.  If the value becomes
   /// overdefined, it's entry is simply removed from this map.
-  hash_mapGlobalVariable*, LatticeVal TrackedGlobals;
+  DenseMapGlobalVariable*, LatticeVal TrackedGlobals;
 
   /// TrackedFunctionRetVals - If we are tracking arguments into and the return
   /// value out of a function, it will have an entry in this map, indicating
   /// what the known return value for the function is.
-  hash_mapFunction*, LatticeVal TrackedFunctionRetVals;
+  DenseMapFunction*, LatticeVal TrackedFunctionRetVals;
 
   // The reason for two worklists is that overdefined is the lowest state
   // on the lattice, and moving things to overdefined as fast as possible
@@ -222,19 +222,19 @@
 
   /// getValueMapping - Once we have solved for constants, return the mapping 
of
   /// LLVM values to LatticeVals.
-  hash_mapValue*, LatticeVal getValueMapping() {
+  DenseMapValue*, LatticeVal getValueMapping() {
 return ValueState;
   }
 
   /// getTrackedFunctionRetVals - Get the inferred return value map.
   ///
-  const hash_mapFunction*, LatticeVal getTrackedFunctionRetVals() {
+  const DenseMapFunction*, LatticeVal getTrackedFunctionRetVals() {
 return TrackedFunctionRetVals;
   }
 
   /// getTrackedGlobals - Get and return the set of inferred initializers for
   /// global variables.
-  const hash_mapGlobalVariable*, LatticeVal getTrackedGlobals() {
+  const DenseMapGlobalVariable*, LatticeVal getTrackedGlobals() {
 return TrackedGlobals;
   }
 
@@ -303,14 +303,16 @@
   // Instruction object, then use this accessor to get its value from the map.
   //
   inline LatticeVal getValueState(Value *V) {
-hash_mapValue*, LatticeVal::iterator I = ValueState.find(V);
+DenseMapValue*, LatticeVal::iterator I = ValueState.find(V);
 if (I != ValueState.end()) return I-second;  // Common case, in the map
 
 if (Constant *C = dyn_castConstant(V)) {
   if (isaUndefValue(V)) {
 // Nothing to do, remain undefined.
   } else {
-ValueState[C].markConstant(C);  // Constants are constant
+LatticeVal LV = ValueState[C];
+LV.markConstant(C);  // Constants are constant
+return LV;
   }
 }
 // All others are underdefined by default...
@@ -610,7 +612,7 @@
   // If we are tracking the return value of this function, merge it in.
   Function *F = I.getParent()-getParent();
   if (F-hasInternalLinkage()  !TrackedFunctionRetVals.empty()) {
-hash_mapFunction*, LatticeVal::iterator TFRVI =
+DenseMapFunction*, LatticeVal::iterator TFRVI =
   TrackedFunctionRetVals.find(F);
 if (TFRVI != TrackedFunctionRetVals.end() 
 !TFRVI-second.isOverdefined()) {
@@ -991,7 +993,7 @@
   if (TrackedGlobals.empty() || !isaGlobalVariable(SI.getOperand(1)))
 return;
   GlobalVariable *GV = castGlobalVariable(SI.getOperand(1));
-  hash_mapGlobalVariable*, LatticeVal::iterator I = TrackedGlobals.find(GV);
+  DenseMapGlobalVariable*, LatticeVal::iterator I = TrackedGlobals.find(GV);
   if (I == TrackedGlobals.end() || I-second.isOverdefined()) return;
 
   // Get the value we are storing into the global.
@@ -1028,7 +1030,7 @@
 }
   } else if (!TrackedGlobals.empty()) {
 // If we are tracking this global, merge in the known value for it.
-hash_mapGlobalVariable*, LatticeVal::iterator It =
+DenseMapGlobalVariable*, LatticeVal::iterator It =
   TrackedGlobals.find(GV);
 if (It != TrackedGlobals.end()) {
   mergeInValue(IV, I, It-second);
@@ -1059,7 +1061,7 @@
 
   // If 

[llvm-commits] CVS: llvm/lib/Transforms/Scalar/SCCP.cpp

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.157 - 1.158
---
Log message:

eliminate a malloc/free for (almost) every GEP processed.  This speeds up 
IPSCCP 3.3% on kimwitu.


---
Diffs of the changes:  (+3 -2)

 SCCP.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.157 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.158
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.157   Fri Feb  2 14:38:30 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Feb  2 14:51:48 2007
@@ -968,7 +968,7 @@
   LatticeVal IV = ValueState[I];
   if (IV.isOverdefined()) return;
 
-  std::vectorConstant* Operands;
+  SmallVectorConstant*, 8 Operands;
   Operands.reserve(I.getNumOperands());
 
   for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
@@ -986,7 +986,8 @@
   Constant *Ptr = Operands[0];
   Operands.erase(Operands.begin());  // Erase the pointer from idx list...
 
-  markConstant(IV, I, ConstantExpr::getGetElementPtr(Ptr, Operands));
+  markConstant(IV, I, ConstantExpr::getGetElementPtr(Ptr, Operands[0],
+  Operands.size()));
 }
 
 void SCCPSolver::visitStoreInst(Instruction SI) {



___
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/SCCP.cpp

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.158 - 1.159
---
Log message:

Convert an std::set to SmallSet, this speeds up IPSCCP 17% on kimwitu.



---
Diffs of the changes:  (+5 -5)

 SCCP.cpp |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.158 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.159
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.158   Fri Feb  2 14:51:48 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Feb  2 14:57:39 2007
@@ -34,11 +34,11 @@
 #include llvm/Support/Debug.h
 #include llvm/Support/InstVisitor.h
 #include llvm/ADT/DenseMap.h
+#include llvm/ADT/SmallSet.h
 #include llvm/ADT/SmallVector.h
 #include llvm/ADT/Statistic.h
 #include llvm/ADT/STLExtras.h
 #include algorithm
-#include set
 using namespace llvm;
 
 STATISTIC(NumInstRemoved, Number of instructions removed);
@@ -137,7 +137,7 @@
 /// Constant Propagation.
 ///
 class SCCPSolver : public InstVisitorSCCPSolver {
-  std::setBasicBlock* BBExecutable;// The basic blocks that are 
executable
+  SmallSetBasicBlock*, 16 BBExecutable;// The basic blocks that are 
executable
   DenseMapValue*, LatticeVal ValueState;  // The state each value is in.
 
   /// GlobalValue - If we are tracking any values for the contents of a global
@@ -216,7 +216,7 @@
 
   /// getExecutableBlocks - Once we have solved for constants, return the set 
of
   /// blocks that is known to be executable.
-  std::setBasicBlock* getExecutableBlocks() {
+  SmallSetBasicBlock*, 16 getExecutableBlocks() {
 return BBExecutable;
   }
 
@@ -1384,7 +1384,7 @@
   // delete their contents now.  Note that we cannot actually delete the 
blocks,
   // as we cannot modify the CFG of the function.
   //
-  std::setBasicBlock* ExecutableBBs = Solver.getExecutableBlocks();
+  SmallSetBasicBlock*, 16 ExecutableBBs = Solver.getExecutableBlocks();
   for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
 if (!ExecutableBBs.count(BB)) {
   DOUTBasicBlock Dead:  *BB;
@@ -1523,7 +1523,7 @@
   // Iterate over all of the instructions in the module, replacing them with
   // constants if we have found them to be of constant values.
   //
-  std::setBasicBlock* ExecutableBBs = Solver.getExecutableBlocks();
+  SmallSetBasicBlock*, 16 ExecutableBBs = Solver.getExecutableBlocks();
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
 for (Function::arg_iterator AI = F-arg_begin(), E = F-arg_end();
  AI != E; ++AI)



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp

2007-02-02 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMRegisterInfo.cpp updated: 1.54 - 1.55
---
Log message:

Another thumb large stack offset codegen bug.

---
Diffs of the changes:  (+13 -5)

 ARMRegisterInfo.cpp |   18 +-
 1 files changed, 13 insertions(+), 5 deletions(-)


Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.54 
llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.55
--- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.54Fri Feb  2 02:58:48 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Fri Feb  2 15:08:39 2007
@@ -625,7 +625,6 @@
 Offset += MI.getOperand(i+1).getImm();
 assert((Offset  3) == 0 
Thumb add/sub sp, #imm immediate must be multiple of 4!);
-Offset = 2;
 if (Offset == 0) {
   // Turn it into a move.
   MI.setInstrDescriptor(TII.get(ARM::tMOVrr));
@@ -635,28 +634,37 @@
 }
 
 // Common case: small offset, fits into instruction.
-if ((Offset  ~255U) == 0) {
+if (((Offset  2)  ~255U) == 0) {
   // Replace the FrameIndex with sp / fp
   MI.getOperand(i).ChangeToRegister(FrameReg, false);
-  MI.getOperand(i+1).ChangeToImmediate(Offset);
+  MI.getOperand(i+1).ChangeToImmediate(Offset  2);
   return;
 }
 
 unsigned DestReg = MI.getOperand(0).getReg();
+unsigned Bytes = (Offset  0) ? Offset : -Offset;
+unsigned NumMIs = calcNumMI(Opcode, 0, Bytes, 8, 1);
+// MI would expand into a large number of instructions. Don't try to
+// simplify the immediate.
+if (NumMIs  2) {
+  emitThumbRegPlusImmediate(MBB, II, DestReg, ARM::SP, Offset, TII);
+  MBB.erase(II);
+  return;
+}
+
 if (Offset  0) {
   // Translate r0 = add sp, imm to
   // r0 = add sp, 255*4
   // r0 = add r0, (imm - 255*4)
   MI.getOperand(i).ChangeToRegister(FrameReg, false);
   MI.getOperand(i+1).ChangeToImmediate(255);
-  Offset = (Offset - 255)  2;
+  Offset = (Offset - 255 * 4);
   MachineBasicBlock::iterator NII = next(II);
   emitThumbRegPlusImmediate(MBB, NII, DestReg, DestReg, Offset, TII);
 } else {
   // Translate r0 = add sp, -imm to
   // r0 = -imm (this is then translated into a series of instructons)
   // r0 = add r0, sp
-  Offset = 2;
   emitThumbConstant(MBB, II, DestReg, Offset, TII);
   MI.setInstrDescriptor(TII.get(ARM::tADDhirr));
   MI.getOperand(i).ChangeToRegister(DestReg, false);



___
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/SCCP.cpp

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.159 - 1.160
---
Log message:

Remove more malloc thrashing, this speeds up IPSCCP on kimwitu another 6.7%.


---
Diffs of the changes:  (+10 -10)

 SCCP.cpp |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.159 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.160
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.159   Fri Feb  2 14:57:39 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Feb  2 15:15:06 2007
@@ -344,7 +344,7 @@
   // getFeasibleSuccessors - Return a vector of booleans to indicate which
   // successors are reachable from a given terminator instruction.
   //
-  void getFeasibleSuccessors(TerminatorInst TI, std::vectorbool Succs);
+  void getFeasibleSuccessors(TerminatorInst TI, SmallVectorbool, 16 Succs);
 
   // isEdgeFeasible - Return true if the control flow edge from the 'From' 
basic
   // block to the 'To' basic block is currently feasible...
@@ -411,7 +411,7 @@
 // successors are reachable from a given terminator instruction.
 //
 void SCCPSolver::getFeasibleSuccessors(TerminatorInst TI,
-   std::vectorbool Succs) {
+   SmallVectorbool, 16 Succs) {
   Succs.resize(TI.getNumSuccessors());
   if (BranchInst *BI = dyn_castBranchInst(TI)) {
 if (BI-isUnconditional()) {
@@ -452,8 +452,7 @@
   Succs[0] = true;
 }
   } else {
-cerr  SCCP: Don't know how to handle:   TI;
-Succs.assign(TI.getNumSuccessors(), true);
+assert(0  SCCP: Don't know how to handle this terminator!);
   }
 }
 
@@ -543,8 +542,7 @@
 std::multimapPHINode*, Instruction*::iterator I, E;
 tie(I, E) = UsersOfOverdefinedPHIs.equal_range(PN);
 if (I != E) {
-  std::vectorInstruction* Users;
-  Users.reserve(std::distance(I, E));
+  SmallVectorInstruction*, 16 Users;
   for (; I != E; ++I) Users.push_back(I-second);
   while (!Users.empty()) {
 visit(Users.back());
@@ -624,7 +622,7 @@
 
 
 void SCCPSolver::visitTerminatorInst(TerminatorInst TI) {
-  std::vectorbool SuccFeasible;
+  SmallVectorbool, 16 SuccFeasible;
   getFeasibleSuccessors(TI, SuccFeasible);
 
   BasicBlock *BB = TI.getParent();
@@ -1385,6 +1383,7 @@
   // as we cannot modify the CFG of the function.
   //
   SmallSetBasicBlock*, 16 ExecutableBBs = Solver.getExecutableBlocks();
+  SmallVectorInstruction*, 32 Insts;
   for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
 if (!ExecutableBBs.count(BB)) {
   DOUTBasicBlock Dead:  *BB;
@@ -1392,7 +1391,6 @@
 
   // Delete the instructions backwards, as it has a reduced likelihood of
   // having to update as many def-use and use-def chains.
-  std::vectorInstruction* Insts;
   for (BasicBlock::iterator I = BB-begin(), E = BB-getTerminator();
I != E; ++I)
 Insts.push_back(I);
@@ -1524,6 +1522,9 @@
   // constants if we have found them to be of constant values.
   //
   SmallSetBasicBlock*, 16 ExecutableBBs = Solver.getExecutableBlocks();
+  SmallVectorInstruction*, 32 Insts;
+  SmallVectorBasicBlock*, 32 BlocksToErase;
+
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F) {
 for (Function::arg_iterator AI = F-arg_begin(), E = F-arg_end();
  AI != E; ++AI)
@@ -1541,7 +1542,6 @@
 }
   }
 
-std::vectorBasicBlock* BlocksToErase;
 for (Function::iterator BB = F-begin(), E = F-end(); BB != E; ++BB)
   if (!ExecutableBBs.count(BB)) {
 DOUTBasicBlock Dead:  *BB;
@@ -1549,7 +1549,6 @@
 
 // Delete the instructions backwards, as it has a reduced likelihood of
 // having to update as many def-use and use-def chains.
-std::vectorInstruction* Insts;
 TerminatorInst *TI = BB-getTerminator();
 for (BasicBlock::iterator I = BB-begin(), E = TI; I != E; ++I)
   Insts.push_back(I);
@@ -1643,6 +1642,7 @@
   // Finally, delete the basic block.
   F-getBasicBlockList().erase(DeadBB);
 }
+BlocksToErase.clear();
   }
 
   // If we inferred constant or undef return values for a function, we replaced



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/ADT/DenseMap.h

2007-02-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/ADT:

DenseMap.h updated: 1.13 - 1.14
---
Log message:

silence annoying warning in release-asserts build


---
Diffs of the changes:  (+1 -0)

 DenseMap.h |1 +
 1 files changed, 1 insertion(+)


Index: llvm/include/llvm/ADT/DenseMap.h
diff -u llvm/include/llvm/ADT/DenseMap.h:1.13 
llvm/include/llvm/ADT/DenseMap.h:1.14
--- llvm/include/llvm/ADT/DenseMap.h:1.13   Fri Feb  2 14:34:32 2007
+++ llvm/include/llvm/ADT/DenseMap.hFri Feb  2 15:19:18 2007
@@ -233,6 +233,7 @@
 // Insert the key/value into the new table.
 BucketT *DestBucket;
 bool FoundVal = LookupBucketFor(B-first, DestBucket);
+FoundVal = FoundVal; // silence warning.
 assert(!FoundVal  Key already in new map?);
 DestBucket-first = B-first;
 new (DestBucket-second) ValueT(B-second);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/tools/gccas/gccas.sh

2007-02-02 Thread Reid Spencer


Changes in directory llvm/tools/gccas:

gccas.sh updated: 1.1 - 1.2
---
Log message:

Two improvements:
1. Allow -- as well as - options (Bill Wendling)
2. Pass unrecognized options to opt and let it handle the errors, if any
   (Chris Lattner).


---
Diffs of the changes:  (+2 -2)

 gccas.sh |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/tools/gccas/gccas.sh
diff -u llvm/tools/gccas/gccas.sh:1.1 llvm/tools/gccas/gccas.sh:1.2
--- llvm/tools/gccas/gccas.sh:1.1   Fri Feb  2 09:50:58 2007
+++ llvm/tools/gccas/gccas.sh   Fri Feb  2 15:49:27 2007
@@ -23,6 +23,7 @@
 ASOPTS=
 lastwasdasho=0
 for option in $@ ; do
+  option=`echo $option | sed 's/^--/-/'`
   case $option in
 -disable-opt)
OPTOPTS=$OPTOPTS $option
@@ -47,8 +48,7 @@
# ignore
;;
 -*)
-   echo gccas: Unrecognized option '$option'
-   exit 1
+   OPTOPTS=$OPTOPTS $option
;;
 *)
if test $lastwasdasho -eq 1 ; then



___
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/SCCP.cpp

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Scalar:

SCCP.cpp updated: 1.160 - 1.161
---
Log message:

Switch this back to using an std::map.  DenseMap entries are getting invalidated


---
Diffs of the changes:  (+5 -5)

 SCCP.cpp |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


Index: llvm/lib/Transforms/Scalar/SCCP.cpp
diff -u llvm/lib/Transforms/Scalar/SCCP.cpp:1.160 
llvm/lib/Transforms/Scalar/SCCP.cpp:1.161
--- llvm/lib/Transforms/Scalar/SCCP.cpp:1.160   Fri Feb  2 15:15:06 2007
+++ llvm/lib/Transforms/Scalar/SCCP.cpp Fri Feb  2 16:36:16 2007
@@ -138,7 +138,7 @@
 ///
 class SCCPSolver : public InstVisitorSCCPSolver {
   SmallSetBasicBlock*, 16 BBExecutable;// The basic blocks that are 
executable
-  DenseMapValue*, LatticeVal ValueState;  // The state each value is in.
+  std::mapValue*, LatticeVal ValueState;  // The state each value is in.
 
   /// GlobalValue - If we are tracking any values for the contents of a global
   /// variable, we keep a mapping from the constant accessor to the element of
@@ -222,7 +222,7 @@
 
   /// getValueMapping - Once we have solved for constants, return the mapping 
of
   /// LLVM values to LatticeVals.
-  DenseMapValue*, LatticeVal getValueMapping() {
+  std::mapValue*, LatticeVal getValueMapping() {
 return ValueState;
   }
 
@@ -303,7 +303,7 @@
   // Instruction object, then use this accessor to get its value from the map.
   //
   inline LatticeVal getValueState(Value *V) {
-DenseMapValue*, LatticeVal::iterator I = ValueState.find(V);
+std::mapValue*, LatticeVal::iterator I = ValueState.find(V);
 if (I != ValueState.end()) return I-second;  // Common case, in the map
 
 if (Constant *C = dyn_castConstant(V)) {
@@ -1364,7 +1364,7 @@
   Solver.MarkBlockExecutable(F.begin());
 
   // Mark all arguments to the function as being overdefined.
-  DenseMapValue*, LatticeVal Values = Solver.getValueMapping();
+  std::mapValue*, LatticeVal Values = Solver.getValueMapping();
   for (Function::arg_iterator AI = F.arg_begin(), E = F.arg_end(); AI != E; 
++AI)
 Values[AI].markOverdefined();
 
@@ -1485,7 +1485,7 @@
   // Loop over all functions, marking arguments to those with their addresses
   // taken or that are external as overdefined.
   //
-  DenseMapValue*, LatticeVal Values = Solver.getValueMapping();
+  std::mapValue*, LatticeVal Values = Solver.getValueMapping();
   for (Module::iterator F = M.begin(), E = M.end(); F != E; ++F)
 if (!F-hasInternalLinkage() || AddressIsTaken(F)) {
   if (!F-isDeclaration())



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/pubs/2005-07-IDEAS-PerfEstimation.html 2005-07-IDEAS-PerfEstimation.pdf index.html

2007-02-02 Thread Chris Lattner


Changes in directory llvm-www/pubs:

2005-07-IDEAS-PerfEstimation.html added (r1.1)
2005-07-IDEAS-PerfEstimation.pdf added (r1.1)
index.html updated: 1.42 - 1.43
---
Log message:

add a new paper



---
Diffs of the changes:  (+47 -0)

 2005-07-IDEAS-PerfEstimation.html |   41 ++
 2005-07-IDEAS-PerfEstimation.pdf  |0 
 index.html|6 +
 3 files changed, 47 insertions(+)


Index: llvm-www/pubs/2005-07-IDEAS-PerfEstimation.html
diff -c /dev/null llvm-www/pubs/2005-07-IDEAS-PerfEstimation.html:1.1
*** /dev/null   Fri Feb  2 16:59:52 2007
--- llvm-www/pubs/2005-07-IDEAS-PerfEstimation.html Fri Feb  2 16:59:42 2007
***
*** 0 
--- 1,41 
+ !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
+ html
+ head
+   meta http-equiv=Content-Type content=text/html; charset=UTF-8 /
+   link rel=stylesheet href=../llvm.css type=text/css media=screen /
+   titlePractical Techniques for Performance Estimation of Processors/title
+ /head
+ body
+ 
+ div class=pub_title
+   Practical Techniques for Performance Estimation of Processors
+ /div
+ div class=pub_author
+   Abhijit Ray, Thambipillai Srikanthan and Wu Jigang 
+ /div
+ 
+ h2Abstract:/h2
+ blockquote
+ Performance estimation of processor is important to select the right 
processor for an application. Poorly chosen processors can either under perform 
very badly or over 
+ perform but with high cost. Most previous work on performance estimation are 
based on generating the development tools, i.e., compilers, assemblers etc from 
a processor 
+ description file and then additionally generating an instruction set 
simulator to get the performance. In this work we 
+ present a simpler strategy for performance estimation. We 
+ propose an estimation technique based on the intermediate format of an 
application. The estimation process does 
+ not require the generation of all the development tools as in 
+ the prevalent methods. As a result our method is not only 
+ cheaper but also faster.
+ /blockquote
+ 
+ h2Published:/h2
+ blockquote
+   Practical Techniques for Performance Estimation of Processors, Abhijit 
Ray, Thambipillai Srikanthan and Wu Jigang.br
+   Proceedings of the 9th International Database Engineering amp; Application 
Symposium (IDEAS'05), July 2005. 
+ /blockquote
+ 
+ h2Download:/h2
+ ul
+   lia href=2005-07-IDEAS-PerfEstimation.pdfPractical Techniques for 
Performance Estimation of Processors/a (PDF)/li
+ /ul
+ 
+ /body
+ /html


Index: llvm-www/pubs/2005-07-IDEAS-PerfEstimation.pdf


Index: llvm-www/pubs/index.html
diff -u llvm-www/pubs/index.html:1.42 llvm-www/pubs/index.html:1.43
--- llvm-www/pubs/index.html:1.42   Tue Jun 20 13:22:01 2006
+++ llvm-www/pubs/index.htmlFri Feb  2 16:59:42 2007
@@ -46,6 +46,12 @@
 Performance Libraries/abr
   By C. Alias and D. Barthoubr
   iProc. of the International IEEE Euro-Par Conference/i, August, 2005/li
+
+lia href=2005-07-IDEAS-PerfEstimation.pdfPractical Techniques for 
Performance Estimation of Processors/abr
+ Abhijit Ray, Thambipillai Srikanthan and Wu Jigang.br
+  Proceedings of the 9th International Database Engineering amp; Application 
Sy
+mposium (IDEAS'05), July 2005. /li
+
   
 lia href=2005-06-17-LattnerMSThesis.htmlAn Implementation of Swing 
Modulo Scheduling with Extensions for Superblocks/abr
 Tanya M. Lattner.br iM.S. Thesis/i, Computer Science Dept., University 
of Illinois at



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-www/pubs/index.html

2007-02-02 Thread Chris Lattner


Changes in directory llvm-www/pubs:

index.html updated: 1.43 - 1.44
---
Log message:

fix link



---
Diffs of the changes:  (+1 -1)

 index.html |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-www/pubs/index.html
diff -u llvm-www/pubs/index.html:1.43 llvm-www/pubs/index.html:1.44
--- llvm-www/pubs/index.html:1.43   Fri Feb  2 16:59:42 2007
+++ llvm-www/pubs/index.htmlFri Feb  2 17:00:07 2007
@@ -47,7 +47,7 @@
   By C. Alias and D. Barthoubr
   iProc. of the International IEEE Euro-Par Conference/i, August, 2005/li
 
-lia href=2005-07-IDEAS-PerfEstimation.pdfPractical Techniques for 
Performance Estimation of Processors/abr
+lia href=2005-07-IDEAS-PerfEstimation.htmlPractical Techniques for 
Performance Estimation of Processors/abr
  Abhijit Ray, Thambipillai Srikanthan and Wu Jigang.br
   Proceedings of the 9th International Database Engineering amp; Application 
Sy
 mposium (IDEAS'05), July 2005. /li



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMRegisterInfo.cpp

2007-02-02 Thread Lauro Ramos Venancio


Changes in directory llvm/lib/Target/ARM:

ARMRegisterInfo.cpp updated: 1.55 - 1.56
---
Log message:

bugfix: SP isn't resetted when function has FP and there is no spills.


---
Diffs of the changes:  (+3 -2)

 ARMRegisterInfo.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/ARM/ARMRegisterInfo.cpp
diff -u llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.55 
llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.56
--- llvm/lib/Target/ARM/ARMRegisterInfo.cpp:1.55Fri Feb  2 15:08:39 2007
+++ llvm/lib/Target/ARM/ARMRegisterInfo.cpp Fri Feb  2 17:08:40 2007
@@ -1140,10 +1140,11 @@
 if (STI.isTargetDarwin() || hasFP(MF)) {
   NumBytes = AFI-getFramePtrSpillOffset() - NumBytes;
   // Reset SP based on frame pointer only if the stack frame extends beyond
-  // frame pointer stack slot.
+  // frame pointer stack slot or target is ELF and the function has FP.
   if (AFI-getGPRCalleeSavedArea2Size() ||
   AFI-getDPRCalleeSavedAreaSize()  ||
-  AFI-getDPRCalleeSavedAreaOffset())
+  AFI-getDPRCalleeSavedAreaOffset()||
+  hasFP(MF))
 if (NumBytes)
   BuildMI(MBB, MBBI, TII.get(ARM::SUBri), ARM::SP).addReg(FramePtr)
 .addImm(NumBytes);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Transforms/Utils/Cloning.h

2007-02-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/Transforms/Utils:

Cloning.h updated: 1.21 - 1.22
---
Log message:

Switch inliner over to use DenseMap instead of std::map for ValueMap.  This
speeds up the inliner 16%.


---
Diffs of the changes:  (+8 -8)

 Cloning.h |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)


Index: llvm/include/llvm/Transforms/Utils/Cloning.h
diff -u llvm/include/llvm/Transforms/Utils/Cloning.h:1.21 
llvm/include/llvm/Transforms/Utils/Cloning.h:1.22
--- llvm/include/llvm/Transforms/Utils/Cloning.h:1.21   Tue Jan 30 17:22:39 2007
+++ llvm/include/llvm/Transforms/Utils/Cloning.hFri Feb  2 18:07:40 2007
@@ -19,7 +19,7 @@
 #define LLVM_TRANSFORMS_UTILS_CLONING_H
 
 #include vector
-#include map
+#include llvm/ADT/DenseMap.h
 
 namespace llvm {
 
@@ -38,7 +38,7 @@
 /// CloneModule - Return an exact copy of the specified module
 ///
 Module *CloneModule(const Module *M);
-Module *CloneModule(const Module *M, std::mapconst Value*, Value* ValueMap);
+Module *CloneModule(const Module *M, DenseMapconst Value*, Value* ValueMap);
 
 /// ClonedCodeInfo - This struct can be used to capture information about code
 /// being cloned, while it is being cloned.
@@ -94,7 +94,7 @@
 /// parameter.
 ///
 BasicBlock *CloneBasicBlock(const BasicBlock *BB,
-std::mapconst Value*, Value* ValueMap,
+DenseMapconst Value*, Value* ValueMap,
 const char *NameSuffix = , Function *F = 0,
 ClonedCodeInfo *CodeInfo = 0);
 
@@ -109,13 +109,13 @@
 /// information about the cloned code if non-null.
 ///
 Function *CloneFunction(const Function *F,
-std::mapconst Value*, Value* ValueMap,
+DenseMapconst Value*, Value* ValueMap,
 ClonedCodeInfo *CodeInfo = 0);
 
 /// CloneFunction - Version of the function that doesn't need the ValueMap.
 ///
 inline Function *CloneFunction(const Function *F, ClonedCodeInfo *CodeInfo = 
0){
-  std::mapconst Value*, Value* ValueMap;
+  DenseMapconst Value*, Value* ValueMap;
   return CloneFunction(F, ValueMap, CodeInfo);
 }
 
@@ -126,7 +126,7 @@
 /// specified suffix to all values cloned.
 ///
 void CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
-   std::mapconst Value*, Value* ValueMap,
+   DenseMapconst Value*, Value* ValueMap,
std::vectorReturnInst* Returns,
const char *NameSuffix = , 
ClonedCodeInfo *CodeInfo = 0);
@@ -139,7 +139,7 @@
 /// dead.  Since this doesn't produce an exactly copy of the input, it can't be
 /// used for things like CloneFunction or CloneModule.
 void CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
-   std::mapconst Value*, Value* ValueMap,
+   DenseMapconst Value*, Value* ValueMap,
std::vectorReturnInst* Returns,
const char *NameSuffix = , 
ClonedCodeInfo *CodeInfo = 0,
@@ -150,7 +150,7 @@
 /// saved in ValueMap.
 ///
 void CloneTraceInto(Function *NewFunc, Trace T,
-std::mapconst Value*, Value* ValueMap,
+DenseMapconst Value*, Value* ValueMap,
 const char *NameSuffix);
 
 /// CloneTrace - Returns a copy of the specified trace.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Transforms/Utils/CloneFunction.cpp CloneModule.cpp CloneTrace.cpp InlineFunction.cpp ValueMapper.cpp ValueMapper.h

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/Transforms/Utils:

CloneFunction.cpp updated: 1.40 - 1.41
CloneModule.cpp updated: 1.21 - 1.22
CloneTrace.cpp updated: 1.11 - 1.12
InlineFunction.cpp updated: 1.51 - 1.52
ValueMapper.cpp updated: 1.28 - 1.29
ValueMapper.h updated: 1.6 - 1.7
---
Log message:

Switch inliner over to use DenseMap instead of std::map for ValueMap.  This
speeds up the inliner 16%.



---
Diffs of the changes:  (+28 -25)

 CloneFunction.cpp  |   13 +++--
 CloneModule.cpp|6 +++---
 CloneTrace.cpp |4 ++--
 InlineFunction.cpp |6 +++---
 ValueMapper.cpp|   20 +++-
 ValueMapper.h  |4 ++--
 6 files changed, 28 insertions(+), 25 deletions(-)


Index: llvm/lib/Transforms/Utils/CloneFunction.cpp
diff -u llvm/lib/Transforms/Utils/CloneFunction.cpp:1.40 
llvm/lib/Transforms/Utils/CloneFunction.cpp:1.41
--- llvm/lib/Transforms/Utils/CloneFunction.cpp:1.40Thu Feb  1 12:48:38 2007
+++ llvm/lib/Transforms/Utils/CloneFunction.cpp Fri Feb  2 18:08:31 2007
@@ -22,11 +22,12 @@
 #include ValueMapper.h
 #include llvm/Analysis/ConstantFolding.h
 #include llvm/ADT/SmallVector.h
+#include map
 using namespace llvm;
 
 // CloneBasicBlock - See comments in Cloning.h
 BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB,
-  std::mapconst Value*, Value* ValueMap,
+  DenseMapconst Value*, Value* ValueMap,
   const char *NameSuffix, Function *F,
   ClonedCodeInfo *CodeInfo) {
   BasicBlock *NewBB = new BasicBlock(, F);
@@ -66,7 +67,7 @@
 // ArgMap values.
 //
 void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
- std::mapconst Value*, Value* ValueMap,
+ DenseMapconst Value*, Value* ValueMap,
  std::vectorReturnInst* Returns,
  const char *NameSuffix, ClonedCodeInfo *CodeInfo) 
{
   assert(NameSuffix  NameSuffix cannot be null!);
@@ -113,7 +114,7 @@
 /// the function from their old to new values.
 ///
 Function *llvm::CloneFunction(const Function *F,
-  std::mapconst Value*, Value* ValueMap,
+  DenseMapconst Value*, Value* ValueMap,
   ClonedCodeInfo *CodeInfo) {
   std::vectorconst Type* ArgTypes;
 
@@ -154,7 +155,7 @@
   struct PruningFunctionCloner {
 Function *NewFunc;
 const Function *OldFunc;
-std::mapconst Value*, Value* ValueMap;
+DenseMapconst Value*, Value* ValueMap;
 std::vectorReturnInst* Returns;
 const char *NameSuffix;
 ClonedCodeInfo *CodeInfo;
@@ -162,7 +163,7 @@
 
   public:
 PruningFunctionCloner(Function *newFunc, const Function *oldFunc,
-  std::mapconst Value*, Value* valueMap,
+  DenseMapconst Value*, Value* valueMap,
   std::vectorReturnInst* returns,
   const char *nameSuffix, 
   ClonedCodeInfo *codeInfo,
@@ -303,7 +304,7 @@
 /// dead.  Since this doesn't produce an exactly copy of the input, it can't be
 /// used for things like CloneFunction or CloneModule.
 void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function 
*OldFunc,
- std::mapconst Value*, Value* ValueMap,
+ DenseMapconst Value*, Value* ValueMap,
  std::vectorReturnInst* Returns,
  const char *NameSuffix, 
  ClonedCodeInfo *CodeInfo,


Index: llvm/lib/Transforms/Utils/CloneModule.cpp
diff -u llvm/lib/Transforms/Utils/CloneModule.cpp:1.21 
llvm/lib/Transforms/Utils/CloneModule.cpp:1.22
--- llvm/lib/Transforms/Utils/CloneModule.cpp:1.21  Tue Jan 30 14:08:38 2007
+++ llvm/lib/Transforms/Utils/CloneModule.cpp   Fri Feb  2 18:08:31 2007
@@ -29,12 +29,12 @@
 Module *llvm::CloneModule(const Module *M) {
   // Create the value map that maps things from the old module over to the new
   // module.
-  std::mapconst Value*, Value* ValueMap;
-
+  DenseMapconst Value*, Value* ValueMap;
   return CloneModule(M, ValueMap);
 }
 
-Module *llvm::CloneModule(const Module *M, std::mapconst Value*, Value* 
ValueMap) {
+Module *llvm::CloneModule(const Module *M,
+  DenseMapconst Value*, Value* ValueMap) {
   // First off, we need to create the new module...
   Module *New = new Module(M-getModuleIdentifier());
   New-setDataLayout(M-getDataLayout());


Index: llvm/lib/Transforms/Utils/CloneTrace.cpp
diff -u llvm/lib/Transforms/Utils/CloneTrace.cpp:1.11 
llvm/lib/Transforms/Utils/CloneTrace.cpp:1.12
--- llvm/lib/Transforms/Utils/CloneTrace.cpp:1.11   Sat Apr 23 16:38:35 2005
+++ llvm/lib/Transforms/Utils/CloneTrace.cppFri Feb  2 18:08:31 2007
@@ -26,7 +26,7 @@
 std::vectorBasicBlock *
 

[llvm-commits] CVS: llvm/test/CodeGen/ARM/alloca.ll

2007-02-02 Thread Lauro Ramos Venancio


Changes in directory llvm/test/CodeGen/ARM:

alloca.ll updated: 1.4 - 1.5
---
Log message:

Improves alloca test. Verifies SP restoration.


---
Diffs of the changes:  (+4 -1)

 alloca.ll |5 -
 1 files changed, 4 insertions(+), 1 deletion(-)


Index: llvm/test/CodeGen/ARM/alloca.ll
diff -u llvm/test/CodeGen/ARM/alloca.ll:1.4 llvm/test/CodeGen/ARM/alloca.ll:1.5
--- llvm/test/CodeGen/ARM/alloca.ll:1.4 Fri Dec  1 22:23:08 2006
+++ llvm/test/CodeGen/ARM/alloca.ll Fri Feb  2 18:16:21 2007
@@ -1,4 +1,7 @@
-; RUN: llvm-upgrade  %s | llvm-as | llc -march=arm
+; RUN: llvm-upgrade  %s | llvm-as | llc -march=arm 
+; RUN: llvm-upgrade  %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | 
grep mov r11, sp 
+; RUN: llvm-upgrade  %s | llvm-as | llc -march=arm -mtriple=arm-linux-gnu | 
grep mov sp, r11
+
 void %f(uint %a) {
 entry:
%tmp = alloca sbyte, uint %a



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [PATCH] Write llvm byte code into PCH while creating PCH

2007-02-02 Thread Devang Patel
I checked in following patch today. First step as part of GCC PCH  
integration work.

-
Devang

Index: gcc/toplev.c
===
--- gcc/toplev.c(revision 123268)
+++ gcc/toplev.c(working copy)
@@ -1163,7 +1163,8 @@ compile_file (void)
#ifndef ENABLE_LLVM
targetm.asm_out.file_end ();
#else
-  llvm_asm_file_end();
+  if (!flag_pch_file)
+llvm_asm_file_end();
#endif
/* APPLE LOCAL end LLVM */
}
@@ -1563,7 +1564,10 @@ init_asm_output (const char *name)
#ifndef ENABLE_LLVM
targetm.asm_out.file_start ();
#else
-  llvm_asm_file_start();
+  if (flag_pch_file)
+llvm_pch_write_init();
+  else
+llvm_asm_file_start();
#endif
/* APPLE LOCAL end LLVM */
Index: gcc/llvm.h
===
--- gcc/llvm.h  (revision 123268)
+++ gcc/llvm.h  (working copy)
@@ -80,6 +80,9 @@ void llvm_emit_typedef(union tree_node*)
   */
void print_llvm(FILE *file, void *LLVM);
+/* Init pch writing. */
+void llvm_pch_write_init(void);
+
/* llvm_asm_file_start - Start the .s file. */
void llvm_asm_file_start(void);
Index: gcc/cp/decl2.c
===
--- gcc/cp/decl2.c  (revision 123268)
+++ gcc/cp/decl2.c  (working copy)
@@ -2846,8 +2846,12 @@ cp_finish_file (void)
if (! global_bindings_p () || current_class_type ||  
decl_namespace_list)
  return;
-  if (pch_file)
+  /* APPLE LOCAL begin LLVM */
+  if (pch_file) {
  c_common_write_pch ();
+return;
+  }
+  /* APPLE LOCAL end LLVM */
#ifdef USE_MAPPED_LOCATION
/* FIXME - huh? */
Index: gcc/llvm-backend.cpp
===
--- gcc/llvm-backend.cpp(revision 123268)
+++ gcc/llvm-backend.cpp(working copy)
@@ -183,6 +183,26 @@ void llvm_lang_dependent_init(const char
oFILEstream *AsmOutStream = 0;
+// Initialize PCH writing.
+void llvm_pch_write_init(void) {
+  timevar_push(TV_LLVM_INIT);
+  AsmOutStream = new oFILEstream(asm_out_file);
+  AsmOutFile = new OStream(*AsmOutStream);
+
+  PerModulePasses = new PassManager();
+  PerModulePasses-add(new TargetData(*TheTarget-getTargetData()));
+
+  // Emit an LLVM .bc file to the output.  This is used when passed
+  // -emit-llvm -c to the GCC driver.
+  PerModulePasses-add(new WriteBytecodePass(AsmOutFile));
+
+  // Disable emission of .ident into the output file... which is  
completely
+  // wrong for llvm/.bc emission cases.
+  flag_no_ident = 1;
+
+  timevar_pop(TV_LLVM_INIT);
+}
+
// llvm_asm_file_start - Start the .s file.
void llvm_asm_file_start(void) {
timevar_push(TV_LLVM_INIT);
Index: gcc/c-pch.c
===
--- gcc/c-pch.c (revision 123268)
+++ gcc/c-pch.c (working copy)
@@ -193,6 +193,11 @@ c_common_write_pch (void)
long written;
struct c_pch_header h;
+  /* APPLE LOCAL begin LLVM */
+#ifdef ENABLE_LLVM
+  llvm_asm_file_end();
+#endif
+  /* APPLE LOCAL end LLVM */
(*debug_hooks-handle_pch) (1);
cpp_write_pch_deps (parse_in, pch_outfile);

___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/CommandGuide/opt.pod

2007-02-02 Thread Reid Spencer


Changes in directory llvm/docs/CommandGuide:

opt.pod updated: 1.5 - 1.6
---
Log message:

Format the examples correctly.


---
Diffs of the changes:  (+2 -6)

 opt.pod |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)


Index: llvm/docs/CommandGuide/opt.pod
diff -u llvm/docs/CommandGuide/opt.pod:1.5 llvm/docs/CommandGuide/opt.pod:1.6
--- llvm/docs/CommandGuide/opt.pod:1.5  Fri Feb  2 18:21:56 2007
+++ llvm/docs/CommandGuide/opt.pod  Fri Feb  2 18:32:23 2007
@@ -67,7 +67,7 @@
 
 =over
 
-Bllvm-as  /dev/null | opt -std-compile-opts -disable-output 
-debug-pass=Arguments
+   llvm-as  /dev/null | opt -std-compile-opts -disable-output 
-debug-pass=Arguments
 
 =back
 
@@ -122,11 +122,7 @@
 enable various optimizations or analyses.  To see the new complete list of 
 optimizations, use the B-help and B-load options together. For example:
 
-=over
-
-Bopt -load=Iplugin B-help
-
-=back
+   opt -load=plugin.so -help
 
 =item B-p
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/CommandGuide/opt.pod

2007-02-02 Thread Reid Spencer


Changes in directory llvm/docs/CommandGuide:

opt.pod updated: 1.6 - 1.7
---
Log message:

And even more correctly.


---
Diffs of the changes:  (+0 -4)

 opt.pod |4 
 1 files changed, 4 deletions(-)


Index: llvm/docs/CommandGuide/opt.pod
diff -u llvm/docs/CommandGuide/opt.pod:1.6 llvm/docs/CommandGuide/opt.pod:1.7
--- llvm/docs/CommandGuide/opt.pod:1.6  Fri Feb  2 18:32:23 2007
+++ llvm/docs/CommandGuide/opt.pod  Fri Feb  2 18:33:26 2007
@@ -65,12 +65,8 @@
 might be useful for other front end compilers as well. To discover the full set
 of options available, use the following command:
 
-=over
-
llvm-as  /dev/null | opt -std-compile-opts -disable-output 
-debug-pass=Arguments
 
-=back
-
 =item B-disable-inlining
 
 This option is only meaningful when B-std-compile-opts is given. It simply



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

2007-02-02 Thread Evan Cheng


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.465 - 1.466
---
Log message:

Pasto

---
Diffs of the changes:  (+1 -1)

 LegalizeDAG.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.465 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.466
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.465 Thu Feb  1 02:39:52 2007
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Fri Feb  2 18:43:46 2007
@@ -3634,7 +3634,7 @@
 LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64;
 break;
   case ISD::SETO:
-LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64;
+LC1 = (VT == MVT::f32) ? RTLIB::O_F32 : RTLIB::O_F64;
 break;
   default:
 LC1 = (VT == MVT::f32) ? RTLIB::UO_F32 : RTLIB::UO_F64;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/CommandGuide/gccas.pod

2007-02-02 Thread Reid Spencer


Changes in directory llvm/docs/CommandGuide:

gccas.pod updated: 1.6 - 1.7
---
Log message:

For PR1152: http://llvm.org/PR1152 :
Update documentation to reflect that this isn't a full-blown executable
any more.


---
Diffs of the changes:  (+15 -15)

 gccas.pod |   30 +++---
 1 files changed, 15 insertions(+), 15 deletions(-)


Index: llvm/docs/CommandGuide/gccas.pod
diff -u llvm/docs/CommandGuide/gccas.pod:1.6 
llvm/docs/CommandGuide/gccas.pod:1.7
--- llvm/docs/CommandGuide/gccas.pod:1.6Tue Nov 21 16:53:12 2006
+++ llvm/docs/CommandGuide/gccas.podFri Feb  2 18:44:47 2007
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
-gccas - optimizing LLVM assembler
+gccas - convenience script to run Bllvm-as and Bopt
 
 =head1 SYNOPSIS
 
@@ -10,19 +10,19 @@
 
 =head1 DESCRIPTION
 
-The Bgccas utility takes an LLVM assembly file generated by the
-Lllvmgcc|llvmgcc or Lllvmg++|llvmgxx front-ends and converts
-it into an LLVM bytecode file.  It is primarily used by the GCC
-front end, and as such, attempts to mimic the interface provided
-by the default system assembler so that it can act as a drop-in
-replacement.
-
-Bgccas performs a number of optimizations on the input program,
-including but not limited to: promotion of stack values to SSA
-registers; elimination of dead globals, function arguments, code,
-and types; tail-call elimination; loop-invariant code motion; global
-common-subexpression elimination; and sparse conditional constant
-propagation.
+The Bgccas shell script passes an LLVM assembly file through the Bllvm-as 
+and Bopt programs to generate an optimized bytecode file. Its name is an
+historical artifact from when it was a full executable used to process LLVM 
+assembly generated by the Lllvmgcc|llvmgcc or Lllvmg++|llvmgxx front-ends. 
 
+Currently this is a shell script that simulates what the old Bgccas 
executable
+once did. 
+
+Bgccas performs a number of optimizations on the input program, including but
+not limited to: promotion of stack values to SSA registers; elimination of dead
+globals, function arguments, code, and types; tail-call elimination; 
+loop-invariant code motion; global common-subexpression elimination; and 
+sparse conditional constant propagation. It accomplishes this by using the
+B-std-compile-opts option to the Bopt tool.
 
 =head1 OPTIONS
 
@@ -71,7 +71,7 @@
 
 =head1 SEE ALSO
 
-Lllvm-as|llvm-as, Lgccld|gccld
+Lllvm-as|llvm-as, Lopt|opt, Lgccld|gccld
 
 =head1 AUTHORS
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/test/CodeGen/ARM/unord.ll

2007-02-02 Thread Evan Cheng


Changes in directory llvm/test/CodeGen/ARM:

unord.ll added (r1.1)
---
Log message:

__builtin_isunordered test case.

---
Diffs of the changes:  (+18 -0)

 unord.ll |   18 ++
 1 files changed, 18 insertions(+)


Index: llvm/test/CodeGen/ARM/unord.ll
diff -c /dev/null llvm/test/CodeGen/ARM/unord.ll:1.1
*** /dev/null   Fri Feb  2 18:50:55 2007
--- llvm/test/CodeGen/ARM/unord.ll  Fri Feb  2 18:50:45 2007
***
*** 0 
--- 1,18 
+ ; RUN: llvm-as  %s | llc -march=arm 
+ ; RUN: llvm-as  %s | llc -march=arm | grep bne | wc -l | grep 1 
+ ; RUN: llvm-as  %s | llc -march=arm | grep beq | wc -l | grep 1 
+ ; RUN: llvm-as  %s | llc -march=arm -enable-thumb 
+ ; RUN: llvm-as  %s | llc -march=arm -enable-thumb | grep bne | wc -l | grep 
1 
+ ; RUN: llvm-as  %s | llc -march=arm -enable-thumb | grep beq | wc -l | grep 1
+ 
+ define i32 @f1(float %X, float %Y) {
+   %tmp = fcmp uno float %X, %Y
+   %retval = select i1 %tmp, i32 1, i32 -1
+   ret i32 %retval
+ }
+ 
+ define i32 @f2(float %X, float %Y) {
+   %tmp = fcmp ord float %X, %Y
+   %retval = select i1 %tmp, i32 1, i32 -1
+   ret i32 %retval
+ }



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

LegalizeDAG.cpp updated: 1.466 - 1.467
---
Log message:

Switch ComputeTopDownOrdering over to using a densemap.  This speeds up
isel as a whole by 3.3%.


---
Diffs of the changes:  (+3 -2)

 LegalizeDAG.cpp |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.466 
llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.467
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:1.466 Fri Feb  2 18:43:46 2007
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp   Fri Feb  2 19:12:36 2007
@@ -25,6 +25,7 @@
 #include llvm/Support/MathExtras.h
 #include llvm/Support/CommandLine.h
 #include llvm/Support/Compiler.h
+#include llvm/ADT/DenseMap.h
 #include llvm/ADT/SmallVector.h
 #include map
 using namespace llvm;
@@ -290,7 +291,7 @@
 /// ComputeTopDownOrdering - Add the specified node to the Order list if it has
 /// not been visited yet and if all of its operands have already been visited.
 static void ComputeTopDownOrdering(SDNode *N, std::vectorSDNode* Order,
-   std::mapSDNode*, unsigned Visited) {
+   DenseMapSDNode*, unsigned Visited) {
   if (++Visited[N] != N-getNumOperands())
 return;  // Haven't visited all operands yet
   
@@ -318,7 +319,7 @@
   // practice however, this causes us to run out of stack space on large basic
   // blocks.  To avoid this problem, compute an ordering of the nodes where 
each
   // node is only legalized after all of its operands are legalized.
-  std::mapSDNode*, unsigned Visited;
+  DenseMapSDNode*, unsigned Visited;
   std::vectorSDNode* Order;
   
   // Compute ordering from all of the leaves in the graphs, those (like the



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachinePassRegistry.h ScheduleDAG.h

2007-02-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/CodeGen:

MachinePassRegistry.h updated: 1.3 - 1.4
ScheduleDAG.h updated: 1.35 - 1.36
---
Log message:

switch the sched unit map over to use a DenseMap instead of std::map.  This
speeds up isel as a whole time by 2.6%.


---
Diffs of the changes:  (+3 -3)

 MachinePassRegistry.h |1 -
 ScheduleDAG.h |5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/CodeGen/MachinePassRegistry.h
diff -u llvm/include/llvm/CodeGen/MachinePassRegistry.h:1.3 
llvm/include/llvm/CodeGen/MachinePassRegistry.h:1.4
--- llvm/include/llvm/CodeGen/MachinePassRegistry.h:1.3 Wed Aug  2 07:30:23 2006
+++ llvm/include/llvm/CodeGen/MachinePassRegistry.h Fri Feb  2 19:34:13 2007
@@ -19,7 +19,6 @@
 #define LLVM_CODEGEN_MACHINEPASSREGISTRY_H
 
 #include llvm/CodeGen/Passes.h
-#include llvm/CodeGen/ScheduleDAG.h
 #include llvm/Support/CommandLine.h
 
 namespace llvm {


Index: llvm/include/llvm/CodeGen/ScheduleDAG.h
diff -u llvm/include/llvm/CodeGen/ScheduleDAG.h:1.35 
llvm/include/llvm/CodeGen/ScheduleDAG.h:1.36
--- llvm/include/llvm/CodeGen/ScheduleDAG.h:1.35Wed Jan 31 23:32:05 2007
+++ llvm/include/llvm/CodeGen/ScheduleDAG.h Fri Feb  2 19:34:13 2007
@@ -16,6 +16,7 @@
 #define LLVM_CODEGEN_SCHEDULEDAG_H
 
 #include llvm/CodeGen/SelectionDAG.h
+#include llvm/ADT/DenseMap.h
 #include llvm/ADT/SmallSet.h
 
 namespace llvm {
@@ -153,7 +154,7 @@
   public:
 virtual ~SchedulingPriorityQueue() {}
   
-virtual void initNodes(std::mapSDNode*, SUnit* SUMap,
+virtual void initNodes(DenseMapSDNode*, SUnit* SUMap,
std::vectorSUnit SUnits) = 0;
 virtual void releaseState() = 0;
   
@@ -180,7 +181,7 @@
 MachineConstantPool *ConstPool;   // Target constant pool
 std::vectorSUnit* Sequence; // The schedule. Null SUnit*'s
   // represent noop instructions.
-std::mapSDNode*, SUnit* SUnitMap;   // SDNode to SUnit mapping (n - 1).
+DenseMapSDNode*, SUnit* SUnitMap;   // SDNode to SUnit mapping (n - 1).
 std::vectorSUnit SUnits;// The scheduling units.
 SmallSetSDNode*, 16 CommuteSet; // Nodes the should be commuted.
 



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp ScheduleDAGRRList.cpp

2007-02-02 Thread Chris Lattner


Changes in directory llvm/lib/CodeGen/SelectionDAG:

ScheduleDAGList.cpp updated: 1.71 - 1.72
ScheduleDAGRRList.cpp updated: 1.26 - 1.27
---
Log message:

switch the sched unit map over to use a DenseMap instead of std::map.  This
speeds up isel as a whole time by 2.6%.


---
Diffs of the changes:  (+6 -6)

 ScheduleDAGList.cpp   |2 +-
 ScheduleDAGRRList.cpp |   10 +-
 2 files changed, 6 insertions(+), 6 deletions(-)


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.71 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.72
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp:1.71  Tue Dec 19 
16:41:21 2006
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGList.cpp   Fri Feb  2 19:34:13 2007
@@ -328,7 +328,7 @@
 LatencyPriorityQueue() : Queue(latency_sort(this)) {
 }
 
-void initNodes(std::mapSDNode*, SUnit* sumap,
+void initNodes(DenseMapSDNode*, SUnit* sumap,
std::vectorSUnit sunits) {
   SUnits = sunits;
   // Calculate node priorities.


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.26 
llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.27
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp:1.26Wed Jan 31 
22:55:59 2007
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp Fri Feb  2 19:34:13 2007
@@ -430,7 +430,7 @@
 RegReductionPriorityQueue() :
 Queue(SF(this)) {}
 
-virtual void initNodes(std::mapSDNode*, SUnit* sumap,
+virtual void initNodes(DenseMapSDNode*, SUnit* sumap,
std::vectorSUnit sunits) {}
 virtual void releaseState() {}
 
@@ -464,7 +464,7 @@
   class VISIBILITY_HIDDEN BURegReductionPriorityQueue
: public RegReductionPriorityQueueSF {
 // SUnitMap SDNode to SUnit mapping (n - 1).
-std::mapSDNode*, SUnit* *SUnitMap;
+DenseMapSDNode*, SUnit* *SUnitMap;
 
 // SUnits - The SUnits for the current graph.
 const std::vectorSUnit *SUnits;
@@ -477,7 +477,7 @@
 BURegReductionPriorityQueue(const TargetInstrInfo *tii)
   : TII(tii) {}
 
-void initNodes(std::mapSDNode*, SUnit* sumap,
+void initNodes(DenseMapSDNode*, SUnit* sumap,
std::vectorSUnit sunits) {
   SUnitMap = sumap;
   SUnits = sunits;
@@ -541,7 +541,7 @@
   templateclass SF
   class TDRegReductionPriorityQueue : public RegReductionPriorityQueueSF {
 // SUnitMap SDNode to SUnit mapping (n - 1).
-std::mapSDNode*, SUnit* *SUnitMap;
+DenseMapSDNode*, SUnit* *SUnitMap;
 
 // SUnits - The SUnits for the current graph.
 const std::vectorSUnit *SUnits;
@@ -552,7 +552,7 @@
   public:
 TDRegReductionPriorityQueue() {}
 
-void initNodes(std::mapSDNode*, SUnit* sumap,
+void initNodes(DenseMapSDNode*, SUnit* sumap,
std::vectorSUnit sunits) {
   SUnitMap = sumap;
   SUnits = sunits;



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] [123343] Add #include that is no longer included by SchedulerRegistry.h

2007-02-02 Thread clattner
Revision: 123343
Author:   clattner
Date: 2007-02-02 17:44:37 -0800 (Fri, 02 Feb 2007)

Log Message:
---
Add #include that is no longer included by SchedulerRegistry.h

Modified Paths:
--
apple-local/branches/llvm/gcc/llvm-backend.cpp

Modified: apple-local/branches/llvm/gcc/llvm-backend.cpp
===
--- apple-local/branches/llvm/gcc/llvm-backend.cpp  2007-02-03 01:32:17 UTC 
(rev 123342)
+++ apple-local/branches/llvm/gcc/llvm-backend.cpp  2007-02-03 01:44:37 UTC 
(rev 123343)
@@ -34,6 +34,7 @@
 #include llvm/Bytecode/WriteBytecodePass.h
 #include llvm/CodeGen/RegAllocRegistry.h
 #include llvm/CodeGen/SchedulerRegistry.h
+#include llvm/CodeGen/ScheduleDAG.h
 #include llvm/Support/Streams.h
 #include llvm/Target/SubtargetFeature.h
 #include llvm/Target/TargetData.h


___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp

2007-02-02 Thread Evan Cheng


Changes in directory llvm/lib/Target/ARM:

ARMConstantIslandPass.cpp updated: 1.23 - 1.24
---
Log message:

- Branch max. displacement calculation bug.
- Add debugging info.


---
Diffs of the changes:  (+20 -9)

 ARMConstantIslandPass.cpp |   29 -
 1 files changed, 20 insertions(+), 9 deletions(-)


Index: llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
diff -u llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.23 
llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.24
--- llvm/lib/Target/ARM/ARMConstantIslandPass.cpp:1.23  Fri Feb  2 13:09:19 2007
+++ llvm/lib/Target/ARM/ARMConstantIslandPass.cpp   Fri Feb  2 20:08:34 2007
@@ -283,7 +283,7 @@
 }
 
 // Record this immediate branch.
-unsigned MaxOffs = (1  (Bits-1)) * Scale;
+unsigned MaxOffs = ((1  (Bits-1))-1) * Scale;
 ImmBranches.push_back(ImmBranch(I, MaxOffs, isCond, UOpc));
   }
 
@@ -489,7 +489,7 @@
 
   DEBUG(std::cerr  User of CPE#  CPEMI-getOperand(0).getImm()
 max delta=  MaxDisp
-at offset   int(UserOffset-CPEOffset)  \t
+at offset   int(CPEOffset-UserOffset)  \t
*MI);
 
   if (UserOffset = CPEOffset) {
@@ -581,8 +581,9 @@
   unsigned DestOffset = GetOffsetOf(DestBB);
 
   DEBUG(std::cerr  Branch of destination BB#  DestBB-getNumber()
+from BB#  MI-getParent()-getNumber()
 max delta=  MaxDisp
-at offset   int(BrOffset-DestOffset)  \t
+at offset   int(DestOffset-BrOffset)  \t
*MI);
 
   if (BrOffset = DestOffset) {
@@ -626,6 +627,9 @@
   BBSizes[MBB-getNumber()] += 2;
   HasFarJump = true;
   NumUBrFixed++;
+
+  DEBUG(std::cerrChanged B to long jump   *MI);
+
   return true;
 }
 
@@ -657,13 +661,13 @@
   // direct the updated conditional branch to the fall-through block. 
Otherwise,
   // split the MBB before the next instruction.
   MachineBasicBlock *MBB = MI-getParent();
-  MachineInstr *BackMI = MBB-back();
-  bool NeedSplit = (BackMI != MI) || !BBHasFallthrough(MBB);
+  MachineInstr *BMI = MBB-back();
+  bool NeedSplit = (BMI != MI) || !BBHasFallthrough(MBB);
 
   NumCBrFixed++;
-  if (BackMI != MI) {
+  if (BMI != MI) {
 if (next(MachineBasicBlock::iterator(MI)) == MBB-back() 
-BackMI-getOpcode() == Br.UncondBr) {
+BMI-getOpcode() == Br.UncondBr) {
   // Last MI in the BB is a unconditional branch. Can we simply invert the
   // condition and swap destinations:
   // beq L1
@@ -671,9 +675,12 @@
   // =
   // bne L2
   // b   L1
-  MachineBasicBlock *NewDest = 
BackMI-getOperand(0).getMachineBasicBlock();
+  MachineBasicBlock *NewDest = BMI-getOperand(0).getMachineBasicBlock();
   if (BBIsInRange(MI, NewDest, Br.MaxDisp)) {
-BackMI-getOperand(0).setMachineBasicBlock(DestBB);
+DEBUG(std::cerrInvert Bcc condition and swap its destination
+  with   *BMI);
+
+BMI-getOperand(0).setMachineBasicBlock(DestBB);
 MI-getOperand(0).setMachineBasicBlock(NewDest);
 MI-getOperand(1).setImm(CC);
 return true;
@@ -688,6 +695,10 @@
 MBB-back().eraseFromParent();
   }
   MachineBasicBlock *NextBB = next(MachineFunction::iterator(MBB));
+ 
+  DEBUG(std::cerrInsert B to BB#  DestBB-getNumber()
+also invert condition and change dest. to BB#
+   NextBB-getNumber()  \n);
 
   // Insert a unconditional branch and replace the conditional branch.
   // Also update the ImmBranch as well as adding a new entry for the new 
branch.



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachORelocation.h

2007-02-02 Thread Bill Wendling


Changes in directory llvm/include/llvm/CodeGen:

MachORelocation.h added (r1.1)
---
Log message:

New file for the MachORelocation structure. It doesn't have to be tied to the
MachOWriter.h file.


---
Diffs of the changes:  (+54 -0)

 MachORelocation.h |   54 ++
 1 files changed, 54 insertions(+)


Index: llvm/include/llvm/CodeGen/MachORelocation.h
diff -c /dev/null llvm/include/llvm/CodeGen/MachORelocation.h:1.1
*** /dev/null   Fri Feb  2 20:36:27 2007
--- llvm/include/llvm/CodeGen/MachORelocation.h Fri Feb  2 20:36:17 2007
***
*** 0 
--- 1,54 
+ //=== MachORelocation.h - Mach-O Relocation Info *- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by Bill Wendling and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file defines the MachORelocation class.
+ //
+ 
//===--===//
+ 
+ 
+ #ifndef LLVM_CODEGEN_MACHO_RELOCATION_H
+ #define LLVM_CODEGEN_MACHO_RELOCATION_H
+ 
+ namespace llvm {
+ 
+   /// MachORelocation - This struct contains information about each relocation
+   /// that needs to be emitted to the file.
+   /// see mach-o/reloc.h
+   class MachORelocation {
+ uint32_t r_address;   // offset in the section to what is being  relocated
+ uint32_t r_symbolnum; // symbol index if r_extern == 1 else section index
+ bool r_pcrel; // was relocated pc-relative already
+ uint8_t  r_length;// length = 2 ^ r_length
+ bool r_extern;// 
+ uint8_t  r_type;  // if not 0, machine-specific relocation type.
+ bool r_scattered; // 1 = scattered, 0 = non-scattered
+ int32_t  r_value; // the value the item to be relocated is referring
+   // to.
+   public:  
+ uint32_t getPackedFields() const {
+   if (r_scattered)
+ return (1  31) | (r_pcrel  30) | ((r_length  3)  28) | 
+   ((r_type  15)  24) | (r_address  0x00FF);
+   else
+ return (r_symbolnum  8) | (r_pcrel  7) | ((r_length  3)  5) |
+   (r_extern  4) | (r_type  15);
+ }
+ uint32_t getAddress() const { return r_scattered ? r_value : r_address; }
+ uint32_t getRawAddress() const { return r_address; }
+ 
+ MachORelocation(uint32_t addr, uint32_t index, bool pcrel, uint8_t len,
+ bool ext, uint8_t type, bool scattered = false, 
+ int32_t value = 0) : 
+   r_address(addr), r_symbolnum(index), r_pcrel(pcrel), r_length(len),
+   r_extern(ext), r_type(type), r_scattered(scattered), r_value(value) {}
+   };
+ 
+ } // end llvm namespace
+ 
+ #endif // LLVM_CODEGEN_MACHO_RELOCATION_H



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Support/OutputBuffer.h

2007-02-02 Thread Bill Wendling


Changes in directory llvm/include/llvm/Support:

OutputBuffer.h updated: 1.2 - 1.3
---
Log message:

Added some accessor methods.


---
Diffs of the changes:  (+9 -0)

 OutputBuffer.h |9 +
 1 files changed, 9 insertions(+)


Index: llvm/include/llvm/Support/OutputBuffer.h
diff -u llvm/include/llvm/Support/OutputBuffer.h:1.2 
llvm/include/llvm/Support/OutputBuffer.h:1.3
--- llvm/include/llvm/Support/OutputBuffer.h:1.2Wed Jan 17 19:23:11 2007
+++ llvm/include/llvm/Support/OutputBuffer.hFri Feb  2 20:38:15 2007
@@ -138,6 +138,15 @@
   else
 assert(0  Emission of 64-bit data not implemented yet!);
 }
+
+std::vectorunsigned char::reference
+operator [] (unsigned Index) {
+  return Output[Index];
+}
+std::vectorunsigned char::const_reference
+operator [] (unsigned Index) const {
+  return Output[Index];
+}
   };
   
 } // end llvm namespace



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/include/llvm/Target/TargetMachOWriterInfo.h

2007-02-02 Thread Bill Wendling


Changes in directory llvm/include/llvm/Target:

TargetMachOWriterInfo.h updated: 1.2 - 1.3
---
Log message:

Added GetTargetRelocation method.


---
Diffs of the changes:  (+10 -1)

 TargetMachOWriterInfo.h |   11 ++-
 1 files changed, 10 insertions(+), 1 deletion(-)


Index: llvm/include/llvm/Target/TargetMachOWriterInfo.h
diff -u llvm/include/llvm/Target/TargetMachOWriterInfo.h:1.2 
llvm/include/llvm/Target/TargetMachOWriterInfo.h:1.3
--- llvm/include/llvm/Target/TargetMachOWriterInfo.h:1.2Wed Jan 24 
01:13:55 2007
+++ llvm/include/llvm/Target/TargetMachOWriterInfo.hFri Feb  2 20:38:57 2007
@@ -19,6 +19,7 @@
 namespace llvm {
 
   class MachineBasicBlock;
+  class OutputBuffer;
 
   
//======//
   //TargetMachOWriterInfo
@@ -88,11 +89,19 @@
 
 TargetMachOWriterInfo(uint32_t cputype, uint32_t cpusubtype)
   : CPUType(cputype), CPUSubType(cpusubtype) {}
-virtual ~TargetMachOWriterInfo() {}
+virtual ~TargetMachOWriterInfo();
 
 virtual MachineRelocation GetJTRelocation(unsigned Offset,
   MachineBasicBlock *MBB) const;
 
+virtual unsigned GetTargetRelocation(MachineRelocation MR,
+ unsigned FromIdx,
+ unsigned ToAddr,
+ unsigned ToIdx,
+ OutputBuffer RelocOut,
+ OutputBuffer SecOut,
+ bool Scattered) const { return 0; }
+
 uint32_t getCPUType() const { return CPUType; }
 uint32_t getCPUSubType() const { return CPUSubType; }
   };



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/lib/Target/TargetMachOWriterInfo.cpp

2007-02-02 Thread Bill Wendling


Changes in directory llvm/lib/Target:

TargetMachOWriterInfo.cpp updated: 1.1 - 1.2
---
Log message:

Put destructor out-of-line.


---
Diffs of the changes:  (+2 -0)

 TargetMachOWriterInfo.cpp |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/Target/TargetMachOWriterInfo.cpp
diff -u llvm/lib/Target/TargetMachOWriterInfo.cpp:1.1 
llvm/lib/Target/TargetMachOWriterInfo.cpp:1.2
--- llvm/lib/Target/TargetMachOWriterInfo.cpp:1.1   Tue Jan 23 21:36:05 2007
+++ llvm/lib/Target/TargetMachOWriterInfo.cpp   Fri Feb  2 20:40:10 2007
@@ -15,6 +15,8 @@
 #include llvm/CodeGen/MachineRelocation.h
 using namespace llvm;
 
+TargetMachOWriterInfo::~TargetMachOWriterInfo() {}
+
 MachineRelocation
 TargetMachOWriterInfo::GetJTRelocation(unsigned Offset,
MachineBasicBlock *MBB) const {



___
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/PPCMachOWriter.cpp

2007-02-02 Thread Bill Wendling


Changes in directory llvm/lib/Target/PowerPC:

PPCMachOWriter.cpp updated: 1.15 - 1.16
---
Log message:

Moved the GetTargetRelocation method to the PPCMachOWriterInfo object. The
PPCMachOWriter is now trivial.


---
Diffs of the changes:  (+1 -131)

 PPCMachOWriter.cpp |  132 -
 1 files changed, 1 insertion(+), 131 deletions(-)


Index: llvm/lib/Target/PowerPC/PPCMachOWriter.cpp
diff -u llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.15 
llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.16
--- llvm/lib/Target/PowerPC/PPCMachOWriter.cpp:1.15 Fri Jan 26 16:39:48 2007
+++ llvm/lib/Target/PowerPC/PPCMachOWriter.cpp  Fri Feb  2 20:40:57 2007
@@ -12,35 +12,17 @@
 //
 
//===--===//
 
-#include PPCRelocations.h
 #include PPCTargetMachine.h
 #include llvm/PassManager.h
 #include llvm/CodeGen/MachOWriter.h
 #include llvm/Support/Compiler.h
-#include llvm/Support/OutputBuffer.h
 using namespace llvm;
 
 namespace {
-  class VISIBILITY_HIDDEN PPCMachOWriter : public MachOWriter {
-  public:
+  struct VISIBILITY_HIDDEN PPCMachOWriter : public MachOWriter {
 PPCMachOWriter(std::ostream O, PPCTargetMachine TM)
   : MachOWriter(O, TM) {}
-
-virtual void GetTargetRelocation(MachineRelocation MR, MachOSection From,
- MachOSection To, bool Scattered);
-
-// Constants for the relocation r_type field.
-// see mach-o/ppc/reloc.h
-enum { PPC_RELOC_VANILLA, // generic relocation
-   PPC_RELOC_PAIR,// the second relocation entry of a pair
-   PPC_RELOC_BR14,// 14 bit branch displacement to word address
-   PPC_RELOC_BR24,// 24 bit branch displacement to word address
-   PPC_RELOC_HI16,// a PAIR follows with the low 16 bits
-   PPC_RELOC_LO16,// a PAIR follows with the high 16 bits
-   PPC_RELOC_HA16,// a PAIR follows, which is sign extended to 32b
-   PPC_RELOC_LO14 // LO16 with low 2 bits implicitly zero
 };
-  };
 }
 
 /// addPPCMachOObjectWriterPass - Returns a pass that outputs the generated 
code
@@ -52,115 +34,3 @@
   FPM.add(MOW);
   FPM.add(createPPCCodeEmitterPass(TM, MOW-getMachineCodeEmitter()));
 }
-
-/// GetTargetRelocation - For the MachineRelocation MR, convert it to one or
-/// more PowerPC MachORelocation(s), add the new relocations to the
-/// MachOSection, and rewrite the instruction at the section offset if required
-/// by that relocation type.
-void PPCMachOWriter::GetTargetRelocation(MachineRelocation MR,
- MachOSection From,
- MachOSection To,
- bool Scattered) {
-  uint64_t Addr = 0;
-
-  // Keep track of whether or not this is an externally defined relocation.
-  bool isExtern = false;
-
-  // Get the address of whatever it is we're relocating, if possible.
-  if (!isExtern)
-Addr = (uintptr_t)MR.getResultPointer() + To.addr;
-
-  switch ((PPC::RelocationType)MR.getRelocationType()) {
-  default: assert(0  Unknown PPC relocation type!);
-  case PPC::reloc_absolute_low_ix:
-assert(0  Unhandled PPC relocation type!);
-break;
-  case PPC::reloc_vanilla:
-{
-  // FIXME: need to handle 64 bit vanilla relocs
-  MachORelocation VANILLA(MR.getMachineCodeOffset(), To.Index, false, 2, 
-  isExtern, PPC_RELOC_VANILLA, Scattered,
-  (intptr_t)MR.getResultPointer());
-  ++From.nreloc;
-  OutputBuffer RelocOut(From.RelocBuffer, is64Bit, isLittleEndian);
-  OutputBuffer SecOut(From.SectionData, is64Bit, isLittleEndian);
-
-  if (Scattered) {
-RelocOut.outword(VANILLA.getPackedFields());
-RelocOut.outword(VANILLA.getAddress());
-  } else {
-RelocOut.outword(VANILLA.getAddress());
-RelocOut.outword(VANILLA.getPackedFields());
-  }
-  
-  intptr_t SymbolOffset;
-  if (Scattered)
-SymbolOffset = Addr + MR.getConstantVal();
-  else
-SymbolOffset = Addr;
-  printf(vanilla fixup: sec_%x[%x] = %x\n, From.Index, 
unsigned(MR.getMachineCodeOffset()), (unsigned)SymbolOffset);
-  SecOut.fixword(SymbolOffset, MR.getMachineCodeOffset());
-}
-break;
-  case PPC::reloc_pcrel_bx:
-{
-  Addr -= MR.getMachineCodeOffset();
-  Addr = 2;
-  Addr = 0xFF;
-  Addr = 2;
-  Addr |= (From.SectionData[MR.getMachineCodeOffset()]  24);
-
-  OutputBuffer SecOut(From.SectionData, is64Bit, isLittleEndian);
-  SecOut.fixword(Addr, MR.getMachineCodeOffset());
-  break;
-}
-  case PPC::reloc_pcrel_bcx:
-{
-  Addr -= MR.getMachineCodeOffset();
-  Addr = 0xFFFC;
-
-  OutputBuffer SecOut(From.SectionData, is64Bit, isLittleEndian);
-  SecOut.fixhalf(Addr, MR.getMachineCodeOffset() + 2);
-  break;
-}
-  case 

[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp PPCMachOWriterInfo.h

2007-02-02 Thread Bill Wendling


Changes in directory llvm/lib/Target/PowerPC:

PPCMachOWriterInfo.cpp updated: 1.1 - 1.2
PPCMachOWriterInfo.h updated: 1.2 - 1.3
---
Log message:

Moved the GetTargetRelocation method from PPCMachOWriter to here. It uses
non-Mach-O-specific information.


---
Diffs of the changes:  (+143 -1)

 PPCMachOWriterInfo.cpp |  119 +
 PPCMachOWriterInfo.h   |   25 +-
 2 files changed, 143 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp:1.1 
llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp:1.2
--- llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp:1.1  Tue Jan 23 21:36:05 2007
+++ llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp  Fri Feb  2 20:41:58 2007
@@ -12,7 +12,10 @@
 
//===--===//
 
 #include PPCMachOWriterInfo.h
+#include PPCRelocations.h
 #include PPCTargetMachine.h
+#include llvm/CodeGen/MachORelocation.h
+#include llvm/Support/OutputBuffer.h
 using namespace llvm;
 
 PPCMachOWriterInfo::PPCMachOWriterInfo(const PPCTargetMachine TM)
@@ -20,3 +23,119 @@
   HDR_CPU_TYPE_POWERPC64 :
   HDR_CPU_TYPE_POWERPC,
   HDR_CPU_SUBTYPE_POWERPC_ALL) {}
+PPCMachOWriterInfo::~PPCMachOWriterInfo() {}
+
+
+/// GetTargetRelocation - For the MachineRelocation MR, convert it to one or
+/// more PowerPC MachORelocation(s), add the new relocations to the
+/// MachOSection, and rewrite the instruction at the section offset if required
+/// by that relocation type.
+unsigned PPCMachOWriterInfo::GetTargetRelocation(MachineRelocation MR,
+ unsigned FromIdx,
+ unsigned ToAddr,
+ unsigned ToIdx,
+ OutputBuffer RelocOut,
+ OutputBuffer SecOut,
+ bool Scattered) const {
+  unsigned NumRelocs = 0;
+  uint64_t Addr = 0;
+
+  // Keep track of whether or not this is an externally defined relocation.
+  bool isExtern = false;
+
+  // Get the address of whatever it is we're relocating, if possible.
+  if (!isExtern)
+Addr = (uintptr_t)MR.getResultPointer() + ToAddr;
+
+  switch ((PPC::RelocationType)MR.getRelocationType()) {
+  default: assert(0  Unknown PPC relocation type!);
+  case PPC::reloc_absolute_low_ix:
+assert(0  Unhandled PPC relocation type!);
+break;
+  case PPC::reloc_vanilla:
+{
+  // FIXME: need to handle 64 bit vanilla relocs
+  MachORelocation VANILLA(MR.getMachineCodeOffset(), ToIdx,
+  false, 2, isExtern,
+  PPC_RELOC_VANILLA,
+  Scattered, (intptr_t)MR.getResultPointer());
+  ++NumRelocs;
+
+  if (Scattered) {
+RelocOut.outword(VANILLA.getPackedFields());
+RelocOut.outword(VANILLA.getAddress());
+  } else {
+RelocOut.outword(VANILLA.getAddress());
+RelocOut.outword(VANILLA.getPackedFields());
+  }
+  
+  intptr_t SymbolOffset;
+
+  if (Scattered)
+SymbolOffset = Addr + MR.getConstantVal();
+  else
+SymbolOffset = Addr;
+
+  printf(vanilla fixup: sec_%x[%x] = %x\n, FromIdx,
+ unsigned(MR.getMachineCodeOffset()),
+ unsigned(SymbolOffset));
+  SecOut.fixword(SymbolOffset, MR.getMachineCodeOffset());
+}
+break;
+  case PPC::reloc_pcrel_bx:
+{
+  Addr -= MR.getMachineCodeOffset();
+  Addr = 2;
+  Addr = 0xFF;
+  Addr = 2;
+  Addr |= (SecOut[MR.getMachineCodeOffset()]  24);
+
+  SecOut.fixword(Addr, MR.getMachineCodeOffset());
+  break;
+}
+  case PPC::reloc_pcrel_bcx:
+{
+  Addr -= MR.getMachineCodeOffset();
+  Addr = 0xFFFC;
+
+  SecOut.fixhalf(Addr, MR.getMachineCodeOffset() + 2);
+  break;
+}
+  case PPC::reloc_absolute_high:
+{
+  MachORelocation HA16(MR.getMachineCodeOffset(), ToIdx, false, 2,
+   isExtern, PPC_RELOC_HA16);
+  MachORelocation PAIR(Addr  0x, 0xFF, false, 2, isExtern,
+   PPC_RELOC_PAIR);
+  NumRelocs = 2;
+
+  RelocOut.outword(HA16.getRawAddress());
+  RelocOut.outword(HA16.getPackedFields());
+  RelocOut.outword(PAIR.getRawAddress());
+  RelocOut.outword(PAIR.getPackedFields());
+
+  Addr += 0x8000;
+
+  SecOut.fixhalf(Addr  16, MR.getMachineCodeOffset() + 2);
+  break;
+}
+  case PPC::reloc_absolute_low:
+{
+  MachORelocation LO16(MR.getMachineCodeOffset(), ToIdx, false, 2,
+   isExtern, PPC_RELOC_LO16);
+  MachORelocation PAIR(Addr  16, 0xFF, false, 2, isExtern,
+   PPC_RELOC_PAIR);
+ 

[llvm-commits] CVS: llvm/include/llvm/ADT/BitSetVector.h

2007-02-02 Thread Chris Lattner


Changes in directory llvm/include/llvm/ADT:

BitSetVector.h (r1.20) removed
---
Log message:

remove a dead header


---
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/docs/ProgrammersManual.html

2007-02-02 Thread Chris Lattner


Changes in directory llvm/docs:

ProgrammersManual.html updated: 1.106 - 1.107
---
Log message:

Add some notes about choice of container.


---
Diffs of the changes:  (+240 -1)

 ProgrammersManual.html |  241 -
 1 files changed, 240 insertions(+), 1 deletion(-)


Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.106 
llvm/docs/ProgrammersManual.html:1.107
--- llvm/docs/ProgrammersManual.html:1.106  Sun Jan 14 19:55:32 2007
+++ llvm/docs/ProgrammersManual.htmlFri Feb  2 21:04:03 2007
@@ -44,6 +44,20 @@
   lia href=#ViewGraphViewing graphs while debugging code/a/li
 /ul
   /li
+  lia href=#datastructurePicking the Right Data Structure for a Task/a
+ul
+lia href=#ds_sequentialSequential Containers (std::vector, 
std::list, etc)/aul
+lia href=#dss_fixedarraysFixed Size Arrays/a/li
+lia href=#dss_heaparraysHeap Allocated Arrays/a/li
+lia href=#dss_smallvectorllvm/ADT/SmallVector.h/a/li
+lia href=#dss_vectorlt;vectorgt;/a/li
+lia href=#dss_ilistllvm/ADT/ilist/a/li
+lia href=#dss_listlt;listgt;/a/li
+/ul/li
+lia href=#ds_setSet-Like Containers (std::set, SmallSet, SetVector, 
etc)/a/li
+lia href=#ds_mapMap-Like Containers (std::map, DenseMap, 
etc)/a/li
+/ul
+  /li
   lia href=#commonHelpful Hints for Common Operations/a
 ul
   lia href=#inspectionBasic Inspection and Traversal Routines/a
@@ -632,6 +646,231 @@
 
 /div
 
+!-- *** 
--
+div class=doc_section
+  a name=datastructurePicking the Right Data Structure for a Task/a
+/div
+!-- *** 
--
+
+div class=doc_text
+
+pLLVM has a plethora of datastructures in the ttllvm/ADT//tt directory,
+ and we commonly use STL datastructures.  This section describes the tradeoffs
+ you should consider when you pick one./p
+
+p
+The first step is a choose your own adventure: do you want a sequential
+container, a set-like container, or a map-like container?  The most important
+thing when choosing a container is the algorithmic properties of how you plan 
to
+access the container.  Based on that, you should use:/p
+
+ul
+lia a href=#ds_mapmap-like/a container if you need efficient lookup
+of an value based on another value.  Map-like containers also support
+efficient queries for containment (whether a key is in the map).  Map-like
+containers generally do not support efficient reverse mapping (values to
+keys).  If you need that, use two maps.  Some map-like containers also
+support efficient iteration through the keys in sorted order.  Map-like
+containers are the most expensive sort, only use them if you need one of
+these capabilities./li
+
+lia a href=#ds_setset-like/a container if you need to put a bunch of
+stuff into a container that automatically eliminates duplicates.  Some
+set-like containers support efficient iteration through the elements in
+sorted order.  Set-like containers are more expensive than sequential
+containers.
+/li
+
+lia a href=#ds_sequentialsequential/a container provides
+the most efficient way to add elements and keeps track of the order they 
are
+added to the collection.  They permit duplicates and support efficient
+iteration, but do not support efficient lookup based on a key.
+/li
+
+/ul
+
+p
+Once the proper catagory of container is determined, you can fine tune the
+memory use, constant factors, and cache behaviors of access by intelligently
+picking a member of the catagory.  Note that constant factors and cache 
behavior
+can be a big deal.  If you have a vector that usually only contains a few
+elements (but could contain many), for example, it's much better to use
+a href=#dss_smallvectorSmallVector/a than a 
href=#dss_vectorvector/a
+.  Doing so avoids (relatively) expensive malloc/free calls, which dwarf the
+cost of adding the elements to the container. /p
+
+/div
+
+!-- === 
--
+div class=doc_subsection
+  a name=ds_sequentialSequential Containers (std::vector, std::list, 
etc)/a
+/div
+
+div class=doc_text
+There are a variety of sequential containers available for you, based on your
+needs.  Pick the first in this section that will do what you want.
+/div
+
+!-- ___ 
--
+div class=doc_subsubsection
+  a name=dss_fixedarraysFixed Size Arrays/a
+/div
+
+div class=doc_text
+pFixed size arrays are very simple and very fast.  They are good if you know
+exactly how many elements you have, or you have a (low) upper bound on how many
+you have./p
+/div
+
+!-- ___ 
--
+div class=doc_subsubsection
+  a name=dss_heaparraysHeap Allocated Arrays/a
+/div
+
+div class=doc_text
+pHeap allocated arrays 

[llvm-commits] CVS: llvm/docs/ProgrammersManual.html

2007-02-02 Thread Chris Lattner


Changes in directory llvm/docs:

ProgrammersManual.html updated: 1.107 - 1.108
---
Log message:

fix validation problems


---
Diffs of the changes:  (+3 -3)

 ProgrammersManual.html |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.107 
llvm/docs/ProgrammersManual.html:1.108
--- llvm/docs/ProgrammersManual.html:1.107  Fri Feb  2 21:04:03 2007
+++ llvm/docs/ProgrammersManual.htmlFri Feb  2 21:05:57 2007
@@ -637,7 +637,7 @@
 ttcall DAG.setGraphColor(inode/i, icolor/i)/tt, then the
 next ttcall DAG.viewGraph()/tt would hilight the node in the
 specified color (choices of colors can be found at a
-href=http://www.graphviz.org/doc/info/colors.html;Colorsa.) More
+href=http://www.graphviz.org/doc/info/colors.html;colors/a.) More
 complex node attributes can be provided with ttcall
 DAG.setGraphAttrs(inode/i, iattributes/i)/tt (choices can be
 found at a href=http://www.graphviz.org/doc/info/attrs.html;Graph
@@ -1928,7 +1928,7 @@
 /ul
   /dd
   dtttPointerType/tt/dt
-  ddSubclass of SequentialType for pointer types./li
+  ddSubclass of SequentialType for pointer types./dd
   dtttPackedType/tt/dt
   ddSubclass of SequentialType for packed (vector) types. A 
   packed type is similar to an ArrayType but is distinguished because it is 
@@ -2796,7 +2796,7 @@
   a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and
   a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/03 03:04:03 $
+  Last modified: $Date: 2007/02/03 03:05:57 $
 /address
 
 /body



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/ProgrammersManual.html

2007-02-02 Thread Chris Lattner


Changes in directory llvm/docs:

ProgrammersManual.html updated: 1.108 - 1.109
---
Log message:

fix validation issues


---
Diffs of the changes:  (+2 -7)

 ProgrammersManual.html |9 ++---
 1 files changed, 2 insertions(+), 7 deletions(-)


Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.108 
llvm/docs/ProgrammersManual.html:1.109
--- llvm/docs/ProgrammersManual.html:1.108  Fri Feb  2 21:05:57 2007
+++ llvm/docs/ProgrammersManual.htmlFri Feb  2 21:06:52 2007
@@ -1573,7 +1573,7 @@
 This code shows the basic approach used to build recursive types: build a
 non-recursive type using 'opaque', then use type unification to close the 
cycle.
 The type unification step is performed by the tta
-ref=#refineAbstractTypeTorefineAbstractTypeTo/a/tt method, which is
+href=#refineAbstractTypeTorefineAbstractTypeTo/a/tt method, which is
 described next.  After that, we describe the a
 href=#PATypeHolderPATypeHolder class/a.
 /p
@@ -2750,11 +2750,6 @@
   this constant. /li
 /ul
   /li
-ul
-  littbool getValue() const/tt: Returns the underlying value of this 
-  constant. /li
-/ul
-  /li
   liConstantArray : This represents a constant array.
 ul
   littconst std::vectorlt;Usegt; amp;getValues() const/tt: 
Returns 
@@ -2796,7 +2791,7 @@
   a href=mailto:[EMAIL PROTECTED]Dinakar Dhurjati/a and
   a href=mailto:[EMAIL PROTECTED]Chris Lattner/abr
   a href=http://llvm.org;The LLVM Compiler Infrastructure/abr
-  Last modified: $Date: 2007/02/03 03:05:57 $
+  Last modified: $Date: 2007/02/03 03:06:52 $
 /address
 
 /body



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] More TargetData mods...

2007-02-02 Thread Scott Michel
Revamped the TargetData spec string so that alignments for differently
sized types can be more flexibly specified. Also added support for
vector alignments (32 and 64 bits). The default spec string now looks
like:

  E-p:64:64:64-a0:0:0-f32:32:32-f64:0:64
  -i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:0:64
  -v64:64:64-v128:128:128

Although, it should be noted, that this isn't actually parsed (it's the
result of calling TargetData::getRepresentation()).  Internally, a
SmallVector is created with these various and sundry types, sizes and
alignments.

Gratuitously changed getTypeAlignmentABI to getABITypeAlignment
and getTypeAlignmentPref to getPrefTypeAlignment.

Slimmed down the TargetData code so that there are fewer moving
parts -- if changes have to be made, it's should be more maintainable.


-scooter
-- 
Scott Michel  [EMAIL PROTECTED]
High Performance Hardware Section Manager 310/336-5034
Computer Systems Research Department
The Aerospace Corporation
Index: include/llvm/Target/TargetData.h
===
--- include/llvm/Target/TargetData.h	(.../trunk)	(revision 423)
+++ include/llvm/Target/TargetData.h	(.../branches/llvm-spu)	(revision 423)
@@ -23,6 +23,7 @@
 #include llvm/Pass.h
 #include llvm/Support/DataTypes.h
 #include vector
+#include llvm/ADT/SmallVector.h
 #include string
 
 namespace llvm {
@@ -33,45 +34,120 @@
 class StructLayout;
 class GlobalVariable;
 
+/// Enum used to categorize the alignment types stored by TargetAlignElem
+enum AlignTypeEnum {
+  INTEGER_ALIGN = 'i',   /// Integer type alignment
+  PACKED_ALIGN = 'v',/// Vector type alignment
+  FLOAT_ALIGN = 'f', /// Floating point type alignment
+  AGGREGATE_ALIGN = 'a'  /// Aggregate alignment
+};
+/// Target alignment element.
+///
+/// Stores the alignment data associated with a given alignment type (pointer,
+/// integer, packed/vector, float) and type bit width.
+///
+/// @note The unusual order of elements in the structure attempts to reduce
+/// padding and make the structure slightly more cache friendly.
+struct TargetAlignElem {
+  unsigned char   AlignType;  // Alignment type (AlignTypeEnum)
+  unsigned char   ABIAlign;   // ABI alignment for this type/bitw
+  unsigned char   PrefAlign;  // Preferred alignment for this type/bitw
+  short   TypeBitWidth;   // Type bit width
+
+  /// Default constructor
+  TargetAlignElem();
+  /// Full constructor
+  TargetAlignElem(AlignTypeEnum align_type, unsigned char abi_align,
+  unsigned char pref_align, short bit_width);
+  /// Copy constructor
+  TargetAlignElem(const TargetAlignElem src);
+  /// Destructor
+  ~TargetAlignElem() { }
+  /// Assignment operator
+  TargetAlignElem operator=(const TargetAlignElem rhs);
+  /// Less-than predicate
+  bool operator(const TargetAlignElem rhs) const;
+  /// Equality predicate
+  bool operator==(const TargetAlignElem rhs) const;
+  /// output stream operator
+  std::ostream dump(std::ostream os) const;
+};
+
+/// Output stream inserter
+/// @sa TargetAlignElem::dump()
+std::ostream operator(std::ostream os, const TargetAlignElem elem);
+
+/// Target alignment container
+///
+/// This is the container for most primitive types' alignment, i.e., integer,
+/// floating point, vectors and aggregates.
+class TargetAlign : public SmallVectorTargetAlignElem, 16 {
+private:
+  /// Invalid alignment
+  /// This member is a signal that a requested alignment type and
+  /// bit width were not found in the SmallVector.
+  static const TargetAlignElem InvalidAlignmentElem;
+public:
+  /// Default constructor
+  TargetAlign();
+  /// Destructor
+  ~TargetAlign() { }
+  /// Copy constructor
+  TargetAlign(const TargetAlign src);
+  /// Assignment operator
+  TargetAlign operator=(const TargetAlign rhs);
+  /// Add elements to the container.
+  ///
+  /// Adds elements to the container, keeping the container sorted. If the
+  /// requested alignment type (@a align_type) and bit width (@a bit_width)
+  /// exist in the container, then the matching element's ABI and preferred
+  /// alignments are overwritten with @a abi_align and @a pref_align.
+  void set(AlignTypeEnum align_type, short bit_width, unsigned char abi_align,
+   unsigned char pref_align);
+  /// Get the data associated with a given alignment type and bit width.
+  ///
+  /// @return InvalidAlignmentElem if not found, otherwise, the matching
+  /// TargetAlignElem.
+  const TargetAlignElem get(AlignTypeEnum align_type, short bit_width) const;
+  /// Valid alignment predicate.
+  ///
+  /// Predicate that tests a TargetAlignElem reference returned by get() against
+  /// InvalidAlignmentElem.
+  inline bool valid(const TargetAlignElem align) const {
+return (align != InvalidAlignmentElem);
+  }
+};
+
 class TargetData : public ImmutablePass {
-  bool  LittleEndian;  // 

[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/MiBench/consumer-typeset/z49.c

2007-02-02 Thread Reid Spencer


Changes in directory llvm-test/MultiSource/Benchmarks/MiBench/consumer-typeset:

z49.c updated: 1.2 - 1.3
---
Log message:

Terminate line to pretty up the output.


---
Diffs of the changes:  (+1 -1)

 z49.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm-test/MultiSource/Benchmarks/MiBench/consumer-typeset/z49.c
diff -u llvm-test/MultiSource/Benchmarks/MiBench/consumer-typeset/z49.c:1.2 
llvm-test/MultiSource/Benchmarks/MiBench/consumer-typeset/z49.c:1.3
--- llvm-test/MultiSource/Benchmarks/MiBench/consumer-typeset/z49.c:1.2 Thu Jan 
11 21:48:22 2007
+++ llvm-test/MultiSource/Benchmarks/MiBench/consumer-typeset/z49.c Fri Feb 
 2 22:24:17 2007
@@ -417,7 +417,7 @@
   else
 p0(%!PS-Adobe-3.0\n);
   p1(Creator: %s\n, LOUT_VERSION);
-  p0(CreationDate: Sometime Today);
+  p0(CreationDate: Sometime Today\n);
   p0(%%DocumentData: Binary\n);
   p0(%%DocumentNeededResources: (atend)\n);
   p0(%%DocumentSuppliedResources: (atend)\n);



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/MultiSource/Applications/oggenc/Makefile

2007-02-02 Thread Reid Spencer


Changes in directory llvm-test/MultiSource/Applications/oggenc:

Makefile updated: 1.1 - 1.2
---
Log message:

For PR1159: http://llvm.org/PR1159 :
Avoid going to LLVM assembly files at all to improve performance of the
nightly test. Bytecode is now processed like this:

llvm-gcc -c -emit-llvm %.c -o %.bc
gccld -disable-opt -link-as-library *.bc -o %.linked.rbc
opt -std-compile-opts %.linked.rbc -o %.linked.bc
gccld %.linked.bc -o %.llvm

This eliminates one gccas invocation for each source file compilation, and 
two translations between .ll and .bc.


---
Diffs of the changes:  (+2 -2)

 Makefile |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm-test/MultiSource/Applications/oggenc/Makefile
diff -u llvm-test/MultiSource/Applications/oggenc/Makefile:1.1 
llvm-test/MultiSource/Applications/oggenc/Makefile:1.2
--- llvm-test/MultiSource/Applications/oggenc/Makefile:1.1  Sat Jan 21 
08:50:01 2006
+++ llvm-test/MultiSource/Applications/oggenc/Makefile  Fri Feb  2 22:30:17 2007
@@ -1,8 +1,8 @@
 LEVEL = ../../..
 PROG = oggenc
 
-CPPFLAGS =
-LDFLAGS  = -lm
+CPPFLAGS := -g
+LDFLAGS  := -lm
 
 STDIN_FILENAME = $(SourceDir)/tune
 RUN_OPTIONS=-Q -s 901820 -



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/MultiSource/Makefile.multisrc

2007-02-02 Thread Reid Spencer


Changes in directory llvm-test/MultiSource:

Makefile.multisrc updated: 1.56 - 1.57
---
Log message:

For PR1159: http://llvm.org/PR1159 :
Avoid going to LLVM assembly files at all to improve performance of the
nightly test. Bytecode is now processed like this:

llvm-gcc -c -emit-llvm %.c -o %.bc
gccld -disable-opt -link-as-library *.bc -o %.linked.rbc
opt -std-compile-opts %.linked.rbc -o %.linked.bc
gccld %.linked.bc -o %.llvm

This eliminates one gccas invocation for each source file compilation, and 
two translations between .ll and .bc.


---
Diffs of the changes:  (+2 -14)

 Makefile.multisrc |   16 ++--
 1 files changed, 2 insertions(+), 14 deletions(-)


Index: llvm-test/MultiSource/Makefile.multisrc
diff -u llvm-test/MultiSource/Makefile.multisrc:1.56 
llvm-test/MultiSource/Makefile.multisrc:1.57
--- llvm-test/MultiSource/Makefile.multisrc:1.56Thu Jan 11 18:58:38 2007
+++ llvm-test/MultiSource/Makefile.multisrc Fri Feb  2 22:30:17 2007
@@ -20,13 +20,13 @@
 include $(LEVEL)/Makefile.programs
 
 # Figure out what object files we want to build...
-LObjs:= $(sort $(addsuffix .rbc, $(notdir $(basename $(Source)
+LObjs:= $(sort $(addsuffix .bc, $(notdir $(basename $(Source)
 LObjects := $(addprefix Output/,$(LObjs))
 
 NObjs:= $(sort $(addsuffix .o, $(notdir $(basename $(Source)
 NObjects := $(addprefix Output/,$(NObjs))
 
-.PRECIOUS: $(LObjects) $(NObjects) Output/%.linked.rll
+.PRECIOUS: $(LObjects) $(NObjects)
 
 Output/%.o: %.c Output/.dir
-$(CC) $(CPPFLAGS) $(CFLAGS) -O2 $(TARGET_FLAGS) -c $ -o $@
@@ -48,11 +48,6 @@
 bugpoint-cbe:   Output/$(PROG).bugpoint-cbe
 misopt: Output/$(PROG).misopt.out
 
-# Raw bytecode files are files created by simply assembling the output of the
-# GCC frontend, without running any optimizations.
-#
-Output/%.rbc: Output/%.ll $(LGCCAS)
-   -$(LGCCAS) -disable-opt $ -o $@
 
 ifndef USE_PRECOMPILED_BYTECODE
 
@@ -60,13 +55,6 @@
 Output/%.linked.rbc: $(LObjects) $(LGCCLDPROG)
-$(LGCCLDPROG) -link-as-library -disable-opt $(LObjects) -o $@
 
-# Output/*.linked.ll is all of the bytecode files of the program linked 
together
-# without any libraries linked in...
-#
-$(PROGRAMS_TO_TEST:%=Output/%.linked.rll): \
-Output/%.linked.rll: Output/%.linked.rbc $(LDIS)
-   -$(LDIS) $ -o $@ -f
-
 $(PROGRAMS_TO_TEST:%=Output/%.LOC.txt): \
 Output/%.LOC.txt: $(Source)
cat $^ $(wildcard $(SourceDir)/*.h) | wc -l  $@



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/Makefile.programs Makefile.tests TEST.nightly.Makefile

2007-02-02 Thread Reid Spencer


Changes in directory llvm-test:

Makefile.programs updated: 1.251 - 1.252
Makefile.tests updated: 1.13 - 1.14
TEST.nightly.Makefile updated: 1.44 - 1.45
---
Log message:

For PR1159: http://llvm.org/PR1159 :
Avoid going to LLVM assembly files at all to improve performance of the
nightly test. Bytecode is now processed like this:

llvm-gcc -c -emit-llvm %.c -o %.bc
gccld -disable-opt -link-as-library *.bc -o %.linked.rbc
opt -std-compile-opts %.linked.rbc -o %.linked.bc
gccld %.linked.bc -o %.llvm

This eliminates one gccas invocation for each source file compilation, and 
two translations between .ll and .bc.


---
Diffs of the changes:  (+22 -30)

 Makefile.programs |   24 +++-
 Makefile.tests|   22 --
 TEST.nightly.Makefile |6 +++---
 3 files changed, 22 insertions(+), 30 deletions(-)


Index: llvm-test/Makefile.programs
diff -u llvm-test/Makefile.programs:1.251 llvm-test/Makefile.programs:1.252
--- llvm-test/Makefile.programs:1.251   Thu Feb  1 17:46:22 2007
+++ llvm-test/Makefile.programs Fri Feb  2 22:30:17 2007
@@ -44,7 +44,7 @@
 
 .PRECIOUS: Output/%.llvm Output/%.native Output/%.llc Output/%.llc.s
 .PRECIOUS: Output/%.cbe Output/%.cbe.c Output/%.llvm.bc
-.PRECIOUS: Output/%.linked.bc 
+.PRECIOUS: Output/%.linked.bc
 
 # If we're using the llvm-gcc3 compiler then we need to also link with the
 # llvm c runtime library, othwerwise we don't
@@ -233,11 +233,12 @@
 print-llcbeta-option:
@echo $(LLCBETAOPTION)
 
-# Given a version of the entire program linked together into a single unit of
-# raw output from the C frontend, optimize it.
+# Given an unoptimized bytecode file that is a simple linkage of all
+# the program's bytecode files, optimize the program using the
+# standard compilation optimizations.
 $(PROGRAMS_TO_TEST:%=Output/%.linked.bc): \
-Output/%.linked.bc: Output/%.linked.rll $(LGCCAS)
-   -$(LGCCAS) $(STATS) $(EXTRA_GCCAS_OPTIONS) $ -o $@
+Output/%.linked.bc: Output/%.linked.rbc $(LOPT)
+   -$(LOPT) -std-compile-opts $(STATS) $(EXTRA_LOPT_OPTIONS) $ -o $@
 
 $(PROGRAMS_TO_TEST:%=Output/%.llvm.stripped.bc): \
 Output/%.llvm.stripped.bc: Output/%.llvm.bc $(LOPT)
@@ -285,9 +286,11 @@
 endif   # ifndef DISABLE_FOR_LLVM_PROGRAMS
 
 # Targets to get the pass arguments that gccas and gccld are using...
-Output/gccas-pass-args: $(LGCCAS) Output/.dir
-   -$(LGCCAS) $(EXTRA_GCCAS_OPTIONS) /dev/null -o /dev/null 
-debug-pass=Arguments  [EMAIL PROTECTED] 21
-   sed 's/Pass Arguments: //'  [EMAIL PROTECTED] | sed 
's/-emitbytecode//'  $@
+Output/opt-pass-args: $(LOPT) Output/.dir
+   -$(LLVMAS)  /dev/null -o - | \
+ $(LOPT) $(EXTRA_LOPT_OPTIONS) -disable-output -debug-pass=Arguments 
21 | \
+ sed 's/Pass Arguments: //' | sed 's/-emitbytecode//'  $@
+
 Output/gccld-pass-args: $(LGCCLDPROG) Output/.dir
$(LLVMAS)  /dev/null  Output/gccld.test.bc
$(LGCCLD) Output/gccld.test.bc -o Output/gccld.test-out 
-debug-pass=Arguments  [EMAIL PROTECTED] 21
@@ -575,11 +578,6 @@
 Output/%.out-nat: $(SRCDIR)/%.reference_output Output/.dir
cp $ $@
 
-# To make a raw bytecode file up-to-date, just copy it over.
-$(PROGRAMS_TO_TEST:%=Output/%.linked.rll): \
-Output/%.linked.rll: $(SRCDIR)/%.linked.rll Output/.dir
-   cp $ $@
-
 $(PROGRAMS_TO_TEST:%=Output/%.LOC.txt): \
 Output/%.LOC.txt: $(SRCDIR)/%.LOC.txt Output/.dir
cp $ $@


Index: llvm-test/Makefile.tests
diff -u llvm-test/Makefile.tests:1.13 llvm-test/Makefile.tests:1.14
--- llvm-test/Makefile.tests:1.13   Sun Dec  3 15:15:49 2006
+++ llvm-test/Makefile.testsFri Feb  2 22:30:17 2007
@@ -49,31 +49,25 @@
$(RM) -rf Output/
 
 # Compile from X.c to Output/X.ll
-Output/%.ll: %.c $(LCC1) Output/.dir $(INCLUDES)
-   -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) $(TARGET_FLAGS) -O0 -S $ -o $@ 
-emit-llvm
+Output/%.bc: %.c $(LCC1) Output/.dir $(INCLUDES)
+   -$(LLVMGCC) $(CPPFLAGS) $(LCCFLAGS) $(TARGET_FLAGS) -O0 -c $ -o $@ 
-emit-llvm
-$(call UPGRADE_LL,$@)
 
 # Compile from X.cpp to Output/X.ll
-Output/%.ll: %.cpp $(LCC1XX) Output/.dir $(INCLUDES)
-   -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -S $ -o $@ 
-emit-llvm
+Output/%.bc: %.cpp $(LCC1XX) Output/.dir $(INCLUDES)
+   -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -c $ -o $@ 
-emit-llvm
-$(call UPGRADE_LL,$@)
 
 # Compile from X.cc to Output/X.ll
-Output/%.ll: %.cc $(LCC1XX) Output/.dir $(INCLUDES)
-   -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -S $ -o $@ 
-emit-llvm
+Output/%.bc: %.cc $(LCC1XX) Output/.dir $(INCLUDES)
+   -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -c $ -o $@ 
-emit-llvm
-$(call UPGRADE_LL,$@)
 
 # Compile from X.C to Output/X.ll
-Output/%.ll: %.C $(LCC1XX) Output/.dir $(INCLUDES)
-   -$(LLVMGXX) $(CPPFLAGS) $(LCXXFLAGS) $(TARGET_FLAGS) -O0 -S $ -o $@ 
-emit-llvm
+Output/%.bc: %.C $(LCC1XX) Output/.dir $(INCLUDES)
+   -$(LLVMGXX) $(CPPFLAGS) 

[llvm-commits] CVS: llvm-test/External/Makefile.external

2007-02-02 Thread Reid Spencer


Changes in directory llvm-test/External:

Makefile.external updated: 1.3 - 1.4
---
Log message:

For PR1159: http://llvm.org/PR1159 :
Avoid going to LLVM assembly files at all to improve performance of the
nightly test. Bytecode is now processed like this:

llvm-gcc -c -emit-llvm %.c -o %.bc
gccld -disable-opt -link-as-library *.bc -o %.linked.rbc
opt -std-compile-opts %.linked.rbc -o %.linked.bc
gccld %.linked.bc -o %.llvm

This eliminates one gccas invocation for each source file compilation, and 
two translations between .ll and .bc.


---
Diffs of the changes:  (+0 -1)

 Makefile.external |1 -
 1 files changed, 1 deletion(-)


Index: llvm-test/External/Makefile.external
diff -u llvm-test/External/Makefile.external:1.3 
llvm-test/External/Makefile.external:1.4
--- llvm-test/External/Makefile.external:1.3Sun Sep  5 02:56:51 2004
+++ llvm-test/External/Makefile.externalFri Feb  2 22:30:17 2007
@@ -7,4 +7,3 @@
 
##===--===##
 
 include $(LEVEL)/Makefile.programs
-.PRECIOUS: Output/%.linked.rll



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm-test/MultiSource/Applications/oggenc/Makefile

2007-02-02 Thread Reid Spencer


Changes in directory llvm-test/MultiSource/Applications/oggenc:

Makefile updated: 1.2 - 1.3
---
Log message:

Revert last patch, committed accidentally.


---
Diffs of the changes:  (+2 -2)

 Makefile |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm-test/MultiSource/Applications/oggenc/Makefile
diff -u llvm-test/MultiSource/Applications/oggenc/Makefile:1.2 
llvm-test/MultiSource/Applications/oggenc/Makefile:1.3
--- llvm-test/MultiSource/Applications/oggenc/Makefile:1.2  Fri Feb  2 
22:30:17 2007
+++ llvm-test/MultiSource/Applications/oggenc/Makefile  Fri Feb  2 22:34:05 2007
@@ -1,8 +1,8 @@
 LEVEL = ../../..
 PROG = oggenc
 
-CPPFLAGS := -g
-LDFLAGS  := -lm
+CPPFLAGS =
+LDFLAGS  = -lm
 
 STDIN_FILENAME = $(SourceDir)/tune
 RUN_OPTIONS=-Q -s 901820 -



___
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits


[llvm-commits] CVS: llvm/docs/ProgrammersManual.html

2007-02-02 Thread Chris Lattner


Changes in directory llvm/docs:

ProgrammersManual.html updated: 1.109 - 1.110
---
Log message:

fill in the section on Set-like containers.


---
Diffs of the changes:  (+218 -20)

 ProgrammersManual.html |  238 -
 1 files changed, 218 insertions(+), 20 deletions(-)


Index: llvm/docs/ProgrammersManual.html
diff -u llvm/docs/ProgrammersManual.html:1.109 
llvm/docs/ProgrammersManual.html:1.110
--- llvm/docs/ProgrammersManual.html:1.109  Fri Feb  2 21:06:52 2007
+++ llvm/docs/ProgrammersManual.htmlSat Feb  3 01:59:07 2007
@@ -46,17 +46,28 @@
   /li
   lia href=#datastructurePicking the Right Data Structure for a Task/a
 ul
-lia href=#ds_sequentialSequential Containers (std::vector, 
std::list, etc)/aul
-lia href=#dss_fixedarraysFixed Size Arrays/a/li
-lia href=#dss_heaparraysHeap Allocated Arrays/a/li
-lia href=#dss_smallvectorllvm/ADT/SmallVector.h/a/li
-lia href=#dss_vectorlt;vectorgt;/a/li
-lia href=#dss_ilistllvm/ADT/ilist/a/li
-lia href=#dss_listlt;listgt;/a/li
+lia href=#ds_sequentialSequential Containers (std::vector, 
std::list, etc)/a
+ul
+  lia href=#dss_fixedarraysFixed Size Arrays/a/li
+  lia href=#dss_heaparraysHeap Allocated Arrays/a/li
+  lia href=#dss_smallvectorllvm/ADT/SmallVector.h/a/li
+  lia href=#dss_vectorlt;vectorgt;/a/li
+  lia href=#dss_dequelt;dequegt;/a/li
+  lia href=#dss_listlt;listgt;/a/li
+  lia href=#dss_ilistllvm/ADT/ilist/a/li
+/ul/li
+lia href=#ds_setSet-Like Containers (std::set, SmallSet, SetVector, 
etc)/a
+ul
+  lia href=#dss_sortedvectorsetA sorted 'vector'/a/li
+  lia href=#dss_smallsetllvm/ADT/SmallSet.h/a/li
+  lia href=#dss_smallptrsetllvm/ADT/SmallPtrSet.h/a/li
+  lia href=#dss_FoldingSetllvm/ADT/FoldingSet.h/a/li
+  lia href=#dss_setlt;setgt;/a/li
+  lia href=#dss_setvectorllvm/ADT/SetVector.h/a/li
+  lia href=#dss_othersetOther Options/a/li
 /ul/li
-lia href=#ds_setSet-Like Containers (std::set, SmallSet, SetVector, 
etc)/a/li
 lia href=#ds_mapMap-Like Containers (std::map, DenseMap, 
etc)/a/li
-/ul
+  /ul
   /li
   lia href=#commonHelpful Hints for Common Operations/a
 ul
@@ -784,6 +795,22 @@
 
 !-- ___ 
--
 div class=doc_subsubsection
+  a name=dss_dequelt;dequegt;/a
+/div
+
+div class=doc_text
+pstd::deque is, in some senses, a generalized version of std::vector.  Like
+std::vector, it provides constant time random access and other similar
+properties, but it also provides efficient access to the front of the list.  It
+does not guarantee continuity of elements within memory./p
+
+pIn exchange for this extra flexibility, std::deque has significantly higher
+constant factor costs than std::vector.  If possible, use std::vector or
+something cheaper./p
+/div
+
+!-- ___ 
--
+div class=doc_subsubsection
   a name=dss_listlt;listgt;/a
 /div
 
@@ -827,9 +854,7 @@
 /div
 
 div class=doc_text
-pOther STL containers are available, such as std::deque (which has similar
-characteristics to std::vector, but has higher constant factors and provides
-efficient push_front/pop_front methods) and std::string./p
+pOther STL containers are available, such as std::string./p
 
 pThere are also various STL adapter classes such as std::queue,
 std::priority_queue, std::stack, etc.  These provide simplified access to an
@@ -845,18 +870,190 @@
 
 div class=doc_text
 
+pSet-like containers are useful when you need to canonicalize multiple values
+into a single representation.  There are several different choices for how to 
do
+this, providing various trade-offs./p
+
+/div
+
+
+!-- ___ 
--
+div class=doc_subsubsection
+  a name=dss_sortedvectorsetA sorted 'vector'/a
+/div
+
+div class=doc_text
+
+pIf you intend to insert a lot of elements, then do a lot of queries, one
+great approach is to use a vector (or other sequential container), and then use
+std::sort+std::unique to remove duplicates.  This approach works really well if
+your usage pattern has these two distinct phases (insert then query), and,
+coupled with a good choice of a href=#ds_sequentialsequential container/a
+can provide the several nice properties: the result data is contiguous in 
memory
+(good for cache locality), has few allocations, is easy to address (iterators 
in
+the final vector are just indices or pointers), and can be efficiently queried
+with a standard binary search./p
+
+/div
+
+!-- ___ 
--
+div class=doc_subsubsection
+  a name=dss_smallsetllvm/ADT/SmallSet.h/a
+/div
+
+div class=doc_text
+
+pIf you have a set-like datastructure that is usually small and whose 
elements
+are reasonably small, a ttSmallSetlt;Type, Ngt; is a good choice.  This set