Commit Graph

35770 Commits

Author SHA1 Message Date
Chris Lattner
7431c2ba79 Teach VMCore to constant fold shufflevectors with constant operands.
This allows us to compile:

#include <emmintrin.h>
typedef __m128i VSInt16;
typedef short vSInt16 __attribute__ ((__vector_size__ (16)));
VSInt16 t3() {
  return (VSInt16)((vSInt16)_mm_set1_epi16(6518));
}

into:

_t3:
	movaps	LCPI1_0, %xmm0
	ret

instead of:
_t3:
	movl	$6518, %eax
	movd	%eax, %xmm0
	pextrw	$0, %xmm0, %eax
	xorps	%xmm0, %xmm0
	pinsrw	$0, %eax, %xmm0
	punpcklwd	%xmm0, %xmm0
	pshufd	$0, %xmm0, %xmm0
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44856 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 07:49:37 +00:00
Chris Lattner
1afab9c1e0 Implement constant folding if vector<->vector bitcasts where the number
of source/dest elements changes.  This implements
test/Transforms/InstCombine/bitcast-vector-fold.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 07:29:44 +00:00
Reid Spencer
9af1887537 Don't have APInt.cpp depend upon DerivedTypes.h. This helps with splitting the
Support libraries separately into their own module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 06:53:58 +00:00
Anton Korobeynikov
64735ccb2b Add first and really dirty version of generic Trie structure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44851 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 06:53:44 +00:00
Chris Lattner
9eaa835e88 significantly simplify some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44850 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 06:07:39 +00:00
Chris Lattner
2b0f806c88 refactor some code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44849 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 05:55:02 +00:00
Evan Cheng
22f07ffd27 Switch over to MachineLoopInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44838 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 02:09:15 +00:00
Evan Cheng
ce25443608 Pretty print shuffle mask operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44837 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 02:08:35 +00:00
Evan Cheng
14b32e1941 - Improved v8i16 shuffle lowering. It now uses pshuflw and pshufhw as much as
possible before resorting to pextrw and pinsrw.
- Better codegen for v4i32 shuffles masquerading as v8i16 or v16i8 shuffles.
- Improves (i16 extract_vector_element 0) codegen by recognizing
  (i32 extract_vector_element 0) does not require a pextrw.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44836 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 01:46:18 +00:00
Nate Begeman
844e0f9def x86 doesn't actually want to custom lower v3i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44835 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 01:41:33 +00:00
Gordon Henriksen
ad93c4f936 CollectorMetadata and Collector are rejiggered to get along with
per-function collector model. Collector is now the factory for
CollectorMetadata, so the latter may be subclassed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:30:17 +00:00
Gordon Henriksen
519452282b Project file maintenance.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44826 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:29:16 +00:00
Chris Lattner
57d7d3f2d7 Move TargetData::hostIsLittleEndian out of line, which means we
don't have to #include config.h in it.  #including config.h breaks
other projects that have their own autoconf stuff and try to #include
the llvm headers.  One obscure example is llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:28:59 +00:00
Gordon Henriksen
bbc6597f02 Adding Ocaml bindings for the bitreader as requested by Sarah
Thompson. Usage should be something like this:

open Llvm
open Llvm_bitreader

match read_bitcode_file fn with
  | Bitreader_failure msg ->
      prerr_endline msg
  | Bitreader_success m -> 
      ...;
      dispose_module m

Compile with: ocamlc llvm.cma llvm_bitreader.cma
              ocamlopt llvm.cmxa llvm_bitreader.cmxa


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 00:20:48 +00:00
Anton Korobeynikov
7eb587779e Hey, English is not my native language :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44820 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 23:10:20 +00:00
Anton Korobeynikov
2fb9deef10 Clarify the need of CFI() stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44819 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 23:08:35 +00:00
Anton Korobeynikov
5f68287605 Provide convenient way to disable CFI stuff for old/broken assemblers.
Use it for Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 23:04:38 +00:00
Chris Lattner
f286f6fd93 Fix PR1850 by removing an unsafe transformation from VMCore/ConstantFold.cpp.
Reimplement the xform in Analysis/ConstantFolding.cpp where we can use
targetdata to validate that it is safe.  While I'm in there, fix some const
correctness issues and generalize the interface to the "operand folder".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44817 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 22:53:04 +00:00
Ted Kremenek
9324665a78 Added two bounds checks to the BitVector class to detect
out-of-bounds bit accesses.  The checks are only performed
in a Debug build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44815 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 22:28:35 +00:00
Chris Lattner
555c729a2f split isBinaryOp into a static and member version.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44814 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 22:18:53 +00:00
John Criswell
9795bb8677 Fix some wording.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44810 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 20:26:29 +00:00
Chuck Rose III
1a4ab520d5 Add StringPool + new CodeGen files to win32 build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44805 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 19:31:09 +00:00
Chris Lattner
ec90cd1bf8 Disable cfi directives for now, darwin does't support them.
These should probably be something like:

  CFI(".cfi_def_cfa_offset 16\n")

where CFI is defined to a noop on darwin and other platforms
that don't support those directives.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 19:10:18 +00:00
Duncan Sands
cbb8badce8 Make PruneEH update the nounwind/noreturn attributes
on functions as it calculates them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44802 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 19:09:40 +00:00
Duncan Sands
1eff70451f Fix PR1836: in the interpreter, read and write apints
using the minimum possible number of bytes.  For little
endian targets run on little endian machines, apints are
stored in memory from LSB to MSB as before.  For big endian
targets on big endian machines they are stored from MSB to
LSB which wasn't always the case before (if the target and
host endianness doesn't match values are stored according
to the host's endianness).  Doing this requires knowing the
endianness of the host, which is determined when configuring -
thanks go to Anton for this.  Only having access to little
endian machines I was unable to properly test the big endian
part, which is also the most complicated...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44796 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 17:43:13 +00:00
Anton Korobeynikov
3a7bcc4d1b And finally annotate X86-64 version of callback.
All bad stuff from SSE version is implicitely inherited :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44794 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 15:27:07 +00:00
Anton Korobeynikov
df7814ce92 Provide annotation for SSE version of callback. It's even more
broken, because doesn't mark xmm regs properly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44793 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 15:13:55 +00:00
Anton Korobeynikov
a14b6696c0 Annotate JIT callback function with call frame infromation.
This will allow us (theoretically) to unwind through JITer.
The code wasn't verified, so I'm pretty sure offsets are wrong :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44792 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 14:54:42 +00:00
Duncan Sands
22ad1d72cd It looks like this has been broken for some time -
get it to compile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44791 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 14:43:10 +00:00
Owen Anderson
afc6de0015 A little more progress on StrongPHIElimination, now that I have a better sense of
how the CodeGen machinery works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44786 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 08:07:09 +00:00
Christopher Lamb
11a4f64bd4 Improve branch folding by recgonizing that explict successor relationships impact the value of fall-through choices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44785 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 07:24:06 +00:00
Gordon Henriksen
53c34b1db9 Delete the CollectorNamePool if it should become empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44775 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 03:35:18 +00:00
Gordon Henriksen
e754abea46 Fix a typo spotted by Nick Lewycky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44774 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 03:30:21 +00:00
Gordon Henriksen
80a75bfae9 Adding a collector name attribute to Function in the IR. These
methods are new to Function:

  bool hasCollector() const;
  const std::string &getCollector() const;
  void setCollector(const std::string &);
  void clearCollector();

The assembly representation is as such:

  define void @f() gc "shadow-stack" { ...

The implementation uses an on-the-side table to map Functions to 
collector names, such that there is no overhead. A StringPool is 
further used to unique collector names, which are extremely
likely to be unique per process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 03:18:06 +00:00
Gordon Henriksen
afba8fe662 Reverting dtor devirtualization patch.
_sabre_: it has a major problem: by the time ~Value is run, all of the "parts" of the derived classes have been destroyed
_sabre_: the vtable lives to fight another day

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44760 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 02:14:30 +00:00
Chris Lattner
65b211807d remove some dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44757 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 01:51:38 +00:00
Chris Lattner
d418239da7 fix some warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 01:51:22 +00:00
Chris Lattner
429c8221cc Fix a big problem in the recent dtor refactoring work, now it passes 2007-11-19-InlineAsm.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44755 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 01:48:29 +00:00
Gordon Henriksen
ed455c8fa2 Devirtualizing Value destructor (PR889). Patch by Pawel Kunio!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44747 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 22:46:10 +00:00
Chris Lattner
46a6e79e60 Duncan points out that the subtraction is unneeded since hte code
knows the vector is not pow2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44740 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 17:56:34 +00:00
Gordon Henriksen
38200692fa Upgrading this test to 2.0 .ll syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44738 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 15:03:01 +00:00
Chris Lattner
f88380ba2c Fix PR1782, patch by Wojtek Matyjewicz!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44733 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 07:35:13 +00:00
Gordon Henriksen
8d1ea75060 Fix a very silly typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44732 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 01:12:08 +00:00
Chris Lattner
b25a0934cc Fix accidental commit by Bill.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44729 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 00:27:38 +00:00
Chris Lattner
0097555e01 Add support for splitting the operand of a return instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44728 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 00:06:19 +00:00
Bill Wendling
041b3f8356 Reverting 44702. It wasn't correct to rename them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44727 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 23:58:46 +00:00
Chris Lattner
eeaad40246 add many new cases to SplitResult. SplitResult now handles all the cases that LegalizeDAG does.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44726 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 23:58:27 +00:00
Chris Lattner
50187864c1 Implement splitting support for store, allowing us to compile:
%f8 = type <8 x float>

define void @test_f8(%f8* %P, %f8* %Q, %f8* %S) {
	%p = load %f8* %P		; <%f8> [#uses=1]
	%q = load %f8* %Q		; <%f8> [#uses=1]
	%R = add %f8 %p, %q		; <%f8> [#uses=1]
	store %f8 %R, %f8* %S
	ret void
}

into:

_test_f8:
	movaps	16(%rdi), %xmm0
	addps	16(%rsi), %xmm0
	movaps	(%rdi), %xmm1
	addps	(%rsi), %xmm1
	movaps	%xmm0, 16(%rdx)
	movaps	%xmm1, (%rdx)
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44725 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 23:24:26 +00:00
Chris Lattner
697b53e0b2 implement vector splitting of load, undef, and binops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44724 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 23:08:49 +00:00
Chris Lattner
e4af7b5a57 implement some methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44723 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 22:40:18 +00:00