Commit Graph

96379 Commits

Author SHA1 Message Date
Francois Pichet ce87a7e45c long => int to make the test pass on system where sizeof(long) = 64.
llvm-svn: 120005
2010-11-23 07:15:13 +00:00
Zhanyong Wan 19ec4ee093 Fix a typo in a comment.
llvm-svn: 120004
2010-11-23 06:43:05 +00:00
Cameron Zwarich 767a389fa5 Optimize a common case in the Lengauer-Tarjan dominators algorithm. This gives a
9.7% speedup running domtree on test-suite.

Reviewed by Chris Lattner.

llvm-svn: 120003
2010-11-23 06:32:37 +00:00
Chris Lattner 2dd97d2d60 Revert functionality doug added in r98575 that was never
documented and only used by some clang stuff I just removed.

llvm-svn: 120002
2010-11-23 06:09:51 +00:00
Chris Lattner 4ac569b2c6 Partially revert Doug's PCH validation patch (r98585).
This patch completely defeated the "passing in a prestat'd size 
to MemoryBuffer" optimization, leading to an extra fstat call for
every buffer opened, in order to find out if the datestamp and size 
of the file on disk matches what is in the stat cache.

I fully admit that I don't completely understand what is going on here:
why punish code when a stat cache isn't in use?  what is the point of a
stat cache if you have to turn around and stat stuff to validate it?

To resolve both these issues, just drop the modtime check and check the
file size, which is the important thing anyway.  This should also resolve
PR6812, because presumably windows is stable when it comes to file sizes.
If the modtime is actually important, we should get it and keep it on the
first stat.

This eliminates 833 fstat syscalls when processing Cocoa.h, speeding up
system time on -Eonly Cocoa.h  from 0.041 to 0.038s.

llvm-svn: 120001
2010-11-23 06:09:11 +00:00
Francois Pichet 0c71f6c5d3 Microsoft C anonymous struct implementation.
Documentation: http://msdn.microsoft.com/en-us/library/z2cx9y4f.aspx

llvm-svn: 120000
2010-11-23 06:07:27 +00:00
Rafael Espindola 6e13aa1d3b Reuse data fragments while lowering. Patch by David Meyer.
llvm-svn: 119999
2010-11-23 05:49:35 +00:00
Zhanyong Wan 19b96fd4ee Fix formatting nits in the coding standards. Reviewed by clattner.
llvm-svn: 119998
2010-11-23 05:03:07 +00:00
Chris Lattner 6e6409989f stringref'ize API
llvm-svn: 119997
2010-11-23 04:45:28 +00:00
Chris Lattner 7c434b6937 tidy up
llvm-svn: 119996
2010-11-23 04:40:26 +00:00
Chris Lattner 5df6f8f55f avoid creating sys::Path instances when -fworking-directory isn't being used.
llvm-svn: 119995
2010-11-23 04:33:43 +00:00
Chris Lattner a5f868ce03 fix this harder.
llvm-svn: 119994
2010-11-23 04:26:12 +00:00
Chris Lattner 13b981b26f fix a bug I introduced on the other side of the #ifdef
llvm-svn: 119993
2010-11-23 04:19:56 +00:00
Chris Lattner 8bec7227d4 reimplement SwapByteOrder.h in terms of overloading instead of
being in terms of excessively complex template logic.

llvm-svn: 119992
2010-11-23 04:04:25 +00:00
Wesley Peck 527da1b6e2 Renaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.
llvm-svn: 119990
2010-11-23 03:31:01 +00:00
Chris Lattner 4329e078ac add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
patch by Greg Pfeil!

llvm-svn: 119989
2010-11-23 02:47:22 +00:00
Chris Lattner e5afa15b77 duncan's spider sense was right, I completely reversed the condition
on this instcombine xform.  This fixes a miscompilation of 403.gcc.

llvm-svn: 119988
2010-11-23 02:42:04 +00:00
Chris Lattner adc29567fc filecheckize
llvm-svn: 119987
2010-11-23 02:26:52 +00:00
Jason W Kim 767a1e9adc Fixed some style issues (no _, no spc after !)
llvm-svn: 119986
2010-11-22 22:05:16 +00:00
Rafael Espindola 6e39a50fd5 Remove duplicated constants. Thanks to Jason for noticing it.
llvm-svn: 119985
2010-11-22 21:49:05 +00:00
Benjamin Kramer f1ebb63161 InstCombine: Implement X - A*-B -> X + A*B.
llvm-svn: 119984
2010-11-22 20:31:27 +00:00
Zhanyong Wan 59f09c7483 Stylistic changes to CFG.cpp:
1. "no 'else' after 'return'" -- this is for conformance with the
coding standards.

2. move 'else' to the line of the previous '}' -- this is for consistency.

Reviewed by kremenek.

llvm-svn: 119983
2010-11-22 19:32:14 +00:00
Jason W Kim 16b75262c4 Make the <ARCH>ELFObjectWriter statics private
llvm-svn: 119982
2010-11-22 18:57:00 +00:00
Jason W Kim 84ffdd5cf1 Fix misplaced statics.
llvm-svn: 119981
2010-11-22 18:47:05 +00:00
Anders Carlsson 849ea413c6 Refactor the null-initialization for record types and make it handle bases that aren't i8 arrays.
llvm-svn: 119980
2010-11-22 18:42:14 +00:00
Jason W Kim a262546df7 Kill trailing whitespace
llvm-svn: 119979
2010-11-22 18:42:07 +00:00
Jason W Kim 7c7d0ef287 Refactor the ELFRelocationEntry (pull up) and move the arch-specific statics to inside the class where it belongs.
Next step is to rationally break apart the RecordRelocation()

Probably the step will be to have 1 member function for ech slot of the ELFRelocationEntry()

llvm-svn: 119978
2010-11-22 18:41:13 +00:00
Evan Cheng eb56dca4fd Fix epilogue codegen to avoid leaving the stack pointer in an invalid
state. Previously Thumb2 would restore sp from fp like this:
mov sp, r7
sub, sp, #4
If an interrupt is taken after the 'mov' but before the 'sub', callee-saved
registers might be clobbered by the interrupt handler. Instead, try
restoring directly from sp:
add sp, #4
Or, if necessary (with VLA, etc.) use a scratch register to compute sp and
then restore it:
sub.w r4, r7, #8
mov sp, r7
rdar://8465407

llvm-svn: 119977
2010-11-22 18:12:04 +00:00
Mikhail Glushenkov abc0204bf6 Add a newline.
llvm-svn: 119976
2010-11-22 17:10:20 +00:00
Mikhail Glushenkov 3c60f755c3 llvmc: Make -march/-mcpu/-mtune behaviour more consistent with gcc.
llvm-svn: 119975
2010-11-22 17:10:09 +00:00
Duncan Sands c133c54426 If a GEP index simply advances by multiples of a type of zero size,
then replace the index with zero.

llvm-svn: 119974
2010-11-22 16:32:50 +00:00
Kalle Raiskila 77d11d054c Fix a bug with extractelement on SPU.
In the attached testcase, the element was
never extracted (missing rotate).

llvm-svn: 119973
2010-11-22 16:28:26 +00:00
Rafael Espindola 3c227b0b89 Add basic CFI methods to the streamer interface.
llvm-svn: 119972
2010-11-22 14:27:24 +00:00
Nico Weber ece562ed27 Remove the other FIXME I added. This is covered by the Index test and not testable via -ast-dump.
llvm-svn: 119971
2010-11-22 13:48:02 +00:00
Duncan Sands 8a0f486e36 Move the "gep undef" -> "undef" transform from instcombine to
InstructionSimplify.

llvm-svn: 119970
2010-11-22 13:42:49 +00:00
Nico Weber 13c13d4da8 Remove one I just added, add a more focused test for why the current code is correct.
llvm-svn: 119969
2010-11-22 13:12:28 +00:00
Nico Weber 7f8bb368ea Try to get the bots green after r119966.
llvm-svn: 119968
2010-11-22 12:50:03 +00:00
Rafael Espindola 556f203d64 Remove some #includes.
llvm-svn: 119967
2010-11-22 11:53:17 +00:00
Nico Weber 774303425b Fix the source range of CXXNewExprs. Fixes http://llvm.org/pr8661.
llvm-svn: 119966
2010-11-22 10:30:56 +00:00
Nico Weber 1879bca4c9 Minor whitespace fix, no functionality change
llvm-svn: 119965
2010-11-22 10:26:41 +00:00
Benjamin Kramer 24656c9583 Implement the "if (X == 6 || X == 4)" -> "if ((X|2) == 6)" optimization.
This currently only catches the most basic case, a two-case switch, but can be
extended later.

llvm-svn: 119964
2010-11-22 09:45:38 +00:00
Duncan Sands c6648eb4c3 Don't keep track of inserted phis in PromoteMemoryToRegister: the information
is never used.  Patch by Cameron Zwarich.

llvm-svn: 119963
2010-11-22 09:41:24 +00:00
Duncan Sands 5cadccc4ea Fix a compiler warning about Kind being used uninitialized
when assertions are disabled.

llvm-svn: 119962
2010-11-22 09:38:00 +00:00
NAKAMURA Takumi 3c3b3a7d8b test/Sema/x86-builtin-palignr.c: Now we can remove XFAIL:win32, according to r119958.
llvm-svn: 119961
2010-11-22 09:29:49 +00:00
Zhanyong Wan 6dace61730 Fix PR8419. Reviewed by kremenek and xuzhongxing.
llvm-svn: 119960
2010-11-22 08:45:56 +00:00
Chandler Carruth 45c2fb1e69 Undo part of my previous commit to mm_malloc.h, going back to the use of
stdlib.h. There were numerous problems with forward declaring 'malloc' and
'free', but the most important is that these are reserved by POSIX and may be
implemented via a function-like macro.

As suggested by Dale Johannesen, I'm instead guarding the only include of this
in our builtin headers with __STDC_HOSTED__, and I've removed the include of
the header from the test suite. I'll discuss with folks whether we want to have
a hosted section of the test suite or not, and add it (and perhaps other tests)
back there if that's the direction.

llvm-svn: 119958
2010-11-22 08:06:31 +00:00
Anders Carlsson 39a6b22023 Remove FIXME; we don't ever want to lay out empty bases.
llvm-svn: 119957
2010-11-22 00:03:08 +00:00
Anders Carlsson a7dd96ce77 Rename BaseLLVMType to NonVirtualBaseLLVMType.
llvm-svn: 119956
2010-11-21 23:59:45 +00:00
Anders Carlsson e64fbe2a6c Add getCGRecordLayout helper function. No functionality change.
llvm-svn: 119955
2010-11-21 23:56:06 +00:00
Eric Christopher 37b0736bdc Pseudos default to 4byte size, let the instruction size field notice
that branch tables are special.

llvm-svn: 119954
2010-11-21 23:38:19 +00:00