Commit Graph

45447 Commits

Author SHA1 Message Date
Devang Patel
203b279f5f test case for rev. 67095.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 19:47:21 +00:00
Chris Lattner
0b18e59336 Fix codegen to compute the size of an allocation by multiplying the
size by the array amount as an i32 value instead of promoting from
i32 to i64 then doing the multiply.  Not doing this broke wrap-around
assumptions that the optimizers (validly) made.  The ultimate real
fix for this is to introduce i64 version of alloca and remove mallocinst.

This fixes PR3829


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 19:36:00 +00:00
Chris Lattner
46d232d4bc Remove a condition which is always true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 17:55:15 +00:00
Evan Cheng
58e2287d00 Add newline at end of file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 17:08:25 +00:00
Scott Michel
a82d3f7c57 CellSPU:
Revert inadvertent mis-fix of fneg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67084 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 16:45:16 +00:00
Daniel Dunbar
501adac7aa Minimal raw_ostream unit tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 16:14:59 +00:00
Sanjiv Gupta
12a9dc8c14 r66870 missed this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67082 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 15:46:15 +00:00
Gabor Greif
e14ad7220d typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 11:38:29 +00:00
Duncan Sands
a5fec0dba3 Reapply r67049, with the test adjusted for darwin
(which produces "call L_f$stub" rather than "call f").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 09:46:22 +00:00
Mon P Wang
93b7415f4c Fix a problem with DAGCombine where we were building an illegal build
vector shuffle mask. Forced the mask to be built using i32.  Note: this will
be irrelevant once vector_shuffle no longer takes a build vector for the
shuffle mask.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 06:33:10 +00:00
Dan Gohman
9626447e70 Recognize bswapl as bswap too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 02:45:40 +00:00
Dan Gohman
d73566609e Recognize "bswapq" as an alternate spelling for the bswap instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 02:17:27 +00:00
Daniel Dunbar
c39b80fdfc raw_ostream: Return '*this' explicitly (instead of implicitly via
write) to expose more alias information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67070 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 01:53:36 +00:00
Daniel Dunbar
262541b074 raw_ostream: Put all exceptional conditions in raw_ostream::write
under a single branch.

Also, add a FIXME for formatted output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 01:36:56 +00:00
Evan Cheng
e47b0089d9 Spiller may unfold load / mod / store instructions as an optimization when the would be loaded value is available in a register. It needs to check if it's legal to clobber the register. Also, the register can contain values of multiple spill slots, make sure to check all instead of just the one being unfolded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67068 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 01:23:09 +00:00
Scott Michel
7ea02ffe91 CellSPU:
- Fix fabs, fneg for f32 and f64.
- Use BuildVectorSDNode.isConstantSplat, now that the functionality exists
- Continue to improve i64 constant lowering. Lower certain special constants
  to the constant pool when they correspond to SPU's shufb instruction's
  special mask values. This avoids the overhead of performing a shuffle on a
  zero-filled vector just to get the special constant when the memory load
  suffices.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 01:15:45 +00:00
Daniel Dunbar
d17d74bb80 raw_ostream: Rework implementation of unbuffered streams so outputting
a single character requires only one branch to follow slow path.
 - Never use a buffer when writing on an unbuffered stream.

 - Move default buffer size to header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67066 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 01:13:35 +00:00
Dale Johannesen
6b23339502 Fix a debug info dependency in jump threading.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-17 00:38:24 +00:00
Daniel Dunbar
89a66a96fe raw_ostream: Replace flush_impl with write_impl, which takes data to
write as arguments.
 - Add raw_ostream::GetNumBytesInBuffer.
 - Privatize buffer pointers.
 - Get rid of slow and unnecessary code for writing out large strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 23:29:31 +00:00
Daniel Dunbar
cf2a2c6a26 raw_ostream: Lift out flush_nonempty.
- Flush a known non-empty buffers; enforces the interface to
   flush_impl and kills off HandleFlush (which I saw no reason to be
   an inline method, Chris?).

 - Clarify invariant that flush_impl is only called with OutBufCur >
   OutBufStart.

 - This also cleary collects all places where we have to deal with the
   buffer possibly not existing.

 - A few more comments and fixing the unbuffered behavior remain in
   this commit sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67057 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 22:55:06 +00:00
Douglas Gregor
4752bd3b40 CMake: Build system fixes for XCode. llvm-config still causes us some serious trouble, but it's less serious than it used to be
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 22:53:26 +00:00
Daniel Dunbar
b451a0cdec Make raw_ostream::operator<<(const void *) fast; it doesn't matter but
it is easy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 22:08:44 +00:00
Daniel Dunbar
de75d7ffcd Add slow path for single character write, and use exclusively for
single characters writes outside of the fast path in raw_ostream.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 22:00:17 +00:00
Douglas Gregor
af3f5441b5 CMake: Make sure to build TableGen'd files in the binary directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 21:35:18 +00:00
Bill Wendling
db14d63cea --- Reverse-merging (from foreign repository) r67049 into '.':
U    test/CodeGen/X86/2009-03-13-PHIElimBug.ll
D    test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll
U    lib/CodeGen/PHIElimination.cpp

r67049 was causing this failure:

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/2009-03-13-PHIElimBug.ll for PR3784
Failed with exit(1) at line 1
while running:  llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/2009-03-13-PHIElimBug.ll |  llc -march=x86 | /usr/bin/grep -A 2 {call f} | /usr/bin/grep movl
child process exited abnormally


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 20:27:20 +00:00
Duncan Sands
dfec24c877 Tweak the fix for PR3784: be less sensitive about just
how invokes are set up.  The fix could be disturbed by
register copies coming after the EH_LABEL, and also didn't
behave quite right when it was the invoke result that
was used in a phi node.  Also (see new testcase) fix
another phi elimination bug while there: register copies
in the landing pad need to come after the EH_LABEL, because
that's where execution branches to when unwinding.  If they
come before the EH_LABEL then they will never be executed...
Also tweak the original testcase so it doesn't use a no-longer
existing counter.
The accumulated phi elimination changes fix two of seven Ada
testsuite failures that turned up after landing pad critical
edge splitting was turned off.  So there's probably more to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67049 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 19:58:38 +00:00
Scott Michel
6e1d1470c2 CellSPU:
Incorporate Tilmann's 128-bit operation patch. Evidently, it gets the
llvm-gcc bootstrap a bit further along.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67048 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 18:47:25 +00:00
Chris Lattner
56cb12c9a7 change this to test for an alias result more directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 18:28:27 +00:00
Douglas Gregor
41e04beed7 Add TGSourceMgr.cpp to CMake build, sort lines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16 17:04:14 +00:00
Bruno Cardoso Lopes
98ea4635ae This causes incorrect stack frame allocation when the last object is an array allocated on the stack which would lead
the compiled program to run over its stack. Thanks to Gil Dogon


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15 23:28:07 +00:00
Nick Lewycky
57174886c9 Simplify. "Broken" is always true here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67025 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15 06:40:32 +00:00
Nick Lewycky
34a408639f Remove obviously redundant call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67023 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15 06:39:52 +00:00
Owen Anderson
420dd37326 Give the pre-alloc splitter access to the VirtRegMap. It doesn't do anything
useful with it at the moment, but it will in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 21:40:05 +00:00
Nick Lewycky
b24e6c4dd3 Add a replacement for 2009-02-12-GEPNoalias.ll that works without -debug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 19:40:09 +00:00
Dan Gohman
c131793904 Apply a patch by Micah Villmow to fix AsmParser to accept vector
shift constant expressions, and add support for folding vector
shift constant expressions. This fixes PR3802.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 17:09:17 +00:00
Sebastian Redl
8d8ba38f98 Fix Clang build for srcdir != objdir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67008 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 14:42:51 +00:00
Sebastian Redl
1119552a08 Add support for generating Clang diagnostic defs to Makefile.rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67006 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 11:59:18 +00:00
Sebastian Redl
e6fd52e26d Add TableGen syntax highlighting for the jEdit editor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 10:15:32 +00:00
Dan Gohman
318f5055a4 Add a testcase that covers a wide variety of ABI isel cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67003 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 02:35:10 +00:00
Dan Gohman
72bb0a64af Use %rip-relative addressing on x86-64 whenever practical, as
it has a smaller encoding than absolute addressing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 02:33:41 +00:00
Dan Gohman
9a49d31b6f Don't forego folding of loads into 64-bit adds when the other
operand is a signed 32-bit immediate. Unlike with the 8-bit
signed immediate case, it isn't actually smaller to fold a
32-bit signed immediate instead of a load. In fact, it's
larger in the case of 32-bit unsigned immediates, because
they can be materialized with movl instead of movq.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 02:07:16 +00:00
Daniel Dunbar
cfbf05ef03 Add newlines at end of file (this can annoy gcov)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 01:53:05 +00:00
Mon P Wang
0b7a786842 Avoid doing the transformation c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4
if FPConstant is legal because if the FPConstant doesn't need to be stored
in a constant pool, the transformation is unlikely to be profitable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66994 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 00:25:19 +00:00
Dan Gohman
d00d2feab2 Add a few more ptrtoint/inttoptr cast tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66989 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 23:54:51 +00:00
Dan Gohman
474d3b3f40 Improve FastISel's handling of truncates to i1, and implement
ptrtoint and inttoptr in X86FastISel. These casts aren't always
handled in the generic FastISel code because X86 sometimes needs
custom code to do truncation and zero-extension.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66988 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 23:53:06 +00:00
Dale Johannesen
4425240dbc Fix -strip-debug-declare to work when there are
llvm.global.variable's but no llvm.declare's.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66977 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 22:59:47 +00:00
Evan Cheng
fc0b80d974 Fix PR3784: If the source of a phi comes from a bb ended with an invoke, make sure the copy is inserted before the try range (unless it's used as an input to the invoke, then insert it after the last use), not at the end of the bb.
Also re-apply r66140 which was disabled as a workaround.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 22:59:14 +00:00
Ted Kremenek
557f7f88ba Add (hidden) TableGen command option '-clang-component' which specifies the
component's warnings to process for '-gen-clang-diags-defs'.

Also, when the component is specified, generate a '#if' prologue at the top of
the generated .def file (to match the current files).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66975 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 22:53:41 +00:00
Ted Kremenek
04a847e706 Add initial implementation of a TableGen backend for converting Clang-warnings
tablegen files to the original .def preprocessor include files. This is my first
TableGen backend; I don't claim that it is awesome.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66971 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 22:21:17 +00:00
Ted Kremenek
02475f1fd5 Further constify Record::isSubClassOf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 22:20:10 +00:00