Commit Graph

39230 Commits

Author SHA1 Message Date
Bruno Cardoso Lopes f09c372191 Added support for FP Registers
llvm-svn: 52079
2008-06-07 21:32:41 +00:00
Chris Lattner 4595a72c79 Update VC project files, patch by Cédric Venet!
llvm-svn: 52077
2008-06-07 19:33:54 +00:00
Evan Cheng 89200c9177 Speculatively execute a block when the the block is the then part of a triangle shape and it contains a single, side effect free, cheap instruction. The branch is eliminated by adding a select instruction. i.e.
Turn                                                                                                                                                                                                       
BB:                                                                                                                                                                                                        
    %t1 = icmp                                                                                                                                                                                             
    br i1 %t1, label %BB1, label %BB2                                                                                                                                                                      
BB1:                                                                                                                                                                                                       
    %t3 = add %t2, c                                                                                                                                                                                       
    br label BB2                                                                                                                                                                                           
BB2:                                                                                                                                                                                                       
=>                                                                                                                                                                                                         
BB:                                                                                                                                                                                                        
    %t1 = icmp                                                                                                                                                                                             
    %t4 = add %t2, c                                                                                                                                                                                       
    %t3 = select i1 %t1, %t2, %t3

llvm-svn: 52073
2008-06-07 08:52:29 +00:00
Evan Cheng 003b4b0cd2 Fix run line.
llvm-svn: 52072
2008-06-07 08:40:16 +00:00
Evan Cheng 1a0835017a Revert r52046. It broke cbe on x86 / Mac OS X.
llvm-svn: 52071
2008-06-07 07:50:29 +00:00
Dan Gohman f6743d70ab CodeGen support for insertvalue and extractvalue, and for loads and
stores of aggregate values.

llvm-svn: 52069
2008-06-07 02:02:36 +00:00
Owen Anderson 0bd08cf64c Connect successors before creating the DAG node for the branch. This has
no visible functionality change, but enables a future patch where node creation
will update the CFG if it decides to create an unconditional rather than a conditional branch.

llvm-svn: 52067
2008-06-07 00:00:23 +00:00
Gabor Greif cbcc495c1b get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
llvm-svn: 52064
2008-06-06 21:06:32 +00:00
Evan Cheng 0b8f2c53a2 Typo.
llvm-svn: 52062
2008-06-06 21:00:10 +00:00
Gabor Greif 21ba184b27 make ExtractValueInst derived from UnaryInstruction
llvm-svn: 52061
2008-06-06 20:28:12 +00:00
Evan Cheng c324be32c4 Enable stack coloring by default.
llvm-svn: 52057
2008-06-06 19:52:44 +00:00
Evan Cheng 9bf9110d93 PPC preferred loop alignment is 16.
llvm-svn: 52056
2008-06-06 19:50:46 +00:00
Devang Patel 8549e4ca07 LoopSimplify preserves AA.
llvm-svn: 52053
2008-06-06 17:50:58 +00:00
Devang Patel 656a917ad9 Print debug message only if there are dead passes.
llvm-svn: 52052
2008-06-06 17:50:36 +00:00
Owen Anderson f7647e432c Include loop deletion and the ADCE rewrite in the release notes.
llvm-svn: 52048
2008-06-06 16:23:15 +00:00
Anton Korobeynikov 089018fb05 Testcase for PR2418
llvm-svn: 52047
2008-06-06 16:08:56 +00:00
Anton Korobeynikov f69bc3df9b Handle assembler identifiers specially in CBE. This fixes PR2418.
llvm-svn: 52046
2008-06-06 16:08:26 +00:00
Duncan Sands f1123e58fc Tighten up the abstraction slightly.
llvm-svn: 52045
2008-06-06 12:49:32 +00:00
Duncan Sands 13237ac3b9 Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction.  Rename the type
to MVT.  To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits().  Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).

llvm-svn: 52044
2008-06-06 12:08:01 +00:00
Zhou Sheng 1152ca9101 As Chris suggested, handle the situation if ShAmt larger than BitWidth,
otherwise, opt might crash.

llvm-svn: 52041
2008-06-06 08:32:05 +00:00
Evan Cheng 6d7a144453 Refine stack slot interval weight computation.
llvm-svn: 52040
2008-06-06 07:54:39 +00:00
Anton Korobeynikov 5b3e396c24 Turn stdout into binary mode during bitcode emission.
This is necessary on windows targets, since stdout is in text mode there.
Patch by Julien Lerouge!

llvm-svn: 52038
2008-06-06 07:24:01 +00:00
Anton Korobeynikov 5e8644071d Provide hooks for libgcc symbols' address resolution inside lli on mingw32.
Patch by Julien Lerouge!

llvm-svn: 52037
2008-06-06 07:20:07 +00:00
Bruno Cardoso Lopes 1a6e0d613f Added custom isel for MUL, SDIVREM, UDIVREM, SMUL_LOHI and UMUL_LOHI nodes
MUL is not anymore directly matched because its a pseudoinstruction.
LogicI class fixed to zero-extend immediates. 

llvm-svn: 52036
2008-06-06 06:37:31 +00:00
Bruno Cardoso Lopes 4eed3afda0 Added custom SELECT_CC lowering
Added special isel for ADDE,SUBE and new patterns to match SUBC,ADDC

llvm-svn: 52031
2008-06-06 00:58:26 +00:00
Dan Gohman 1d304a99d7 Revert 52002.
llvm-svn: 52030
2008-06-05 23:57:06 +00:00
Chris Lattner 3816aa7ef7 Expose a public interface to this pass.
llvm-svn: 52029
2008-06-05 23:45:18 +00:00
Chris Lattner 0282d0247e Let libcall semantics decide whether it knows about functions
with definitions or not.

llvm-svn: 52028
2008-06-05 23:38:34 +00:00
Evan Cheng c7007a7211 Warn of potential violations of strict aliasing rules.
llvm-svn: 52027
2008-06-05 23:00:08 +00:00
Evan Cheng 9e76c047d1 Don't break strict aliasing.
llvm-svn: 52026
2008-06-05 22:59:21 +00:00
Devang Patel 33aac00892 Describe loop index split.
llvm-svn: 52021
2008-06-05 21:44:00 +00:00
Dan Gohman ae408aa83f Wording fixes. Thanks Bill!
llvm-svn: 52017
2008-06-05 18:45:33 +00:00
Owen Anderson 05d1cd99b3 Remove debugging code.
llvm-svn: 52016
2008-06-05 18:43:34 +00:00
Gabor Greif 80ae8a7194 fix typos, tweak stuff, make it to validate
llvm-svn: 52015
2008-06-05 18:39:01 +00:00
Owen Anderson 65dc2b2e06 Use the newly created helper on LiveIntervals.
llvm-svn: 52013
2008-06-05 17:22:53 +00:00
Owen Anderson 35e2dfe1cf Add a helper for constructing new live ranges that ended from an instruction to the end of its MBB.
llvm-svn: 52012
2008-06-05 17:15:43 +00:00
Dan Gohman b0ec18bd81 Move i128 on x86-64 from the codegen section to the x86-specific section.
llvm-svn: 52010
2008-06-05 16:15:39 +00:00
Dan Gohman 4277e7e49a Add a note about improved alignment detection.
llvm-svn: 52009
2008-06-05 15:49:29 +00:00
Dan Gohman 23254a8f83 Add a note mentioning --view-sunit-dags improvements.
llvm-svn: 52008
2008-06-05 15:46:36 +00:00
Dan Gohman 46105567f7 Expand the bullet item about i128 support and APInt usage in codegen.
llvm-svn: 52007
2008-06-05 15:43:11 +00:00
Zhou Sheng c775e462a8 Add a test case for opt -instcombine bug fix in revision 52003.
llvm-svn: 52004
2008-06-05 14:25:11 +00:00
Zhou Sheng fbe1dc240c If BitWidth equals to ShtAmt, the RHSKnownZero[BitWidth-ShiftAmt-1] will
crash the opt. Just fix this.

Test case in llvm/test/Transforms/InstCombine/2008-06-05-ashr-crash.ll

llvm-svn: 52003
2008-06-05 14:23:44 +00:00
Matthijs Kooijman 5eef32ba94 Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.

llvm-svn: 52002
2008-06-05 14:00:36 +00:00
Zhou Sheng 3f8de8b130 Add a test case for APInt bug fix in r51999.
llvm-svn: 52000
2008-06-05 13:42:21 +00:00
Zhou Sheng 1247c07742 As comments said, for negative value, the arithmetic
over-shift-right should return -1. So here it should be signed-extended,
when bitwidth larger than 64.

test case: llvm/test/ExecutionEngine/2008-06-05-APInt-OverAShr.ll

llvm-svn: 51999
2008-06-05 13:27:38 +00:00
Nick Lewycky 0702adc65e Escape "$#".
llvm-svn: 51998
2008-06-05 12:54:44 +00:00
Matthijs Kooijman 812989b147 Learn ScalarReplAggregrates how stores and loads of first class aggregrates
work and how to replace them into individual values. Also, when trying to
replace an aggregrate that is used by load or store with a single (large)
integer, don't crash (but don't replace the aggregrate either).

Also adds a testcase for both structs and arrays.

llvm-svn: 51997
2008-06-05 12:51:53 +00:00
Gordon Henriksen 03a4ad4db9 Move this to the proper section.
I misread Optimizer Improvements as Other Improvements for some reason.

llvm-svn: 51996
2008-06-05 12:51:50 +00:00
Gordon Henriksen 03d9625286 Adding release notes for bindings improvements.
llvm-svn: 51995
2008-06-05 12:48:32 +00:00
Matthijs Kooijman e0c5adc158 Let StructRetPromotion check if all if its users are really calls or invokesn,
not other instructions. This fixes a crash with the added testcase.

llvm-svn: 51992
2008-06-05 08:57:20 +00:00
Matthijs Kooijman 463f86639d Let StructRetPromotion check if it's users are really calling it and not
passing its pointer. Fixes test with added testcase.

llvm-svn: 51991
2008-06-05 08:48:32 +00:00
Matthijs Kooijman 230d6fbfeb Use use_iterator::getOperandNo instead of CallSite::hasArgument to check if a
function is passed as an argument instead of called. Also do this check a bit
earlier.

llvm-svn: 51990
2008-06-05 08:34:25 +00:00
Matthijs Kooijman b0dffd691c * Make CallSite::hasArgument const and let it take a const parameter.
llvm-svn: 51989
2008-06-05 08:04:58 +00:00
Chris Lattner 6cb64030e5 more updates and random notes, including changes up through Week-of-Mon-20080324.
llvm-svn: 51988
2008-06-05 08:02:49 +00:00
Matthijs Kooijman 5afc2740b7 Update comments and documentation to reflect that GCSE and ValueNumbering are
deprecated by the GVN and GVNPRE passes.

llvm-svn: 51983
2008-06-05 07:55:49 +00:00
Bill Wendling 18fbf1bc37 Cast because I think I know what I'm doing. There are warnings about converting
from 64-bit to 32-bit.

llvm-svn: 51982
2008-06-05 07:35:27 +00:00
Matthijs Kooijman 63a2cb59b0 Fix 80 column violations.
llvm-svn: 51981
2008-06-05 07:26:15 +00:00
Bill Wendling b80d63268a Remove unused parameter. Some clients might use -Werror when compiling and
cause drama.

llvm-svn: 51980
2008-06-05 07:24:08 +00:00
Chris Lattner 618a99f920 add llvmc2 notes, stack realignment.
llvm-svn: 51979
2008-06-05 06:57:39 +00:00
Chris Lattner a1a4c9a227 various status updates.
llvm-svn: 51978
2008-06-05 06:35:40 +00:00
Chris Lattner b711222b27 Start adding 2.3 content.
llvm-svn: 51977
2008-06-05 06:25:56 +00:00
Evan Cheng 976b1eee81 Fix a memcpy lowering bug. Even though the memcpy alignment is smaller than the desired alignment, the frame destination alignment may still be larger than the desired alignment. Don't change its alignment to something smaller.
llvm-svn: 51970
2008-06-04 23:37:54 +00:00
Owen Anderson 61c7f2a633 Remove unneeded #include.
llvm-svn: 51955
2008-06-04 18:28:10 +00:00
Chris Lattner 09ebde227e Fix inst_iterator example.
llvm-svn: 51954
2008-06-04 18:20:42 +00:00
Evan Cheng 9e27316337 Oops. Should not be enabled by default.
llvm-svn: 51953
2008-06-04 18:09:20 +00:00
Chris Lattner c596ec04e1 Rewrite a bunch of the CBE's inline asm code, giving it the
ability to handle indirect input operands.  This fixes PR2407.

llvm-svn: 51952
2008-06-04 18:03:28 +00:00
Owen Anderson 3a697779fe Correctly construct live intervals for the copies we inserted into the predecessors of a block containing a PHI.
llvm-svn: 51950
2008-06-04 17:55:58 +00:00
Evan Cheng 805cde4fbf Revert this.
llvm-svn: 51949
2008-06-04 17:21:44 +00:00
Matthijs Kooijman 2353f35989 Replace two manual loops with calls to CallSite::hasArguments (no functional changes).
llvm-svn: 51947
2008-06-04 16:57:50 +00:00
Matthijs Kooijman d901e5842f Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
llvm-svn: 51946
2008-06-04 16:31:12 +00:00
Matthijs Kooijman 76d8dec5db Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
llvm-svn: 51945
2008-06-04 16:14:12 +00:00
Matthijs Kooijman a6bb22e9bc Fix example to be valid LLVM assembly.
llvm-svn: 51942
2008-06-04 15:46:35 +00:00
Matthijs Kooijman cfd41dbd5e Implement the two constructors in InsertValueInst and ExtractValueInst.
Add a Name argment to two init methods in these classes as well to make things
a bit more consistent.

llvm-svn: 51937
2008-06-04 14:40:55 +00:00
Evan Cheng 12a0222a01 Add a stack slot coloring pass. Not yet enabled.
llvm-svn: 51934
2008-06-04 09:18:41 +00:00
Evan Cheng a15e7eb29b LowerSubregs should not clobber any analysis.
llvm-svn: 51933
2008-06-04 09:17:16 +00:00
Evan Cheng eecdf659e8 Move #include to right place.
llvm-svn: 51932
2008-06-04 09:16:33 +00:00
Evan Cheng c5b3a3bea5 Register if-converter pass for -debug-pass.
llvm-svn: 51931
2008-06-04 09:15:51 +00:00
Evan Cheng 93af6ce129 More pass manager debugging outputs.
llvm-svn: 51930
2008-06-04 09:13:31 +00:00
Duncan Sands fc3c489b52 Change packed struct layout so that field sizes
are the same as in unpacked structs, only field
positions differ.  This only matters for structs
containing x86 long double or an apint; it may
cause backwards compatibility problems if someone
has bitcode containing a packed struct with a
field of one of those types.
The issue is that only 10 bytes are needed to
hold an x86 long double: the store size is 10
bytes, but the ABI size is 12 or 16 bytes (linux/
darwin) which comes from rounding the store size
up by the alignment.  Because it seemed silly not
to pack an x86 long double into 10 bytes in a
packed struct, this is what was done.  I now
think this was a mistake.  Reserving the ABI size
for an x86 long double field even in a packed
struct makes things more uniform: the ABI size is
now always used when reserving space for a type.
This means that developers are less likely to
make mistakes.  It also makes life easier for the
CBE which otherwise could not represent all LLVM
packed structs (PR2402).
Front-end people might need to adjust the way
they create LLVM structs - see following change
to llvm-gcc.

llvm-svn: 51928
2008-06-04 08:21:45 +00:00
Chris Lattner 6449690da4 Add #includes required by GCC 4.3, thanks for Zhongxing Xu
for reporting this.

llvm-svn: 51926
2008-06-04 04:46:14 +00:00
Bruno Cardoso Lopes 326a03732e Some Mips minor fixes
Added support for mips little endian arch => mipsel

llvm-svn: 51923
2008-06-04 01:45:25 +00:00
Owen Anderson c777d9e6fe We need to subtract one from this index because live ranges are open at the end.
llvm-svn: 51922
2008-06-04 00:38:56 +00:00
Scott Michel a7d8649f78 Fix spellnig error
llvm-svn: 51917
2008-06-03 19:13:20 +00:00
Owen Anderson 6c871c0866 Testcase for LoopIndexSplit and DomFrontier.
llvm-svn: 51916
2008-06-03 18:32:27 +00:00
Owen Anderson 2df82e7cec LoopIndexSplit can sometimes result in cases where a block in its own domfrontier.
Don't crash when we encounter one of these.

llvm-svn: 51915
2008-06-03 18:29:48 +00:00
Dale Johannesen 4c75de7f39 Expand documentation of StringConstantPrefix.
llvm-svn: 51911
2008-06-03 18:15:03 +00:00
Dale Johannesen 83e468ae23 Prevent a crash in debug dumps.
llvm-svn: 51910
2008-06-03 18:14:29 +00:00
Dale Johannesen 355b74acc2 Add StringConstantPrefix to control what the
assembler names of string constants look like.

llvm-svn: 51909
2008-06-03 18:09:06 +00:00
Scott Michel c0e9ff6e52 Find a better place to output hex constants corresponding to integers.
llvm-svn: 51904
2008-06-03 15:39:51 +00:00
Bruno Cardoso Lopes 2dd8fdc78a Fixed bug in bad behavior in calculateFrameObjectOffsets,
the solution commited is different from the previous patch to
avoid int and unsigned comparison

llvm-svn: 51899
2008-06-03 08:46:59 +00:00
Evan Cheng 097826643b Do not run loop-aligner at -fast (e.g. -O0).
llvm-svn: 51898
2008-06-03 06:56:08 +00:00
Scott Michel 499c119d7c Revert this patch
llvm-svn: 51897
2008-06-03 06:18:19 +00:00
Dan Gohman 25b3b49dbc nounwindify.
llvm-svn: 51893
2008-06-03 01:21:11 +00:00
Devang Patel ab85d6b6af "Unable to schedule <A> required by <B>" is more helpful then
"Unable to handle Pass that requires lower level Analysis pass"

llvm-svn: 51892
2008-06-03 01:20:02 +00:00
Devang Patel bb4720c43f Add debugging aid.
llvm-svn: 51891
2008-06-03 01:02:16 +00:00
Dan Gohman 2ad7e7341c Fix whitespace in whitespace-significant pseudocode in a comment.
llvm-svn: 51890
2008-06-03 00:57:21 +00:00
Dan Gohman 3db11c2bd9 Constant folding for insertvalue and extractvalue.
llvm-svn: 51889
2008-06-03 00:15:20 +00:00
Devang Patel 7314d0ee3c Update dom tree. Fix PR 2372.
llvm-svn: 51887
2008-06-02 22:52:56 +00:00
Dan Gohman 057240f4f0 Fold adds and subtracts of zero immediately, instead of waiting
for dagcombine to do this.

llvm-svn: 51886
2008-06-02 22:27:05 +00:00
Scott Michel 5793cbcf44 Minor cosmetic patch so that the hex equivalent of a decimal
constant shows up in the assembly language output. Helps with
debugging without a HP calculator having to be handy.

llvm-svn: 51885
2008-06-02 22:19:12 +00:00