Commit Graph

96210 Commits

Author SHA1 Message Date
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
Anders Carlsson 4b35e97e74 Update Xcode project.
llvm-svn: 119953
2010-11-21 23:25:35 +00:00
Wesley Peck 7699d6cfe9 Implement ELF object file writing support for the MBlaze backend. Its not perfect yet, but it works for many tests.
llvm-svn: 119952
2010-11-21 22:06:28 +00:00
Wesley Peck f1d3800e65 Implement branch analysis in the MBlaze backend.
llvm-svn: 119951
2010-11-21 21:53:36 +00:00
Wesley Peck f4efd582ad Make it a little bit more explicit that the MBlaze backend only supports upto
32-bit immediate values.

llvm-svn: 119950
2010-11-21 21:39:46 +00:00
Wesley Peck 7493e30d42 Fix an error in the MBlaze delay slot filler where instructions that already
fill a delay slot are moved to fill a different delay slot.

llvm-svn: 119949
2010-11-21 21:36:12 +00:00
Chris Lattner fc9aead6fd fix comment
llvm-svn: 119948
2010-11-21 19:05:34 +00:00
Chris Lattner 5d2262dc76 apparently tailcalls are better on darwin/x86-64 than on linux?
llvm-svn: 119947
2010-11-21 18:59:20 +00:00
Anders Carlsson a369f8dc3a The 'X' printf type has a valid alternative form. Fixes PR8641.
llvm-svn: 119946
2010-11-21 18:34:21 +00:00
Anders Carlsson 7fb785d449 Update Xcode project.
llvm-svn: 119945
2010-11-21 18:33:34 +00:00
Benjamin Kramer 585dfa2b3d Initialize MemDep's TD member so buildbots don't trip over an uninitialized pointer (TD is passed to PHITransAddr).
I wonder why this didn't explode earlier.

llvm-svn: 119944
2010-11-21 15:21:46 +00:00
Benjamin Kramer 3959370c92 Fix a bunch of IndirectFieldDecl-related warnings.
- Negative ChainingSize doesn't make sense, make it unsigned.

llvm-svn: 119943
2010-11-21 14:11:41 +00:00
Duncan Sands cf4bceba49 Add a rather pointless InstructionSimplify transform, inspired by recent constant
folding improvements: if P points to a type of size zero, turn "gep P, N" into "P".
More generally, if a gep index type has size zero, instcombine could replace the
index with zero, but that is not done here.

llvm-svn: 119942
2010-11-21 13:53:09 +00:00
Duncan Sands 1f86be9164 Fix spelling.
llvm-svn: 119941
2010-11-21 12:43:13 +00:00
Bill Wendling 22db31305f More Thumb encodings.
llvm-svn: 119940
2010-11-21 11:49:36 +00:00
Benjamin Kramer 3cf715d22c Filename.rfind("/\\") won't give us the position of the last directory seperator.
llvm-svn: 119939
2010-11-21 11:32:22 +00:00
Bill Wendling c01d679928 Add encoding for ARM "trap" instruction.
llvm-svn: 119938
2010-11-21 11:05:29 +00:00
Bill Wendling 219dabdf68 The "trap" instruction is one of this which doesn't have a condition code. Hack
the code to not add a "condition code" if it's trap.

llvm-svn: 119937
2010-11-21 10:56:05 +00:00
Bill Wendling 3acd02706a - Give "trap" the correct encoding, at least according to Darwin's assembler.
- Add comments saying where the encodings for other instructions came from.

llvm-svn: 119936
2010-11-21 10:55:23 +00:00
Chris Lattner 8afa6deb1d remove old compatibility APIs, use StringRef versions instead.
llvm-svn: 119935
2010-11-21 09:55:08 +00:00