Commit Graph

29723 Commits

Author SHA1 Message Date
Reid Spencer dc83457a78 Format the examples correctly.
llvm-svn: 33804
2007-02-03 00:32:23 +00:00
Reid Spencer f3293bad2e For PR1152:
Update documentation to reflect addition of gccas functionality into opt.

llvm-svn: 33803
2007-02-03 00:21:56 +00:00
Lauro Ramos Venancio 1a0ae50528 Improves alloca test. Verifies SP restoration.
llvm-svn: 33802
2007-02-03 00:16:21 +00:00
Chris Lattner 1bfc7ab6a7 Switch inliner over to use DenseMap instead of std::map for ValueMap. This
speeds up the inliner 16%.

llvm-svn: 33801
2007-02-03 00:08:31 +00:00
Lauro Ramos Venancio b739f7d337 bugfix: SP isn't resetted when function has FP and there is no spills.
llvm-svn: 33800
2007-02-02 23:08:40 +00:00
Chris Lattner fc8190dbb7 Switch this back to using an std::map. DenseMap entries are getting invalidated
llvm-svn: 33799
2007-02-02 22:36:16 +00:00
Reid Spencer 697f1104e7 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).

llvm-svn: 33798
2007-02-02 21:49:27 +00:00
Chris Lattner f4af392bd9 silence annoying warning in release-asserts build
llvm-svn: 33797
2007-02-02 21:19:18 +00:00
Chris Lattner 37d400a83d Remove more malloc thrashing, this speeds up IPSCCP on kimwitu another 6.7%.
llvm-svn: 33796
2007-02-02 21:15:06 +00:00
Evan Cheng f089c99f1d Another thumb large stack offset codegen bug.
llvm-svn: 33795
2007-02-02 21:08:39 +00:00
Chris Lattner 3e667f3e61 Convert an std::set to SmallSet, this speeds up IPSCCP 17% on kimwitu.
llvm-svn: 33794
2007-02-02 20:57:39 +00:00
Chris Lattner 0e7ec675da eliminate a malloc/free for (almost) every GEP processed. This speeds up
IPSCCP 3.3% on kimwitu.

llvm-svn: 33793
2007-02-02 20:51:48 +00:00
Chris Lattner 067d607e0e switch hash_map's over to DenseMap in SCCP. This speeds up SCCP by 30% in
a release-assert build on kimwitu++.

llvm-svn: 33792
2007-02-02 20:38:30 +00:00
Chris Lattner 1a49acad38 add find/erase, add const iterators, fix bugs in iterators.
llvm-svn: 33791
2007-02-02 20:34:32 +00:00
Chris Lattner 5b8ecfdb89 add iterators
llvm-svn: 33790
2007-02-02 19:27:13 +00:00
Evan Cheng d9d94700a4 Use MBB.empty() instead of MBB.size() for speed.
llvm-svn: 33789
2007-02-02 19:09:19 +00:00
Evan Cheng 3ad22567b3 Watch out for empty BB.
llvm-svn: 33788
2007-02-02 18:49:02 +00:00
Reid Spencer 583c90d4c2 For PR1152:
Step 2: Make plug compatible shell script to replace gccas binary.

llvm-svn: 33787
2007-02-02 15:50:58 +00:00
Reid Spencer 22dbfb626f For 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.

llvm-svn: 33786
2007-02-02 14:46:29 +00:00
Reid Spencer 2f34b98cbf Remove dead code and fix indentation per Chris' review comments.
llvm-svn: 33785
2007-02-02 14:41:37 +00:00
Reid Spencer 5dc84cdab7 Use short form of BinaryOperator create function.
llvm-svn: 33784
2007-02-02 14:09:34 +00:00
Reid Spencer 0d5f9237b6 Use short form of binary operator create functions.
llvm-svn: 33783
2007-02-02 14:08:20 +00:00
Reid Spencer 2ab0193da1 Put the Shift instructions in the right section.
llvm-svn: 33782
2007-02-02 13:57:07 +00:00
Reid Spencer 0cdd04fa90 Fix a comment that needed to change after SHIFT patch landed.
llvm-svn: 33781
2007-02-02 13:54:55 +00:00
Evan Cheng fda6550545 Ugh. Only meant to do this in thumb mode.
llvm-svn: 33780
2007-02-02 08:58:48 +00:00
Chris Lattner d5fea61d98 bugfix for reid's shift patch.
llvm-svn: 33779
2007-02-02 05:29:55 +00:00
Chris Lattner 2d5b4ac38f add a note
llvm-svn: 33778
2007-02-02 04:36:46 +00:00
Reid Spencer b958c7ec8a 1. Break long lines to 80 col limit
2. Fix indentation
3. Renumber the instruction opcodes after the Shift became a binary operator.

llvm-svn: 33777
2007-02-02 02:30:19 +00:00
Reid Spencer 2341c22ec7 Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Evan Cheng 48b094d9dd Fix a bug in getARMCMP (which translate CondCode to ARM specific CC) when the RHS is a constant.
llvm-svn: 33775
2007-02-02 01:53:26 +00:00
Evan Cheng 9b9e4ae796 Thumb does not have clz.
llvm-svn: 33773
2007-02-01 23:34:03 +00:00
Devang Patel b8a29bdde9 Dump function names when debug-pass=Executions is used.
llvm-svn: 33772
2007-02-01 22:38:33 +00:00
Chris Lattner c904205d28 Fix Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll, a serious code
pessimization where instcombine can sink a load (good for code size) that
prevents an alloca from being promoted by mem2reg (bad for everything).

llvm-svn: 33771
2007-02-01 22:30:07 +00:00
Chris Lattner 9a677c585c new testcase for serious code pessimization
llvm-svn: 33770
2007-02-01 22:29:26 +00:00
Reid Spencer 26cc265311 My mistake, my environment wasn't up to date. This passes now.
llvm-svn: 33769
2007-02-01 22:26:42 +00:00
Reid Spencer a5dc052682 XFAIL this on x86 linux as it continues to fail.
llvm-svn: 33768
2007-02-01 22:10:46 +00:00
Devang Patel 04bb891670 Pretty print pass managers.
llvm-svn: 33767
2007-02-01 22:10:12 +00:00
Devang Patel f7fea8adf3 Pretty print pass manager
llvm-svn: 33766
2007-02-01 22:09:37 +00:00
Devang Patel e3858e6674 cvs commit
llvm-svn: 33765
2007-02-01 22:08:25 +00:00
Reid Spencer a8ee496f9e Make sure the value passed to test function is initialized.
llvm-svn: 33764
2007-02-01 21:58:46 +00:00
Lauro Ramos Venancio 2c355da986 Define PrivateGlobalPrefix for ARM Linux. (Fix CodeGen/ARM/large_stack.ll)
llvm-svn: 33763
2007-02-01 21:43:53 +00:00
Evan Cheng fd522996c8 Pasto. Lots of it.
llvm-svn: 33762
2007-02-01 20:44:52 +00:00
Reid Spencer 26c642de74 Ensure that ConvertOperandToType generates a result conversion by
initializing the Res variable to 0 and asserting it is not zero after the
result should have been created.

llvm-svn: 33761
2007-02-01 19:14:51 +00:00
Chris Lattner ce494229a1 Fix bugs in the inliner having to do with single-entry phi nodes and valuemap
updating.  These were exposed by Devang's recent passmgr changes (with
non-default passorderings) because now the inliner can be interleved with
the LCSSA pass.

llvm-svn: 33760
2007-02-01 18:48:38 +00:00
Lauro Ramos Venancio 903e01d407 Fix .thumb_func directive on linux.
llvm-svn: 33759
2007-02-01 18:25:34 +00:00
Jim Laskey f970221c4d Slip up
llvm-svn: 33758
2007-02-01 17:48:20 +00:00
Jim Laskey 894ceb1c6f Emit labels as label_n and not as debug_n
llvm-svn: 33757
2007-02-01 17:46:10 +00:00
Andrew Lenharth dd924e4e95 preserve sections of globals
llvm-svn: 33756
2007-02-01 17:12:54 +00:00
Jim Laskey c3de9b4b14 Support for non-landing pad exception handling.
llvm-svn: 33755
2007-02-01 16:31:34 +00:00
Reid Spencer e15a8b7a55 Fix a homonymo in a comment.
llvm-svn: 33754
2007-02-01 12:09:51 +00:00
Evan Cheng f9a4c690de - Off by one bugs in maximum displacement calculation / testing.
- In thumb mode, a new constpool island BB size should be 4 + 2 to
  compensate for the potential padding due to alignment requirement.

llvm-svn: 33753
2007-02-01 10:16:15 +00:00
Anton Korobeynikov 1b4e6015b4 Fixed uninitialized stuff inside LegalizeDAG. Fortunately, the only
affected part is codegen of "memove" inside x86 backend. This fixes
PR1144

llvm-svn: 33752
2007-02-01 08:39:52 +00:00
Chris Lattner 8001a63281 Add a new dense hash table implementation
llvm-svn: 33751
2007-02-01 07:49:59 +00:00
Chris Lattner 4f5cdecde3 improve comments, add an assertion
llvm-svn: 33750
2007-02-01 05:33:21 +00:00
Chris Lattner 1003dc72b4 rename DenseMap to IndexedMap.
llvm-svn: 33749
2007-02-01 05:32:05 +00:00
Chris Lattner dcdfa788b1 rename DenseMap -> IndexedMap.
llvm-svn: 33748
2007-02-01 05:28:10 +00:00
Chris Lattner f14c76cf5d silence some warnings when assertions are disabled.
llvm-svn: 33747
2007-02-01 04:59:37 +00:00
Chris Lattner 104fc7f823 silence warning
llvm-svn: 33746
2007-02-01 04:57:00 +00:00
Chris Lattner 296a83cefb Fit in 80 columns
llvm-svn: 33745
2007-02-01 04:55:59 +00:00
Evan Cheng 06736d0f88 .set pc relative displacement bug: label should be moved down one instruction
to just before the add r1, pc:

Before:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        mov r1, #PCRELV0
        add r1, pc

Now:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
        mov r1, #PCRELV0
LPCRELL0:
        add r1, pc

llvm-svn: 33744
2007-02-01 03:04:49 +00:00
Evan Cheng 0df1536173 Add a note.
llvm-svn: 33743
2007-02-01 02:46:20 +00:00
Evan Cheng 210cbc43a8 Add a test case.
llvm-svn: 33742
2007-02-01 02:27:24 +00:00
Evan Cheng e724492566 Also set alignment of stack-based structs to 4 in thumb mode.
llvm-svn: 33741
2007-02-01 02:18:36 +00:00
Evan Cheng c79b96b00d Added a thumb vararg test.
llvm-svn: 33740
2007-02-01 01:56:43 +00:00
Evan Cheng e7e966de5e Special epilogue for vararg functions. We cannot do a pop to pc because
there follows a sp increment for the va register save region. Instead issue
a separate pop to another register, increment sp, and then return:
        pop {r4, r5, r6, r7}
        pop {r3}
        add sp, #3 * 4
        bx r3

llvm-svn: 33739
2007-02-01 01:49:46 +00:00
Devang Patel df4e992af8 Add printVersion(). Linker can use it to print LLVM version number.
llvm-svn: 33738
2007-02-01 01:46:06 +00:00
Devang Patel 9eb2caaeb6 Add PrintVersionMessage() that tools can use to print version number
without exiting program.

llvm-svn: 33737
2007-02-01 01:43:37 +00:00
Chris Lattner e3eeb24a86 Emit a better assertion message for PR1133
llvm-svn: 33736
2007-02-01 01:21:12 +00:00
Devang Patel ea0568392e Include Makefile.config before testing OS.
llvm-svn: 33735
2007-02-01 01:18:57 +00:00
Evan Cheng 234e031e36 Pessmistically assume the .align 2 before the first constpool entry adds
two bytes padding.

llvm-svn: 33734
2007-02-01 01:09:47 +00:00
Evan Cheng 29f920877d Possible JT improvements.
llvm-svn: 33733
2007-02-01 01:07:48 +00:00
Chris Lattner f7937005a3 Fix CodeGen/PowerPC/2007-01-31-InlineAsmAddrMode.ll
llvm-svn: 33732
2007-02-01 00:39:08 +00:00
Chris Lattner 667ff4832e new testcase
llvm-svn: 33731
2007-02-01 00:38:56 +00:00
Evan Cheng b7a08adae6 Fix test case.
llvm-svn: 33730
2007-01-31 23:51:35 +00:00
Evan Cheng ed81dea45b Don't emit unnecessary .align directive.
llvm-svn: 33729
2007-01-31 23:39:39 +00:00
Evan Cheng e5c19993cd Handle an interesting corner case: the constpool_entry being reference is two
instructions away, i.e. its address is equal to PC.
        %r0 = tLDRpci <cp#0>
        bx
        CONSTPOOL_ENTRY 0 <cp#0>, 4

llvm-svn: 33728
2007-01-31 23:35:18 +00:00
Evan Cheng b0ff625a31 Don't want to add FramePtr to callee save spill list twice.
llvm-svn: 33727
2007-01-31 23:17:29 +00:00
Reid Spencer dee14b50e4 Fix build breakage by using correct arguments to getIndexedType in the
GEP constructors.

llvm-svn: 33726
2007-01-31 22:30:26 +00:00
Evan Cheng 53ac41cd54 Fix test cases.
llvm-svn: 33725
2007-01-31 22:27:07 +00:00
Evan Cheng 6f1c20a8e6 Darwin ABI requires FP to point to stack slot of prev FP.
llvm-svn: 33724
2007-01-31 22:25:33 +00:00
Evan Cheng 2e309b15a7 Add entry.
llvm-svn: 33723
2007-01-31 22:11:38 +00:00
Evan Cheng 1c5837dc4a Thumb add sp, #imm requires the immediate value be multiple of 4. For now,
change preferred alignment of short, byte, bool to 4.

llvm-svn: 33722
2007-01-31 22:08:40 +00:00
Evan Cheng ffe1d9f7fa Update comment.
llvm-svn: 33721
2007-01-31 22:06:44 +00:00
Reid Spencer 04e259be5c Preview of the shift instructions becoming Binary Operators.
llvm-svn: 33720
2007-01-31 21:39:12 +00:00
Evan Cheng d7e39eb443 Dead comment.
llvm-svn: 33719
2007-01-31 21:31:25 +00:00
Reid Spencer e7422f6b8d Add some debug output.
llvm-svn: 33718
2007-01-31 21:27:38 +00:00
Evan Cheng 0584836340 Thumb asm syntax does not want 's' suffix for flag setting opcodes.
llvm-svn: 33717
2007-01-31 20:12:31 +00:00
Chris Lattner adb4954d9c shutdown the app when done.
llvm-svn: 33716
2007-01-31 20:10:54 +00:00
Chris Lattner 416a8939c3 remove temporary vectors.
llvm-svn: 33715
2007-01-31 20:08:52 +00:00
Chris Lattner 245ed94b76 add missing ctor
llvm-svn: 33714
2007-01-31 20:08:34 +00:00
Chris Lattner 7a63e7a7ad eliminate temporary vectors
llvm-svn: 33713
2007-01-31 20:07:32 +00:00
Chris Lattner 927653f27f eliminate temporary vectors
llvm-svn: 33712
2007-01-31 19:59:55 +00:00
Evan Cheng 1f3fc4b3f0 When determining whether a pc relative branch / load displacement fits in the
instruction field, adjust it for PC value (4 for thumb, 8 for arm).

llvm-svn: 33711
2007-01-31 19:57:44 +00:00
Chris Lattner 3aefeb957b eliminate a temporary vector while parsing gep's from bc files.
llvm-svn: 33710
2007-01-31 19:56:15 +00:00
Chris Lattner 37ebf9317b A relatively simple PPC optimization.
llvm-svn: 33709
2007-01-31 19:49:20 +00:00
Chris Lattner 79807c3dfe implement the new GEP instruction ctors.
llvm-svn: 33708
2007-01-31 19:47:18 +00:00
Evan Cheng 7169bd8784 Some comments.
llvm-svn: 33707
2007-01-31 18:29:27 +00:00
Evan Cheng 456928bbbc ConstPool island bug: watch out for cases where UserMI is the last MI of the BB.
llvm-svn: 33706
2007-01-31 18:19:07 +00:00
Chris Lattner 4fc18a4cb8 Revert another incorrectly applied chunk, which fixes InstCombine/vec_insert_to_shuffle.ll
llvm-svn: 33705
2007-01-31 18:09:17 +00:00
Chris Lattner 5f8809078f Fix a minor bug in my patch yesterday that broken ConstProp/bswap.ll
llvm-svn: 33704
2007-01-31 18:04:55 +00:00
Lauro Ramos Venancio 7ae4f5599e ARM fix: Miscompilation when frame pointer can't be eliminated. Uninitialized frame pointer register is used.
llvm-svn: 33703
2007-01-31 13:12:46 +00:00
Evan Cheng 143576ddd2 Specify the right CC for comparison libcalls.
llvm-svn: 33702
2007-01-31 09:30:58 +00:00
Evan Cheng 53026f1d5a Allow the target to override the ISD::CondCode that's to be used to test the
result of the comparison libcall against zero.

llvm-svn: 33701
2007-01-31 09:29:11 +00:00
Evan Cheng 98aa8cbf4e Added O_F32 and O_64 in addition to UO_F32 and UO_64 even though by
default they call the same libgcc routine. The result of the calls are
"tested" differently.

llvm-svn: 33700
2007-01-31 09:26:31 +00:00
Evan Cheng 491fcdb49b Observe -soft-float.
llvm-svn: 33699
2007-01-31 08:40:13 +00:00
Chris Lattner 0dbb13735e minor cleanups. Fix off-by-one in accounting the number of nodes when the
table grows.

llvm-svn: 33698
2007-01-31 06:04:41 +00:00
Chris Lattner d700d9dde4 shutdown at end of run
llvm-svn: 33697
2007-01-31 04:45:28 +00:00
Chris Lattner 55ce85c6f9 regenerate
llvm-svn: 33696
2007-01-31 04:44:08 +00:00
Chris Lattner 10aad380f9 eliminate a temporary vector
llvm-svn: 33695
2007-01-31 04:43:46 +00:00
Chris Lattner 64a2909f08 elimiante a temporary vector
llvm-svn: 33694
2007-01-31 04:42:05 +00:00
Chris Lattner f96f4a874c eliminate temporary vectors
llvm-svn: 33693
2007-01-31 04:40:53 +00:00
Chris Lattner 302116a5ec Revise APIs for creating constantexpr GEPs to not require the use of vectors.
This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs.

llvm-svn: 33692
2007-01-31 04:40:28 +00:00
Chris Lattner 64488b1cc3 Revise APIs for creating constantexpr GEPs to not require the use of
vectors.  This allows us to eliminate many temporary vectors, and their
associated malloc/free pairs.

llvm-svn: 33691
2007-01-31 04:39:29 +00:00
Evan Cheng 345877e77c - Added Thumb constpool island support.
- Islands are inserted right after the user MI since thumb LDR cannot encode
  negative offset.

llvm-svn: 33690
2007-01-31 02:22:22 +00:00
Reid Spencer 2970eeb003 Fix version information for new instructions.
llvm-svn: 33689
2007-01-31 01:18:59 +00:00
Chris Lattner aa17576933 Move symbolic constant folding code to libanalysis.
llvm-svn: 33688
2007-01-31 00:53:10 +00:00
Chris Lattner 44d68b9af7 Move some symbolic constant folding code out of instcombine into a place
it can be used by multiple clients.  This specifically allows the inliner
to constant fold symbolically.

llvm-svn: 33687
2007-01-31 00:51:48 +00:00
Reid Spencer 216b9e3896 Correct the instruction op codes to meet current head changes.
llvm-svn: 33686
2007-01-31 00:38:46 +00:00
Reid Spencer 8ad541d5a8 Excise documentation about Compaction Tables.
llvm-svn: 33685
2007-01-31 00:26:08 +00:00
Chris Lattner 373dee0947 The local "ConstantFold" method is now just a watered down version of
ConstantFoldInstOperands.  Switch to ConstantFoldInstOperands and remove
ConstantFold.

llvm-svn: 33683
2007-01-30 23:52:44 +00:00
Chris Lattner 86e359e5cb Make this a *real* header:
1. Remove using namespace llvm;
  2. Remove unneeded #includes.
  3. Add #include guard.

Also add prototypes for new code moved from transformutils to libanalysis.

llvm-svn: 33682
2007-01-30 23:47:35 +00:00
Chris Lattner ec84c162d8 move constant folding code out of Utils/Local into libanalysis
llvm-svn: 33681
2007-01-30 23:46:43 +00:00
Chris Lattner 024f4ab383 Adjust #includes to match movement of constant folding code from transformutils to libanalysis.
llvm-svn: 33680
2007-01-30 23:46:24 +00:00
Chris Lattner 2ae054adb0 move a bunch of constant folding code f rom Transforms/Utils/Local.cpp into
libanalysis/ConstantFolding.cpp.

llvm-svn: 33679
2007-01-30 23:45:45 +00:00
Chris Lattner 14789a92e1 remove now-dead code.
llvm-svn: 33678
2007-01-30 23:29:47 +00:00
Chris Lattner f94bed3f13 the inliner pass now passes targetdata down through the inliner api's
llvm-svn: 33677
2007-01-30 23:28:39 +00:00
Chris Lattner ad84a730ba The inliner/cloner can now optionally take TargetData info, which can be
used by constant folding.

llvm-svn: 33676
2007-01-30 23:22:39 +00:00
Chris Lattner a94523df7b reformat comment
llvm-svn: 33675
2007-01-30 23:16:22 +00:00
Chris Lattner e3eda25641 pass TD to constant folding apis
llvm-svn: 33674
2007-01-30 23:16:15 +00:00
Chris Lattner 8dbea5454d adjust to constant folding api changes.
llvm-svn: 33673
2007-01-30 23:15:43 +00:00
Chris Lattner 0d74d3c09b use smallvector instead of vector to make constant folding a bit more efficient
llvm-svn: 33672
2007-01-30 23:15:19 +00:00
Chris Lattner 6fc4b46d43 adjust to api change
llvm-svn: 33671
2007-01-30 23:14:52 +00:00
Chris Lattner 2c4610e4ca Change constant folding APIs to take an optional TargetData, and change
ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array
of operands + size, instead of an std::vector.

In some cases, switch to using a SmallVector instead of a vector.
This allows us to get rid of some special case gross code that was there
to avoid the cost of constructing a vector.

llvm-svn: 33670
2007-01-30 23:13:49 +00:00
Chris Lattner 1e6cf2ee3c Change constant folding APIs to take an optional TargetData, and change
ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array
of operands + size, instead of an std::vector.

llvm-svn: 33669
2007-01-30 23:12:47 +00:00
Evan Cheng 421fdb2a7e Combine two tests.
llvm-svn: 33668
2007-01-30 23:06:22 +00:00
Evan Cheng dd7a688bb8 During PEI, if the immediate value of sp + offset is too large (i.e. something
that would require > 3 instructions to materialize), load the immediate from a
constpool entry.

llvm-svn: 33667
2007-01-30 23:01:46 +00:00
Chris Lattner 2b15f2ba9d remove some bits that are not yet meant to land.
llvm-svn: 33666
2007-01-30 22:50:32 +00:00
Chris Lattner 4284f6463a Symbolically evaluate constant expressions like &A[123] - &A[4].f.
This occurs in C++ code like:

#include <iostream>
#include <iterator>
int a[] = { 1, 2, 3, 4, 5 };
int main() {
  using namespace std;
  copy(a, a + sizeof(a)/sizeof(a[0]), ostream_iterator<int>(cout, "\n"));
  return 0;
}

Before we would decide the loop trip count is:
sdiv (i32 sub (i32 ptrtoint (i32* getelementptr ([5 x i32]* @a, i32 0, i32 5) to i32), i32 ptrtoint ([5 x i32]* @a to i32)), i32 4)

Now we decide it is "5".  Amazing.

This code will need to be refactored, but I'm doing that as a separate
commit.

llvm-svn: 33665
2007-01-30 22:32:46 +00:00
Evan Cheng 83f35170fa - Fix codegen for pc relative constant (e.g. JT) in thumb mode:
.set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        add r1, pc, #PCRELV0
This is not legal since add r1, pc, #c requires the constant be a multiple of 4.
Do the following instead:
        .set PCRELV0, (LJTI1_0_0-(LPCRELL0+4))
LPCRELL0:
        mov r1, #PCRELV0
        add r1, pc

- In thumb mode, it's not possible to use .set generate a pc relative stub
  address. The stub is ARM code which is in a different section from the thumb
  code. Load the value from a constpool instead.
- Some asm printing clean up.

llvm-svn: 33664
2007-01-30 20:37:08 +00:00
Reid Spencer 5301e7c605 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Reid Spencer 3a0bbb0a4d Compaction tables no longer supported, remove its block ID.
llvm-svn: 33662
2007-01-30 19:37:26 +00:00
Reid Spencer f1826e2adf Bye, Bye Compaction Tables. The benefit compaction tables provides doesn't
outweight its computational costs. This patch removes all compaction
table handling from the bcreader and bcwriter. For the record, here's the
difference betweeen having and not having compaction tables for some tests:

Test             With       Without   Size Chg
Olden/mst       5,602         5,598      +0.1%
viterbi        18,026        17,795      +1.3%
obsequi       162,133       166,663      -2.8%
burg          224,090       228,148      -1.8%
kimwitu++   4,933,263     5,121,159      -3.8%
176.gcc     8,470,424     9,141,539      -7.3%

It seems that it is more beneficial to larger files, but even on the largest
test case we have (176.gcc) it only amounts ot an I/O saving of 7.3%.

llvm-svn: 33661
2007-01-30 19:36:46 +00:00
Reid Spencer af6a408117 For PR411:
Update these tests to not use the same name even though the type of the
value differs. After PR411 hits, type planes will be gone and it will be
illegal for a name to be used twice, regardless of type.

llvm-svn: 33660
2007-01-30 16:16:01 +00:00
Reid Spencer 6f880918d0 Add a gxxcmd variable for the g++ command line used to build llvm.
llvm-svn: 33659
2007-01-30 16:06:55 +00:00
Evan Cheng 95b85e34ff Copy and paste bug.
llvm-svn: 33658
2007-01-30 08:22:33 +00:00
Evan Cheng 0e083d0161 Darwin -static should codegen static ctors / dtors to .constructor / .destructor sections.
llvm-svn: 33657
2007-01-30 08:04:53 +00:00
Evan Cheng ce8fa3ed83 Misseed thumb jumptable branch.
llvm-svn: 33656
2007-01-30 08:03:06 +00:00
Reid Spencer 6ebc06f702 Make the input legal.
llvm-svn: 33655
2007-01-30 06:32:25 +00:00
Evan Cheng fcb9b8b0b7 Add / merge tests.
llvm-svn: 33654
2007-01-30 03:06:19 +00:00
Evan Cheng e43ca022bf In thumb mode, round up stack frame size to multiple of 4 since add/sub
sp, imm instructions implicitly multiply the offset by 4.

llvm-svn: 33653
2007-01-30 02:57:02 +00:00
Evan Cheng c419d983d6 Thumb eliminateFrameIndex fixes.
llvm-svn: 33652
2007-01-30 02:36:01 +00:00
Evan Cheng 1cd3c0efb8 Change the operand orders to t_addrmode_s* to make it easier to morph
instructions that use these address modes to instructions that use
t_addrmode_sp.

llvm-svn: 33651
2007-01-30 02:35:32 +00:00
Evan Cheng 7fa6964dc2 - In thumb mode, if size of MachineFunction is >= 2048, force LR to be
spilled (if it is not already).
- If LR is spilled, use BL to implement far jumps. LR is not used as a GPR
  in thumb mode so it can be clobbered if it is properly spilled / restored
  in prologue / epilogue.
- If LR is force spilled but no far jump has been emitted, try undo'ing the
  spill by:
  push lr -> delete
  pop pc -> bx lr

llvm-svn: 33650
2007-01-30 01:18:38 +00:00
Evan Cheng 863736b0ad Use BL to implement Thumb far jumps.
llvm-svn: 33649
2007-01-30 01:13:37 +00:00
Chris Lattner 6acab41ede test that the 'ir' constraint works.
llvm-svn: 33646
2007-01-29 23:55:20 +00:00
Evan Cheng 760c68b8af Factor GetInstSize() out of constpool island pass.
llvm-svn: 33644
2007-01-29 23:45:17 +00:00
Chris Lattner d27f95e08d add initial support for handling inline asms with multiple constraints.
This doesn't do the "right thing" but will probably work in most cases.

This implements CodeGen/PowerPC/2007-01-29-lbrx-asm.ll.

llvm-svn: 33643
2007-01-29 23:45:14 +00:00
Chris Lattner 9699e54088 new testcase
llvm-svn: 33642
2007-01-29 23:45:03 +00:00
Jim Laskey ee23de6c36 Out of line function.
llvm-svn: 33641
2007-01-29 23:40:33 +00:00
Devang Patel b64c433619 Use StartPassTimer() and StopPassManager()
llvm-svn: 33640
2007-01-29 23:29:54 +00:00
Jim Laskey 3f9f250928 Only gather frame info if debug or eh.
llvm-svn: 33639
2007-01-29 23:20:22 +00:00
Devang Patel 1c3633e461 - Undo previous check-in (i.e. Do not export TimingInfo class through
PassManagers.h).

- Add StopPassTimer() and StartPassTimer() to expose TimingInfo to
CallGraphPassManager

- Use these two APIs in CalLgraphPassManager to measure timings.

llvm-svn: 33638
2007-01-29 23:10:37 +00:00
Nate Begeman eda5997cc8 Finish off bug 680, allowing targets to custom lower frame and return
address nodes.

llvm-svn: 33636
2007-01-29 22:58:52 +00:00
Nate Begeman e3b09fbbb0 We'd still like to register allocate r2 on darwin before the callee-save
regs.

llvm-svn: 33635
2007-01-29 22:57:48 +00:00
Jim Laskey 52726f5837 rename flag
llvm-svn: 33634
2007-01-29 22:40:03 +00:00
Evan Cheng 8953edc8a5 Comment.
llvm-svn: 33633
2007-01-29 22:23:02 +00:00
Evan Cheng 43e8518d8b Remember if LR register has been spilled in this function.
llvm-svn: 33632
2007-01-29 22:22:24 +00:00
Anton Korobeynikov b8d8b82950 Save all registers by default, as they can be used to pass parameters
for "inreg" calls

llvm-svn: 33631
2007-01-29 21:28:01 +00:00
Nate Begeman 17f250005a Update some of the llvm in the readme
llvm-svn: 33630
2007-01-29 21:21:22 +00:00
Nate Begeman 2a562ba47b Properly support cstrings
llvm-svn: 33629
2007-01-29 21:20:42 +00:00
Jim Laskey d1154860a4 Flag to control exception handling.
llvm-svn: 33628
2007-01-29 20:48:32 +00:00
Devang Patel 5a4a315aed Measure timings.
llvm-svn: 33627
2007-01-29 20:08:03 +00:00
Devang Patel 55bcb50840 Move TimingInfo into PassManagers.h so that other libs can use it.
llvm-svn: 33626
2007-01-29 20:06:26 +00:00
Jim Laskey 18c3b5267d Disable zero landing pads for now.
llvm-svn: 33625
2007-01-29 20:01:41 +00:00
Reid Spencer bae85637c7 Regenerate.
llvm-svn: 33624
2007-01-29 19:08:46 +00:00
Reid Spencer e87c917a69 For PR1142:
When an unresolved definition is found, check to see if it is only unresolved
because the csretcc was upgraded to the sret param attribute. Such changes
change the function type and lead to unresolved definitions. In such cases, just
cast the function to the type expected by the CallInst. That is, cast to the
version of the function that has the sret param attribute.

llvm-svn: 33623
2007-01-29 19:07:18 +00:00
Jim Laskey b4a2f05d1c Landing pad-less eh for PPC.
llvm-svn: 33622
2007-01-29 18:51:14 +00:00
Jim Laskey c8397b9214 Update project
llvm-svn: 33621
2007-01-29 18:45:08 +00:00
Reid Spencer 42b2c08e3a Remove tabs.
llvm-svn: 33620
2007-01-29 17:55:50 +00:00
Reid Spencer 1e960cd4fd Implement use of new IntrinsicLowering interface.
llvm-svn: 33619
2007-01-29 17:51:02 +00:00
Reid Spencer d7035b654b Use TargetData to obtain the correct size of the "size_t" argument for
functions like memcpy, memmove and memset. Ensure only one prototype is
used for these functions and that it matches the system definition by
using the appropriate type for the size argument.

llvm-svn: 33618
2007-01-29 17:42:06 +00:00
Reid Spencer 34dbbca483 IntrinsicLowering now requires TargetData.
llvm-svn: 33617
2007-01-29 17:39:50 +00:00
Jim Laskey d33e5a822b Update project.
llvm-svn: 33616
2007-01-29 15:09:35 +00:00
Reid Spencer c3eba3fc93 Regenerate.
llvm-svn: 33615
2007-01-29 05:41:34 +00:00
Reid Spencer 8714f0025c Upgrade old csret calling convention into sret parameter attribute.
llvm-svn: 33614
2007-01-29 05:41:09 +00:00
Reid Spencer ccef5a35bf Update this test case to look for sret parameter attribute not csret cc.
llvm-svn: 33613
2007-01-29 05:40:02 +00:00
Nick Lewycky 56639800c9 Simplify names of lattice values. SGTUNE becomes SGT, for example.
Fix initializeConstant, now initializeInt. Fixes major performance
bottleneck.

X == Y || X->DominatedBy(Y) is redundant. Remove the X == Y part.

Fix crasher in makeEqual where getOrInsertNode would add a new constant,
producing an NE relationship between the two members we're trying to make
equal. This now allows us to mark more BBs as unreachable.

llvm-svn: 33612
2007-01-29 02:56:54 +00:00
Chris Lattner 78bddc388c Read from the right place.
llvm-svn: 33611
2007-01-29 02:18:13 +00:00
Chris Lattner 7f3bd82ab9 Fix PR1139
llvm-svn: 33610
2007-01-29 00:21:34 +00:00
Anton Korobeynikov 6843149863 Make doxygen happy
llvm-svn: 33609
2007-01-29 00:09:00 +00:00
Reid Spencer c7765617d2 For PR1138:
Force memcpy to be the 32-bit variant. Since this is only used with
CBE and lli which both target 32-bit machines, this should be okay.

llvm-svn: 33608
2007-01-28 22:28:00 +00:00
Reid Spencer 326bf785a2 Adjust a comment to reflect reality.
llvm-svn: 33607
2007-01-28 22:26:42 +00:00
Anton Korobeynikov 06f7d4bec7 Arguments are counting from 1. not from 0. Maybe we should change
numbering somehow? E.g. make return argument the last?

llvm-svn: 33606
2007-01-28 18:01:49 +00:00
Anton Korobeynikov 9fa3839d29 More cleanup
llvm-svn: 33605
2007-01-28 16:04:40 +00:00
Nick Lewycky eba26e463a Drop CSRET from here too.
llvm-svn: 33604
2007-01-28 15:51:15 +00:00
Nick Lewycky 0c49722b36 Fix compile error "jump to case label crosses initialization".
What compiler are people using that accepts this code?

llvm-svn: 33603
2007-01-28 15:39:16 +00:00
Anton Korobeynikov e93c6e8dca Grammar fix
llvm-svn: 33602
2007-01-28 15:27:21 +00:00
Anton Korobeynikov 15f3028ba1 Merge error at my side. Fixed.
llvm-svn: 33601
2007-01-28 15:25:24 +00:00
Anton Korobeynikov e816685bd5 Document 'inreg' & 'sret'
llvm-svn: 33600
2007-01-28 14:30:45 +00:00
Anton Korobeynikov 75e8a144d4 Regenerate
llvm-svn: 33599
2007-01-28 13:37:39 +00:00
Anton Korobeynikov 4bca4d157f Drop CSRET CC
llvm-svn: 33598
2007-01-28 13:36:18 +00:00
Anton Korobeynikov 037c867b54 Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Reid Spencer 262068d2da This file has been dead for a long time. Remove it.
llvm-svn: 33596
2007-01-28 08:04:14 +00:00
Reid Spencer 07af391927 Regenerate.
llvm-svn: 33595
2007-01-28 00:52:05 +00:00
Reid Spencer dfa78fba8e For PR1137:
When a value is found to have the same name as another, try harder to
disambiguate when its a type plane collapse issue and when it isn't. We
traverse the type to see if it contains an integer. If it does not then
we issue the error because it can't be resulting from integer type planes
collapsing. Otherwise we just rename it, even if that's a bit of overkill.

llvm-svn: 33594
2007-01-28 00:51:40 +00:00
Reid Spencer 4be2853bfb Test case for PR1137. This makes sure that we don't get erroneous
"redefinition" errors that cause the upgrade to fail.

llvm-svn: 33593
2007-01-28 00:45:28 +00:00
Chris Lattner c56fd7fe0f provide a definition for uintptr_t
llvm-svn: 33592
2007-01-27 23:52:33 +00:00
Chris Lattner c8fb6de78c Fix test/Transforms/InstCombine/2007-01-27-AndICmp.ll, a miscompilation of
Mozilla that Anton tracked down.

llvm-svn: 33591
2007-01-27 23:08:34 +00:00
Chris Lattner d50698107e Testcase for an instcombine miscompilation reduced by Anton.
llvm-svn: 33590
2007-01-27 23:07:12 +00:00
Reid Spencer f422607990 Use -f option so test is repeatable.
llvm-svn: 33589
2007-01-27 21:10:35 +00:00
Reid Spencer 5dd5d4b09e Add a test case for PR411.
llvm-svn: 33588
2007-01-27 21:09:03 +00:00
Reid Spencer e1e8a58cd3 Make this really do nothing.
llvm-svn: 33587
2007-01-27 21:08:29 +00:00
Owen Anderson 8ce4b1b9cd Describe the recent changes to the bytecode format for PR761.
llvm-svn: 33586
2007-01-27 19:23:25 +00:00
Bill Wendling fa663eec17 Make d'tor out-of-line.
llvm-svn: 33585
2007-01-27 11:40:32 +00:00
Chris Lattner 107cba6102 Make SmallSet<whatever*, N> faster by transparently implementing it with
SmallPtrSet.  Some clients will need to use SmallPtrSet directly though if
they need to iterate over the set.

llvm-svn: 33584
2007-01-27 08:20:15 +00:00
Chris Lattner c4f9d11c32 add some missing API
llvm-svn: 33583
2007-01-27 08:19:03 +00:00
Chris Lattner 084a169d49 Give SmallSet a reasonable fallback if it gets large: use an std::set.
llvm-svn: 33582
2007-01-27 08:14:53 +00:00
Chris Lattner 39ab70cf80 implement SmallPtrSet::erase
llvm-svn: 33581
2007-01-27 07:59:10 +00:00
Chris Lattner 030a2dcc1e Fix a limitation of SmallPtrSet. Before it would assert if the smallsize
was not a power of two.  Now it rounds up to the next power of two internally.

llvm-svn: 33580
2007-01-27 07:52:27 +00:00
Chris Lattner 498f00a26a add some comments on the algorithm
llvm-svn: 33579
2007-01-27 07:24:51 +00:00
Chris Lattner ab5d0ba168 add a note
llvm-svn: 33578
2007-01-27 07:18:32 +00:00
Chris Lattner 74102df857 Add a new SmallSet ADT specialized for pointers.
llvm-svn: 33577
2007-01-27 07:10:46 +00:00
Reid Spencer 679004e719 Add some comments, fix an 80 cols violation.
llvm-svn: 33576
2007-01-27 04:42:50 +00:00
Bill Wendling c1f1035518 Return an X86ELFWriterInfo object.
llvm-svn: 33574
2007-01-27 02:56:16 +00:00
Bill Wendling 3814e72ed1 Use TargetELFWriterInfo class.
llvm-svn: 33573
2007-01-27 02:55:44 +00:00
Bill Wendling a9167da9bb Accessor for the TargetELFWriterInfo class object.
llvm-svn: 33572
2007-01-27 02:55:04 +00:00
Bill Wendling 2bab162501 X86 implementation of the TargetELFWriterInfo class.
llvm-svn: 33571
2007-01-27 02:54:30 +00:00
Bill Wendling 2ee13a0881 The TargetELFWriterInfo class holds target-specific information for the ELF writer.
llvm-svn: 33570
2007-01-27 02:53:50 +00:00
Evan Cheng 0cd49bc8a2 New entry.
llvm-svn: 33569
2007-01-27 02:33:22 +00:00
Evan Cheng 0701c5a074 Thumb jumptable support.
llvm-svn: 33568
2007-01-27 02:29:45 +00:00
Chris Lattner 672a31c835 simplify insert interface
llvm-svn: 33567
2007-01-27 02:13:58 +00:00
Chris Lattner 33aba834e5 clean up comment
llvm-svn: 33566
2007-01-27 01:14:20 +00:00
Chris Lattner a8026568b5 add an explanatory comment.
llvm-svn: 33565
2007-01-27 00:23:45 +00:00
Reid Spencer 514399daf1 Apparently the last commit is wrong. Reverted.
llvm-svn: 33564
2007-01-27 00:21:01 +00:00
Reid Spencer 5274612e1a Remove a double negative.
llvm-svn: 33563
2007-01-27 00:16:07 +00:00
Evan Cheng f40b9006a8 Thumb add / sub with carry.
llvm-svn: 33562
2007-01-27 00:07:15 +00:00
Evan Cheng 9f82ccb01f Thumb tests.
llvm-svn: 33561
2007-01-27 00:05:14 +00:00
Evan Cheng df446c6f72 Merge tests.
llvm-svn: 33560
2007-01-27 00:04:57 +00:00
Lauro Ramos Venancio 7d47719af0 Some asm directives fixes for ELF.
Now we can compile llvm-gcc on arm-linux-gnueabi!

llvm-svn: 33558
2007-01-26 23:24:43 +00:00
Jim Laskey 73e79b5a43 Make the constant honest.
llvm-svn: 33557
2007-01-26 23:00:54 +00:00
Nate Begeman debcb5530c Fix a spelling error
llvm-svn: 33556
2007-01-26 22:40:50 +00:00
Nate Begeman f209495e93 Handle multiple functions, properly mangle symbols, and fix support for
scattered relocations.

llvm-svn: 33555
2007-01-26 22:39:48 +00:00
Chris Lattner 1ac3256c22 fit in 80 cols
llvm-svn: 33553
2007-01-26 21:48:40 +00:00
Jim Laskey 5a1df9748b rename files
llvm-svn: 33552
2007-01-26 21:38:26 +00:00
Evan Cheng add7f164a1 Represent tADDspi and tSUBspi as two-address instructions.
llvm-svn: 33551
2007-01-26 21:33:19 +00:00
Jim Laskey c56315c2b5 Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.

llvm-svn: 33550
2007-01-26 21:22:28 +00:00
Lauro Ramos Venancio d45cd5eb81 Fix Data16bitsDirective for ELF.
llvm-svn: 33549
2007-01-26 21:20:45 +00:00
Evan Cheng 3c9dc6bd46 Conditional branch being fixed up is not the last MI in the BB, there is a
unconditional branch following it. Simply invert the condition and swap
destinations if the conditional branch can reach the destination of the
unconditional branch:
beq L1
b   L2
=>
bne L2
b   L1

llvm-svn: 33548
2007-01-26 20:38:26 +00:00
Reid Spencer 9f4cdd5d18 Regenerate.
llvm-svn: 33547
2007-01-26 20:31:18 +00:00
Reid Spencer 62b741dc4c Make sure that an upgraded index is also inserted into the VIndices
otherwise it gets ignored.

This fixes test/CodeGen/X86/2006-05-11-InstrSched.ll

Thanks to Evan Cheng for noticing this.

llvm-svn: 33546
2007-01-26 20:29:52 +00:00
Reid Spencer 41210fb2dc Regenerate.
llvm-svn: 33545
2007-01-26 19:59:25 +00:00
Reid Spencer 0bad131b17 Ensure that gep_upgrade zext instructions we insert have unique names.
llvm-svn: 33544
2007-01-26 19:58:59 +00:00
Lauro Ramos Venancio aa26c1ab9d If the constant pool value is a extern weak symbol, emit the weak reference.
llvm-svn: 33543
2007-01-26 19:51:32 +00:00
Evan Cheng d02d75c295 extload -> zextload
llvm-svn: 33542
2007-01-26 19:13:16 +00:00
Reid Spencer aecf935dc9 Remove extraneous ; to make some versions of bison happy.
llvm-svn: 33541
2007-01-26 18:26:23 +00:00
Devang Patel a426fcd681 Order createSimplifyLibCallsPass() after a set of function level passes
so that these function passes are managed by CallGraphPassManager.

llvm-svn: 33540
2007-01-26 18:17:59 +00:00
Jim Laskey 214c582002 Files missing from LABEL check in.
llvm-svn: 33539
2007-01-26 17:29:20 +00:00
Reid Spencer 697ba1a507 Remove the SignedType class and other dead code. Improve comments.
llvm-svn: 33538
2007-01-26 17:13:53 +00:00
Jim Laskey f9e5445ed4 Make LABEL a builtin opcode.
llvm-svn: 33537
2007-01-26 14:34:52 +00:00
Jim Laskey f773e14547 Clarify some constants.
llvm-svn: 33536
2007-01-26 14:19:17 +00:00
Andrew Lenharth 0ad67b0e43 Work around broken binutils on alpha
llvm-svn: 33535
2007-01-26 13:34:50 +00:00
Reid Spencer 23f1272d37 For PR1122:
Test the upgradability of nested type definitions.

llvm-svn: 33534
2007-01-26 08:44:14 +00:00
Reid Spencer ce380568b5 For PR761:
Remove "target endian/pointersize" or add "target datalayout" to make
the test parse properly or set the datalayout because defaults changes.

For PR645:
Make global names use the @ prefix.

For llvm-upgrade changes:
Fix test cases or completely remove use of llvm-upgrade for test cases
that cannot survive the new renaming or upgrade capabilities.

llvm-svn: 33533
2007-01-26 08:25:06 +00:00
Reid Spencer 4f95f1ab08 Regenerate.
llvm-svn: 33532
2007-01-26 08:19:09 +00:00
Reid Spencer 00a7c7f85a For All These Bugs:
PR645
PR761
PR1082
PR1122

Completely rewrite llvm-upgrade. This should be its final design. Any future
changes will use this same design.  The changes involve the following:

1. Make this work very much like the 1.9 AsmParser
2. Retain old upgrades dating back to release 1.2 time frame.
3. Merge in some of the upgrades between 1.9 and 2.0 (e.g. icmp/fcmp).
4. Attach a Signedness value (Signless, Unsigned, Signed) to every type,
   Value, Constant, Instruction, and list of those things in the Parser.
   Use these to make signedness decisions for instruction upgrades.
5. Implement unique name upgrade for function values and global values.
6. Identify rename cases that might cause problems and warn about them.
   For example: renaming a global variable with external linkage.
7. Generate a 2.0 IR using VMCore. This is necessary for numerous
   reasons and has the advantage that it never goes out of date.
8. Use the AsmPrinter to make the output nice.
9. Clean up error and warning messages from 1.9 form.

llvm-svn: 33531
2007-01-26 08:18:34 +00:00
Reid Spencer 3ac38e99b9 For PR761:
The Module::setEndianness and Module::setPointerSize methods have been
removed. Instead you can get/set the DataLayout. Adjust thise accordingly.

llvm-svn: 33530
2007-01-26 08:11:39 +00:00
Reid Spencer 675fb2301f For PR761:
Remove the Endianness and PointerSize fields from the ModuleHeader and
replace it with the DataLayout field.

llvm-svn: 33529
2007-01-26 08:10:24 +00:00
Reid Spencer 6a8d4eab6a For PR761:
BCReader no longer has a header that contains the endinanness and
pointer size. It's been replaced by datalayout field.

llvm-svn: 33528
2007-01-26 08:09:01 +00:00
Reid Spencer 93b2d78121 For PR761:
Remove the setEndianess and setPointerSize methods. These are now
handled via the setDataLayout method.

llvm-svn: 33527
2007-01-26 08:07:57 +00:00
Reid Spencer 1743debcf2 For PR761:
Remove the setEndiannes and setPointerSize methods. These are now set
through the setDataLayout method.

llvm-svn: 33526
2007-01-26 08:07:01 +00:00
Reid Spencer 8d6d4b8e36 Regenerate for PR645 and PR761
llvm-svn: 33525
2007-01-26 08:05:27 +00:00
Reid Spencer 791b8ef1b6 For PR645:
Implement separation of local and global symbols. Local symbols and types
now use % prefix. Global variables and functions now use @ prefix.

For PR761:
Replace:
  target endian =
  target pointersize =
With:
  target datalayout =

llvm-svn: 33524
2007-01-26 08:04:51 +00:00
Reid Spencer 788e317cd7 For PR645:
Implement new syntax for local and global symbols. Types and local
symbols use the % prefix. Global variables and functions use the @ prefix.

llvm-svn: 33523
2007-01-26 08:02:52 +00:00
Reid Spencer c4fbcb370b For PR645:
Remove the Function::renameLocalSymbols function as it is no longer
needed.

llvm-svn: 33522
2007-01-26 08:01:30 +00:00
Reid Spencer a760b7e1d3 IntegerType is a sized DerivedType too.
llvm-svn: 33521
2007-01-26 07:51:36 +00:00
Reid Spencer 2546b76054 Clean up comments and assert messages that still refer to the old type names.
llvm-svn: 33520
2007-01-26 07:37:34 +00:00
Reid Spencer 7e16e23df8 Fix an assertion message.
llvm-svn: 33519
2007-01-26 06:30:34 +00:00
Evan Cheng 1e270b639d SplitBlockBeforeInstr() insert a unconditional branch to the next BB. This
is unnecessary when we are fixing up a conditional branch since we will be
adding a unconditional branch to the destination of the original branch.

llvm-svn: 33517
2007-01-26 02:02:39 +00:00
Devang Patel 6a47b3c655 Remove dead code.
CallGraphSCCPass does not need to implement runOnModule().
It supports runOnSCC().

llvm-svn: 33516
2007-01-26 01:08:18 +00:00
Evan Cheng db7f0591f3 Need to scan the function for branches even if there aren't any constants.
llvm-svn: 33515
2007-01-26 01:04:44 +00:00
Devang Patel 13058a5ae9 Inherit CallGraphSCCPass directly from Pass.
llvm-svn: 33514
2007-01-26 00:47:38 +00:00
Devang Patel 08731903d0 Inherit FunctionPass directly from Pass.
llvm-svn: 33513
2007-01-26 00:23:00 +00:00
Evan Cheng 1d138989f4 Forgot to update this.
llvm-svn: 33512
2007-01-25 23:31:04 +00:00
Devang Patel 5292e65791 Inherit BasicBlockPass directly from Pass.
llvm-svn: 33511
2007-01-25 23:23:25 +00:00
Evan Cheng 010ae386b8 Add comment, fix typo, reduce memory usage, etc.
llvm-svn: 33510
2007-01-25 23:18:59 +00:00
Evan Cheng fa824b9f73 I am an idiot.
llvm-svn: 33509
2007-01-25 23:18:16 +00:00
Evan Cheng 313c2937f0 Fix comment.
llvm-svn: 33508
2007-01-25 22:48:25 +00:00
Evan Cheng b03e9118be Fix test case.
llvm-svn: 33507
2007-01-25 22:28:32 +00:00
Devang Patel 98095bf795 Remove dead code.
llvm-svn: 33506
2007-01-25 22:27:00 +00:00
Evan Cheng 5acf2fbb43 - Tell PEI that PPC will handle stack frame rounding itself.
- Do not round up to max. alignment of stack object if it is > stack alignment.
  It will have to be handled with dynamic aligning code.

llvm-svn: 33505
2007-01-25 22:25:04 +00:00
Evan Cheng ae4ea45eaf Added a MRegisterInfo hook that tells PEI the target is responsible for
rounding the stack frame to a multiple of stack alignment.

llvm-svn: 33504
2007-01-25 22:12:41 +00:00
Lauro Ramos Venancio b5c595c568 fix fcopysign test
llvm-svn: 33503
2007-01-25 22:11:02 +00:00
Lauro Ramos Venancio 4f7d37fe04 Fix elf object definition.
llvm-svn: 33502
2007-01-25 20:11:04 +00:00
Evan Cheng 417260dc11 Doh. Skip JT branches.
llvm-svn: 33501
2007-01-25 19:43:52 +00:00
Chris Lattner 79f08506f1 Make llvm-extract preserve the callingconv of prototypes in the extracted
code.

llvm-svn: 33500
2007-01-25 17:38:26 +00:00
Jim Laskey ee132b5fce 1. Remove dwarf-verbose option (now asm-verbose.)
2. Clean up end of lines.

llvm-svn: 33499
2007-01-25 15:45:58 +00:00
Jim Laskey 1c055e8d14 Migrate print routines to asm to be shared by exception handling.
llvm-svn: 33498
2007-01-25 15:12:02 +00:00
Evan Cheng 22c7cf504e Added (preliminary) branch shortening capability to constantpool island pass.
llvm-svn: 33497
2007-01-25 03:12:46 +00:00
Evan Cheng c1a1bd18e3 Getting rid uses of evil std::set<>
llvm-svn: 33496
2007-01-25 03:07:27 +00:00
Chris Lattner e4bf50c451 Fix test/CFrontend/2007-01-24-InlineAsmCModifier.c on X86. The %c modifier
says that no $ prefix should be emitted on X86.

llvm-svn: 33495
2007-01-25 02:53:24 +00:00