Commit Graph

44851 Commits

Author SHA1 Message Date
Nick Lewycky
2ec0dbf961 Don't sign extend the char when expanding char -> int during
load(bitcast(char[4] to i32*)) evaluation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 20:50:42 +00:00
Daniel Dunbar
92acef0e94 Add makefile debugging target; use "make print-FOO" to print the
value/definition/origin of FOO.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65245 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 20:42:39 +00:00
Richard Pennington
278f83daeb bug 3610: Floating point vaarg not softened.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 19:11:18 +00:00
Ted Kremenek
07bf7efa0a Add version of StringsEqualNoCase that takes two null-terminated C-strings and compares up to 'len' characters. I tend to screw up string comparison functions, so anyone who is interested please review this\!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65236 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 18:25:30 +00:00
Anton Korobeynikov
b5bd026a75 Drop bunch of half-working stuff in the ext_weak linkage support.
Now we're using one gross, but quite robust hack :) (previous ones
did not work, for example, when ext_weak symbol was used deep inside
constant expression in the initializer).

The proper fix of this problem will require some quite huge asmprinter
changes and that's why was postponed. This fixes PR3629 by the way :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 11:53:32 +00:00
Nick Lewycky
8e87e65d28 Pass different flags on different platforms when building PIC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 08:41:09 +00:00
Evan Cheng
b0ea08066c Add AddrModeMatcher.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 07:05:11 +00:00
Evan Cheng
28c7ce3fd4 If two-address def is dead and the instruction does not define other registers, and it doesn't produce side effects, just delete the instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 03:14:25 +00:00
Evan Cheng
d9fb712403 Teach LSR sink to sink the immediate portion of the common expression back into uses if they fit in address modes of all the uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 02:06:47 +00:00
Bill Wendling
5a45d76c25 Make sure this doesn't access .end() too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65213 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 01:11:36 +00:00
Gabor Greif
67a2743b6b fix and clean up a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 01:09:07 +00:00
Bill Wendling
8aa374b629 Make sure we don't dereference the .end() of the container.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 01:07:26 +00:00
Chris Lattner
36d3e326df rename a function to indicate that it checks for profitability as well
as legality.  Make load sinking and gep sinking more careful: we only
do it when it won't pessimize loads from the stack.  This has the added
benefit of not producing code that is unanalyzable to SROA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 00:46:50 +00:00
Bill Wendling
3d2445f5d9 Propagate more debug loc infos. This also includes some code cleaning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 00:43:56 +00:00
Bill Wendling
2625f9b2e4 We need to propagate the debug location information even when dealing with the
prologue/epilogue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 00:32:08 +00:00
Misha Brukman
9259905f88 * Fixed spelling
* Linters now return their information instead of printing it, to
  enable easier unittesting
* Added support for finding tabs in files, added to C++ linter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 23:44:54 +00:00
Dan Gohman
1ba519b726 Fix a bug that David Greene found in the DAGCombiner's logic
that checks whether it's safe to transform a store of a bitcast
value into a store of the original value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65201 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 23:29:13 +00:00
Misha Brukman
d3ff4a188e Removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 23:04:06 +00:00
Misha Brukman
085a9ebbc7 Removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65197 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:54:36 +00:00
Misha Brukman
fe2cce63aa Removed trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65196 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:51:36 +00:00
Misha Brukman
d5ece81cc7 Keep the newline character at the end of the lines whose trailing whitespace we
are deleting; otherwise, everything ends up on a single line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65185 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:30:46 +00:00
Misha Brukman
4c4c952543 Only strip the newline character at the end of the lines that we're considering
for length and for trailing whitespace; otherwise, the whitespace themselves
will also be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:28:45 +00:00
Misha Brukman
a2769a33c9 Fixed lint errors:
* Alphabetized #includes
* Removed trailing whitespace
* Wrapped or shortened lines over 80 chars


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:20:18 +00:00
Bill Wendling
1bcf0f5e45 We have logic in there to emit a default debugging label at the beginning of a
function. Emitting another label after the prologue messes up the debugging. We
are doing that because the first DebugLoc object it sees is different from the
previous, which was nothing. Check for this situation, and don't emit one if
it's the first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:19:20 +00:00
Evan Cheng
d33cec18a9 Fix strange logic in CollectIVUsers used to determine whether all uses are
addresses, part 1. This fixes an obvious logic bug. Previously if the only
in-loop use is a PHI, it would return AllUsesAreAddresses as true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65178 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 22:16:49 +00:00
Dan Gohman
ff518c86f7 Simplify code and reduce indentation. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65167 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:27:23 +00:00
Dan Gohman
6b38e29f13 Fix 80-column violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:06:57 +00:00
Dan Gohman
f0baa6e9cb It's not necessary to check if Base is null here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65157 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 21:05:23 +00:00
Evan Cheng
79fb3b434f Support return of MMX values in 64-bit mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 20:43:02 +00:00
Bill Wendling
9a65cfe7dd - Early exit a nested block.
- Correct comment.
- Whitespace changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65149 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 20:40:28 +00:00
Dan Gohman
33e3a36f0a Add a comment about how Imm can be used for loop-variant values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65147 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 20:29:04 +00:00
Torok Edwin
474479fce7 add note about sin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:42:06 +00:00
Evan Cheng
a1fd5b386d Factor address mode matcher out of codegen prepare to make it available to other passes, e.g. loop strength reduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:24:38 +00:00
Zhou Sheng
3f315eb5e0 Just roll back the previous change to -mem2reg.
Will re-think about this according to Chris's comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 17:49:33 +00:00
Zhou Sheng
a248c45e00 patch to update the line number information in pass -mem2reg.
Currently this pass will delete the variable declaration info, 
and keep the line number info. But the kept line number info is not updated, 
and some is redundant or not correct, this patch just updates those info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 16:31:35 +00:00
Owen Anderson
4cafbb58e2 Fix a crash in the pre-alloc splitter exposed by recent codegen changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 10:02:23 +00:00
Owen Anderson
3b2c01723c Add a quick pass to the stack slot colorer to eliminate some trivially redundant spills after coloring.
Ideally these would never get created in the first place, but until we enhance the spiller to have a more
global picture of what's happening, this is necessary for code quality in some circumstances.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 09:11:36 +00:00
Chris Lattner
e772842505 make these tests pass when run on a G5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 07:10:11 +00:00
Dan Gohman
c17e0cf6c0 Implement "superhero" strength reduction, or full strength
reduction of address calculations down to basic pointer arithmetic.
This is currently off by default, as it needs a few other features
before it becomes generally useful. And even when enabled, full
strength reduction is only performed when it doesn't increase
register pressure, and when several other conditions are true.

This also factors out a bunch of exisiting LSR code out of
StrengthReduceStridedIVUsers into separate functions, and tidies
up IV insertion. This actually decreases register pressure even
in non-superhero mode. The change in iv-users-in-other-loops.ll
is an example of this; there are two more adds because there are
two fewer leas, and there is less spilling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65108 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 04:17:46 +00:00
Bill Wendling
4ed0c5fb07 Add an accessor method to DwarfWriter to tell of debugging info should be emitted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 00:44:43 +00:00
Bill Wendling
5d0f68134e Add a default debug location object to the Machine Function. It's used to emit a default debugging label at the beginning of a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 00:42:52 +00:00
Bill Wendling
14a2e1eda0 Temporarily revert r65065. It was causing test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:57:07 +00:00
Bill Wendling
b5ef273757 Print out debug info when printing the machine instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:44:55 +00:00
Bill Wendling
490359d687 Check for -fast here too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:23:54 +00:00
Bill Wendling
dfdacee2ab Generate these labels when we're in "fast" mode, not simply when we're no in
"optimize-for-size" mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 21:12:54 +00:00
Dale Johannesen
c1c9d7e6a9 Describe tail merging's use of InsertBranch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:40:21 +00:00
Dan Gohman
4a359ea2d5 Use DEBUG() instead of passing *DOUT to WriteAsOperand,
since the latter just passes a null reference when
debugging is not enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:32:06 +00:00
Dan Gohman
2f09f51954 Make the debug output of LSR less cryptic and more informative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 19:23:27 +00:00
Bill Wendling
4dd82f6aaa Print out a new label only if the debug location *tuple* is different. The debug
locations may change, but the tuples may be the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 09:16:38 +00:00
Bill Wendling
249e1e4e27 Forgot to check that debug information is supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19 08:06:12 +00:00