Commit Graph

6999 Commits

Author SHA1 Message Date
Tilmann Scheller
f1cc70ca93 Add Win64 thiscall calling convention.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126862 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 19:29:22 +00:00
David Greene
a20244d1ba [AVX] Fix mask predicates for 256-bit UNPCKLPS/D and implement
missing patterns for them.

      Add a SIMD test subdirectory to hold tests for SIMD instruction
      selection correctness and quality.
'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126845 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-02 17:23:43 +00:00
Duncan Sands
c92cb649e3 Add datalayout information for the IEEE quad precision fp128 type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126780 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-01 20:56:50 +00:00
Chris Lattner
99825b4455 fix a signed comparison warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126682 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 20:50:35 +00:00
David Greene
c4db4e5105 [AVX] Add decode support for VUNPCKLPS/D instructions, both 128-bit
and 256-bit forms.  Because the number of elements in a vector
      does not determine the vector type (4 elements could be v4f32 or
      v4f64), pass the full type of the vector to decode routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126664 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-28 19:06:56 +00:00
Benjamin Kramer
9e9bb0871d Silence enum conversion warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126578 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 18:13:53 +00:00
NAKAMURA Takumi
419f232783 Target/X86: Always emit "push/pop GPRs" in prologue/epilogue and emit "spill/reload frames" for XMMs.
It improves Win64's prologue/epilogue but it would not affect ia32 and amd64 (lack of nonvolatile XMMs).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126568 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-27 08:47:19 +00:00
Owen Anderson
95771afbfd Allow targets to specify a the type of the RHS of a shift parameterized on the type of the LHS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126518 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 21:41:48 +00:00
Cameron Zwarich
f754f50805 Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126488 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-25 16:30:32 +00:00
Chris Lattner
12d18a07a0 remove command line option debugging hook.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126441 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 21:53:03 +00:00
Devang Patel
f410608271 Enable DebugInfo support for COFF object files.
Patch by Nathan Jeffords!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126425 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 21:04:00 +00:00
Evan Cheng
7558e2e415 Fix bug in X86 folding / unfolding table. Int_CMPSDrm and Int_CMPSSrm memory
operands starts at index 2, not 1.
rdar://9045024
PR9305


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126359 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-24 02:36:52 +00:00
David Greene
fbf05d32b4 [AVX] General VUNPCKL codegen support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 23:31:46 +00:00
Joerg Sonnenberger
00743c2218 Use the same (%dx) hack for in[bwl] as for out[bwl].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126244 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 20:40:09 +00:00
Roman Divacky
4c3ab58c47 Stack alignment is 16 bytes on FreeBSD/i386 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126226 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 17:30:05 +00:00
Joerg Sonnenberger
d86f482e4a Recognize loopz and loopnz as aliases for loope and loopne.
From Dimitry Andric.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:43:07 +00:00
Rafael Espindola
87ca0e077d Implement xgetbv and xsetbv.
Patch by Jai Menon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-22 00:35:18 +00:00
Devang Patel
68e6beeccc Revert r124611 - "Keep track of incoming argument's location while emitting LiveIns."
In other words, do not keep track of argument's location.  The debugger (gdb) is not prepared to see line table entries for arguments. For the debugger, "second" line table entry marks beginning of function body.
This requires some coordination with debugger to get this working. 
 - The debugger needs to be aware of prolog_end attribute attached with line table entries.
 - The compiler needs to accurately mark prolog_end in line table entries (at -O0 and at -O1+)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 23:21:26 +00:00
Sean Callanan
89e59e6343 Fixed a bug in the X86 disassembler where a member of the
X86 instruction decode structure was being interpreted as
being in units of bits, although it is actually stored in
units of bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126147 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 21:55:05 +00:00
Duncan Sands
7331ca853a The stack should be 16 byte aligned on 32 bit solaris. Patch by Yuri.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126130 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 17:37:17 +00:00
Chris Lattner
fb456c25c2 a serious "compare CSE" issue that is nontrivial to get right,
but which is responsible for us doing really bad things to 256.bzip2.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126126 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 17:03:47 +00:00
NAKAMURA Takumi
d64cfe1506 Target/X86/X86FastISel: [PR6275] Fix Win32's dllimport function with fastisel.
"dllimport" function must not be GlobalVariable, but Function. It is enough to check with GlobalValue.
test/CodeGen/X86/dll-linkage.ll is updated to check llc -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 04:50:06 +00:00
Cameron Zwarich
ad48a4fc32 A lo/hi mul has higher latency than an imul r,ri, e.g. 5 cycles compared to 3
on Core 2 and Nehalem, so the code we generate is better than GCC's here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126100 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 01:29:32 +00:00
Cameron Zwarich
8d7285d0e5 The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which
caused it to favor negative approximations over positive approximations in many
cases. Positive approximations require fewer operations beyond the multiplication.

In the case of division by 3, we still generate code that is a single instruction
larger than GCC's code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21 00:22:02 +00:00
Eric Christopher
893a882d09 If both operands are loads from stores in memory we can't use movlpd/movlps
since one needs to be a register operand. Just use movss instead of forcing
an operand into a register.

Fixes PR9239


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126072 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 05:04:42 +00:00
Oscar Fuentes
00d78f1348 Use explicit add_subdirectory's for LLVM target sublibraries instead
of testing for its presence at cmake time.

This way the build automatically regenerates the makefiles when a svn
update brings in a new sublibrary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20 02:55:27 +00:00
Eli Friedman
86b115c78b Minor x86 README updates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 21:54:28 +00:00
Chris Lattner
824a9076ea implement PR9264: disambiguating 'bt mem, imm' as a btl.
This is reasonable to do since all bt-mem forms do the
same thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 21:06:36 +00:00
Eric Christopher
dd6e40a4f4 Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126018 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19 03:19:09 +00:00
Chris Lattner
c1e4ce6044 add a poor division by constant case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125832 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 05:35:49 +00:00
Joerg Sonnenberger
5ad596f9d2 Recognize monitor/mwait with explicit register arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125805 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18 00:48:11 +00:00
Joerg Sonnenberger
97755a063e Recognize leavel and leaveq aliases for leave.
Validate encoding of leave in 64bit mode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125795 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 23:36:39 +00:00
David Greene
583b68f34f [AVX] Recorganize X86ShuffleDecode into its own library
(LLVMX86Utils.a) to break cyclic library dependencies between
LLVMX86CodeGen.a and LLVMX86AsmParser.a.  Previously this code was in
a header file and marked static but AVX requires some additional
functionality here that won't be used by all clients.  Since including
unused static functions causes a gcc compiler warning, keeping it as a
header would break builds that use -Werror.  Putting this in its own
library solves both problems at once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125765 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 19:18:59 +00:00
Dan Gohman
64849ce66f The labyrinthine X86 backend no longer appears to require
these patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125759 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 18:50:19 +00:00
NAKAMURA Takumi
6904f05e60 Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 generally.
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. In llvm side, i686 and x64 can be treated as similar way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125747 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:24:17 +00:00
NAKAMURA Takumi
e310b3a2a3 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125746 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17 12:23:50 +00:00
Stuart Hastings
a901129169 Swap VT and DebugLoc operands of getExtLoad() for consistency with
other getNode() methods.  Radar 9002173.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16 16:23:55 +00:00
Chris Lattner
0a9481f44f Enhance ComputeMaskedBits to know that aligned frameindexes
have their low bits set to zero.  This allows us to optimize
out explicit stack alignment code like in stack-align.ll:test4 when
it is redundant.

Doing this causes the code generator to start turning FI+cst into
FI|cst all over the place, which is general goodness (that is the
canonical form) except that various pieces of the code generator
don't handle OR aggressively.  Fix this by introducing a new
SelectionDAG::isBaseWithConstantOffset predicate, and using it
in places that are looking for ADD(X,CST).  The ARM backend in
particular was missing a lot of addressing mode folding opportunities
around OR.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125470 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-13 22:25:43 +00:00
Reid Kleckner
26f23100ac Add encodings and mnemonics for FXSAVE64 and FXRSTOR64.
These are just FXSAVE and FXRSTOR with REX.W prefixes.  These versions use
64-bit pointer values instead of 32-bit pointer values in the memory map they
dump and restore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125446 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-12 23:24:13 +00:00
Benjamin Kramer
d800cf0a50 Add a note about SSE4.1 roundss/roundsd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125438 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-12 17:58:16 +00:00
David Greene
2fcdfb448d [AVX] Implement 256-bit vector lowering for SCALAR_TO_VECTOR. This
largely completes support for 128-bit fallback lowering for code that
is not 256-bit ready.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125315 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 23:11:29 +00:00
David Greene
74a579d9eb [AVX] Implement 256-bit vector lowering for EXTRACT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125284 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10 16:57:36 +00:00
David Greene
6b38126da3 [AVX] Implement 256-bit vector lowering for INSERT_VECTOR_ELT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125187 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 15:32:06 +00:00
David Greene
f125a29885 [AVX] Implement BUILD_VECTOR lowering for 256-bit vectors. For
anything but the simplest of cases, lower a 256-bit BUILD_VECTOR by
splitting it into 128-bit parts and recombining.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125105 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 19:04:41 +00:00
David Greene
a5f2601e4d [AVX] Insert/extract subvector lowering support. This includes a
couple of utility functions that will be used in other places for more
AVX lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125029 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 19:36:54 +00:00
NAKAMURA Takumi
3f4be4fb86 Target/X86: Tweak allocating shadow area (aka home) on Win64. It must be enough for caller to allocate one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124949 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 15:11:32 +00:00
NAKAMURA Takumi
fb840c9117 lib/Target/X86/X86ISelLowering.cpp: Introduce a new variable "IsWin64". No functional changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124948 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 15:11:13 +00:00
NAKAMURA Takumi
9c7719e8b6 lib/Target/X86/X86JITInfo.cpp: Add Win64 stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124947 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 15:11:03 +00:00
NAKAMURA Takumi
2763538609 Target/X86: Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124946 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 15:10:54 +00:00
David Greene
66c357dbc4 [AVX] Revert 124910 until clients are ready.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124912 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05 00:24:41 +00:00
David Greene
ffc5533e7c [AVX] Add some utilities to insert and extract 128-bit subvectors.
This allows us to easily support 256-bit operations that don't have
native 256-bit support.  This applies to integer operations, certain
types of shuffles and various othher things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124910 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 23:29:33 +00:00
Daniel Dunbar
b412915ff6 MC/AsmParser: Add support for allowing the conversion process to fail (via
custom conversion functions).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124872 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 17:12:23 +00:00
David Greene
ccacdc1952 [AVX] Support VSINSERTF128 with more patterns and appropriate
infrastructure.  This makes lowering 256-bit vectors to 128-bit
vectors simple when 256-bit vector support is not available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124868 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-04 16:08:29 +00:00
David Greene
c38a03eeca [AVX] VEXTRACTF128 support. This commit includes patterns for
matching EXTRACT_SUBVECTOR to VEXTRACTF128 along with support routines
to examine and translate index values.  VINSERTF128 comes next.  With
these two in place we can begin supporting more AVX operations as
INSERT/EXTRACT can be used as a fallback when 256-bit support is not
available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124797 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 15:50:00 +00:00
Rafael Espindola
f297c93191 Fix PR9127 by reversing the operands even if they have more then one use.
Reversing the operands allows us to fold, but doesn't force us to. Also, at
this point the DAG is still being optimized, so the check for hasOneUse is not
very precise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124773 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03 03:58:05 +00:00
Sean Callanan
1e1901a294 Fixed a bug in the disassembler where the mandatory 0x66
prefix would be misinterpreted in some cases on 32-bit
x86 platforms.  Thanks to Olivier Meurant for identifying
the bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124709 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02 01:09:02 +00:00
Carl Norum
e47023d543 Test commit - fix a double 'should' in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124652 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 07:38:42 +00:00
Evan Cheng
2bffee2ee7 Patches to build EFI with Clang/LLVM. By Carl Norum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124639 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01 01:14:13 +00:00
Devang Patel
e9a7ea6865 Keep track of incoming argument's location while emitting LiveIns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124611 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31 21:38:14 +00:00
David Greene
54d8ebafc7 [AVX] Clean up the code to configure target lowering for AVX. Specify
how to lower more/new operations.  This is a prerequisite for adding
additional AVX lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124447 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 22:38:56 +00:00
Roman Divacky
bf7553210a Introduce virtual ParseRegister method in TargetAsmParser.
Create override of this method in X86/ARM/MBlaze.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 17:14:22 +00:00
NAKAMURA Takumi
40ccb798cc lib/Target/X86/X86ISelDAGToDAG.cpp: __main should be WINCALL64 on Win64.
CALL64 marks %xmm* as dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124354 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27 03:20:19 +00:00
David Greene
cfe33c46aa [AVX] Add INSERT_SUBVECTOR and support it on x86. This provides a
default implementation for x86, going through the stack in a similr
fashion to how the codegen implements BUILD_VECTOR.  Eventually this
will get matched to VINSERTF128 if AVX is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124307 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 19:13:22 +00:00
David Greene
91585098ef [AVX] Support EXTRACT_SUBVECTOR on x86. This provides a default
implementation of EXTRACT_SUBVECTOR for x86, going through the stack
in a similr fashion to how the codegen implements BUILD_VECTOR.
Eventually this will get matched to VEXTRACTF128 if AVX is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124292 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 15:38:49 +00:00
NAKAMURA Takumi
7754f85885 Target/X86: Tweak win64's tailcall.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 02:04:09 +00:00
NAKAMURA Takumi
e5fffe9c3f Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124270 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 02:03:37 +00:00
NAKAMURA Takumi
c5b7a4223d lib/Target/X86/X86RegisterInfo.cpp: Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124268 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 01:28:06 +00:00
NAKAMURA Takumi
b901076387 lib/Target/X86/X86RegisterInfo.cpp: Fix a typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124267 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-26 01:27:58 +00:00
Chris Lattner
ccea167db5 fix a missing shuffle pattern, PR9009. Patch by Artiom Myaskouvskey!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-24 03:42:46 +00:00
Rafael Espindola
96aa78c8c5 Add support for the --noexecstack option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124077 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 17:55:27 +00:00
Ted Kremenek
584520e8e2 Null initialize a few variables flagged by
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124073 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 17:05:06 +00:00
Rafael Espindola
1c13026e8f Remove more duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 04:43:11 +00:00
Rafael Espindola
c85dca66e6 Remove duplicated code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124054 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-23 04:28:49 +00:00
Eric Christopher
cdfe3c359b The stub routine that we're calling uses test and so clobbers
the flags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123712 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-18 01:37:20 +00:00
Douglas Gregor
e735882224 Add a missing <cctype> include, from Joerg Sonnenberger!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17 19:17:01 +00:00
Chris Lattner
dec28ceb02 fix PR8514, a bug where the "heroic" transformation of shift/and
into and/shift would cause nodes to move around and a dangling pointer
to happen.  The code tried to avoid this with a HandleSDNode, but 
got the details wrong.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123578 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-16 08:48:11 +00:00
Chris Lattner
9cd3da47f9 fix PR8981, a crash trying to form a conditional inc with a floating point compare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123560 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-16 02:56:53 +00:00
Chris Lattner
b99fdee325 reapply my fix for PR8961 with a tweak to properly handle
multi-instruction sequences like calls.  Many thanks to Jakob for
finding a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123559 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-16 02:27:38 +00:00
Ted Kremenek
d7f696edec 'HiReg' is written but never read. Nuke its
declaration and its assignments.

Found by clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123486 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 22:34:13 +00:00
Anton Korobeynikov
3965b5e974 Add a possibility to switch between CFI directives- and table-based frame description emission. Currently all the backends use table-based stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123476 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 21:58:08 +00:00
Anton Korobeynikov
e749911372 Cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123475 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 21:57:58 +00:00
Chris Lattner
d357e88740 revert my fastisel patch again which apparently still gives the
llvm-gcc-i386-linux-selfhost buildbot heartburn...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123431 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 06:14:33 +00:00
Chris Lattner
9e27cc8049 reapply r123414 now that the botz are calmed down and the fix is already in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123427 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 04:24:28 +00:00
Chris Lattner
a899d1c264 r123414 broke llvm-gcc bootstrap apparently, revert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123422 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 02:07:32 +00:00
Chris Lattner
d754041493 fix PR8961 - a fast isel miscompilation where we'd insert a new instruction
after sext's generated for addressing that got folded.  Previously we compiled
test5 into:

_test5:                                 ## @test5
## BB#0:
        movq    -8(%rsp), %rax          ## 8-byte Reload
        movq    (%rdi,%rax), %rdi
        addq    %rdx, %rdi
        movslq  %esi, %rax
        movq    %rax, -8(%rsp)          ## 8-byte Spill
        movq    %rdi, %rax
        ret

which is insane and wrong.  Now we produce:

_test5:                                 ## @test5
## BB#0:
	movslq	%esi, %rax
	movq	(%rdi,%rax), %rax
	addq	%rdx, %rax
	ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123414 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14 00:01:01 +00:00
Jakob Stoklund Olesen
f7ca976e74 Fix a few more places that should use MBB::getLastNonDebugInstr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123408 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 22:47:43 +00:00
Jakob Stoklund Olesen
4f28c1c714 Teach frame lowering to ignore debug values after the terminators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123399 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 21:28:52 +00:00
Eric Christopher
04f5079ca1 Experiment with changing the default 32-bit linux stack alignment to
16 bytes for PR8969. Update all testcases accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123367 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 06:47:10 +00:00
Chris Lattner
3a5004dc3e Fix PR8946, a missing reg/reg form of movdqu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123242 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-11 17:04:55 +00:00
Anton Korobeynikov
7af6fad0a7 Update CMake stuff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:39:23 +00:00
Anton Korobeynikov
16c29b5f28 Rename TargetFrameInfo into TargetFrameLowering. Also, put couple of FIXMEs and fixes here and there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 12:39:04 +00:00
Jakob Stoklund Olesen
c9df025e33 Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.
These functions not longer assert when passed 0, but simply return false instead.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-10 02:58:51 +00:00
Jakob Stoklund Olesen
b258135301 Fix the last virtual register enumerations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123102 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 23:11:11 +00:00
Evan Cheng
55d4200336 Recognize inline asm 'rev /bin/bash, ' as a bswap intrinsic call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123048 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 01:24:27 +00:00
Evan Cheng
c36b7069b4 Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.

This allows memory instructions to be moved around INLINEASM instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123044 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 23:50:32 +00:00
Evan Cheng
a5e1362f96 Revert r122955. It seems using movups to lower memcpy can cause massive regression (even on Nehalem) in edge cases. I also didn't see any real performance benefit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123015 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07 19:35:30 +00:00
Rafael Espindola
2f867a63da Correctly disassemble truncated asm.
Patch by Richard Simth.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 16:48:42 +00:00
Benjamin Kramer
5191e7cc26 Remove dead code and silence warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122957 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 13:01:02 +00:00
Evan Cheng
461f1fc359 Use movups to lower memcpy and memset even if it's not fast (like corei7).
The theory is it's still faster than a pair of movq / a quad of movl. This
will probably hurt older chips like P4 but should run faster on current
and future Intel processors. rdar://8817010


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122955 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 07:58:36 +00:00
Evan Cheng
0521928ae7 Re-implement r122936 with proper target hooks. Now getMaxStoresPerMemcpy
etc. takes an option OptSize. If OptSize is true, it would return
the inline limit for functions with attribute OptSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06 06:52:41 +00:00