Commit Graph

49168 Commits

Author SHA1 Message Date
Chris Lattner
d283cb12f2 add some more topics to the coding standards doc:
* Use Early Exits and 'continue' to Simplify Code
* Turn Predicate Loops into Predicate Functions
* Spaces Before Parentheses
* Namespace Indentation
* Anonymous Namespaces



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 05:40:54 +00:00
Eli Friedman
1126038436 Attempt to fix BuildBot breakage with MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76722 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 05:06:41 +00:00
Chris Lattner
d8afc46ffe fix some formatting stuff, patch by Edward O'Callaghan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 04:21:40 +00:00
Eric Christopher
be9408ec86 Remove intrinsic support for __builtin_ia32_vec_set_v16qi and
__builtin_ia32_vec_set_v4si as these should be lowered in the
front-end to inserts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 01:11:48 +00:00
Eli Friedman
3dae284f5e Add support for MMX VSETCC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 01:06:52 +00:00
Sean Callanan
5292588ad4 Added the unconditional JMP with an 8-bit relocation for the
assembler / disassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 01:05:20 +00:00
Evan Cheng
064a6eacab Add an entry.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:58:27 +00:00
Chris Lattner
f1581564b6 inline the two MergeableConstSection implementations into their
only caller.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76710 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:47:11 +00:00
Chris Lattner
828f704c10 set the ELF "small" flag on objects that end up in .rodata.cst4 consistently,
updating a mips testcase to expect it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76707 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:41:56 +00:00
Chris Lattner
2804616ba3 don't set the small flag yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:30:39 +00:00
Chris Lattner
298414ec18 remove the SelectSectionForMachineConst hook, replacing it with
a new getSectionForMergableConstant hook.  This removes one dependence
of TAI on Type, and provides the hook with enough info to make the 
right decision based on whether the global has relocations etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76705 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:28:43 +00:00
Evan Cheng
fc6ad402fb Let each target determines whether a machine instruction is dead. If true, that allows late codeine passes to delete it.
This is considered a workaround. The problem is some targets are not modeling side effects correctly. PPC is apparently one of those. This patch allows ppc llvm-gcc to bootstrap on Darwin. Once we find out which instruction definitions are wrong, we can remove the PPCInstrInfo workaround.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:25:27 +00:00
Owen Anderson
e922c02019 Get rid of the Pass+Context magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:24:57 +00:00
Chris Lattner
7cf12c7efd reimplement Constant::ContainsRelocations as
Constant::getRelocationInfo(), which has a much simpler
to use API.  It still should not be part of libvmcore, but
is better than it was.  Also teach it to be smart about 
hidden visibility.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:05:44 +00:00
Dan Gohman
9c5beed5f5 Misc. doc fixes following suggestions from Eli.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:04:19 +00:00
Evan Cheng
5d8f1cae76 Fixing cp island pass. Step 1: Determine whether the constant pool offset can be
negative on an individual bases rather than basing on whether it's in thumb
mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:56:01 +00:00
Evan Cheng
7fdf962e5c Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:54:22 +00:00
Chris Lattner
b2fb9ccbb7 simplify code now that it is inlined.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:49:55 +00:00
Lang Hames
fae02a2ab1 Exposed PHIElimination pass within CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76688 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:47:33 +00:00
Chris Lattner
97d2cae44b Now that RelocBehaviour() is never overloaded, it doesn't need to be
virtual.  Just inline it into its two current call sites in preparation
for simplifying the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76686 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:47:11 +00:00
Eric Christopher
248f80d488 Add intrinsic for __builtin_ia32_vec_set_v4si which turns out to be
pinsrd in sse4.1.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:43:14 +00:00
Chris Lattner
1a1b323504 this doesn't break any of the 4 ia64 tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76683 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:42:24 +00:00
Chris Lattner
9d8052f08f alpha doesn't need to redefine this: it only supports PIC codegen anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:41:35 +00:00
David Greene
80607c9b2b Add some support for iterative coalescers to calculate a joined live
range's weight properly.  This is turned off right now in the sense that
you'll get an assert if you get into a situation that can only be caused
by an iterative coalescer.  All other code paths operate exactly as
before so there is no functional change with this patch.  The asserts
should be disabled if/when an iterative coalescer gets added to trunk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76680 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:36:14 +00:00
Chris Lattner
354c0165e7 no really, I can spell!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76679 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:36:01 +00:00
Chris Lattner
cb45963643 add an API so target-independent codegen can determine if a constant
pool entry will require relocations against it.  I implemented this
conservatively for ARM, someone who is knowledgable about it should
see if this can be improved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:34:23 +00:00
Dan Gohman
ce9fe9fae5 Convert instcombine from using using getAnalysis<TargetData> to
getAnalysisIfAvailable<TargetData>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:21:54 +00:00
Dan Gohman
295643b805 Permit the IntPtrTy argument to isEliminableCastPair to be null,
to help support use when TargetData is not available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:19:40 +00:00
Chris Lattner
aedb59a541 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:17:26 +00:00
Bruno Cardoso Lopes
82a70ccb24 Change ELFCodeEmitter logic to emit the constant pool and jump tables to
their appropriate sections before the code itself. They need to be emitted
before the function because on some targets (x86 but not x86_64) the later
may reference a JT or CP entry address


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76672 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:13:26 +00:00
Dan Gohman
0f4b285a5b Replace the original ad-hoc code for determining whether (v pred w) implies
(x pred y) with more thorough code that does more complete canonicalization
before resorting to range checks. This helps it find more cases where
the canonicalized expressions match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:03:19 +00:00
Evan Cheng
47b1e2afd0 Remove a big test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76669 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:52:04 +00:00
Chris Lattner
3e7b5ca3b9 Various doc updates from Edward O'Callaghan!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:47:03 +00:00
Chris Lattner
117c7e2a6a remove the last bits of SectionFlagsForGlobal. There is some flag here that
depends on XS1A, but I think the ReadOnlySection is already set up for this
and there is no testcase that this breaks.  If this is really needed, we can
add the appropriate parameterization to TargetAsmInfo in the future to support
this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:42:37 +00:00
Chris Lattner
1ab78b03e8 don't mask out the small flag and then reapply it later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:39:28 +00:00
Chris Lattner
27391795ac if Xcore doesn't support TLS, it doesn't have to worry about thread local LLVM IR, it should be rejected by a front-end.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:37:38 +00:00
Chris Lattner
97ee12755d remove the Xcore implementation of SelectSectionForGlobal. While you have
to twist your brain to see it, I believe it is the same as ELFTargetAsmInfo::SelectSectionForGlobal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:36:53 +00:00
Chris Lattner
449e379bd7 simplify based on the fact that darwin always uses L/l.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:32:55 +00:00
Chris Lattner
939a8907ed make some stuff private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:30:39 +00:00
Chris Lattner
bdf7a3ade1 improve comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:30:25 +00:00
Chris Lattner
e1abeb478a Remove the XCore custom implementation of MergeableConstSection, relying on
the generic ELF version instead.  This will result in its mergable constant
sections getting named ".rodata.cst4" instead of ".cp.const4", but the
linker looks at the section flags, not the name of the section AFAICT.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76659 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 22:25:52 +00:00
Bob Wilson
b2f8806fdf Fix ocaml tests for 64-bit MacOS systems. LLVM is currently built
as 32-bit code by default, and if gcc defaults to 64-bit code then ocamlc
requires a -cc "gcc -arch i386" option.  We were hardcoding -cc g++
and throwing away any other compiler options that were determined when
ocamlc was configured and built.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76658 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:56:46 +00:00
Bob Wilson
32eaeca34f Reorder the "Metadata" entry to match the C bindings.
This fixes a regression in the vmcore.ml dejagnu test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:52:57 +00:00
Daniel Dunbar
85f49835c2 Add missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76655 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:33:58 +00:00
Chris Lattner
7886ae9e3c inline a trivial method into its only call site and fix indentation of cases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:29:08 +00:00
Chris Lattner
42b6418cc0 Remove some overridden functions in XCoreTargetAsmInfo that are
implemented exactly the same way as its ELFTargetAsmInfo subclass 
has them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:26:32 +00:00
Chris Lattner
3380d5c4aa revert r76602, 76603, and r76615, pending design discussions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76646 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:12:58 +00:00
Chris Lattner
7558f11849 minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 21:09:35 +00:00
Owen Anderson
822ccd9974 Privatize the ConstantArray table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76639 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 20:55:28 +00:00
Torok Edwin
f6fa8ae267 Add a few fairly obvious API changes I noticed while porting some old code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 20:27:10 +00:00