Commit Graph

11208 Commits

Author SHA1 Message Date
Rafael Espindola
266a69f375 Tests that now pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 15:43:32 +00:00
NAKAMURA Takumi
605789564c test/CodeGen/X86/atomic_op.ll: Rename @main to @func. Extra sequences will be inserted to @main as prologue on cygming, to fail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115611 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 11:16:24 +00:00
Sean Callanan
90371ad165 Added a testcase for the ENTER instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115580 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-05 00:21:40 +00:00
Bill Wendling
6cf6c79e82 The pshufw instruction came about in MMX2 when SSE was introduced. Don't place
it in with the SSSE3 instructions.

Steward! Could you place this chair by the aft sun deck? I'm trying to get away
from the Astors. They are such boors!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 20:24:01 +00:00
Rafael Espindola
607d1f6d32 Implement ELF::R_X86_64_GOTPCREL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115547 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 19:51:39 +00:00
Rafael Espindola
92bf6684f6 Produce a R_X86_64_PLT32 when needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 19:04:13 +00:00
Rafael Espindola
28f9ac8101 Produce a R_X86_64_GOT32 when needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115537 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 18:44:25 +00:00
Jan Wen Voung
083cf1574f Add hook in MCSection to decide when to use "optimized nops", for each
section kind. Previously, optimized nops were only used for MachO.
Also added tests for ELF and COFF.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115523 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 17:32:41 +00:00
Rafael Espindola
55fb102130 Include the section address in the computation of the relocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 15:59:01 +00:00
Rafael Espindola
01263d35d4 Correctly compute the relocation when it is not in the first fragment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 15:28:43 +00:00
Anton Korobeynikov
e7beda183d va_args support for Win64.
Patch by Cameron!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 22:52:07 +00:00
Anton Korobeynikov
6af61ca789 Properly emit stack probe on win64 (for non-mingw targets).
Based on the patch by Cameron Esfahani!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 22:02:38 +00:00
Eli Friedman
d32d85e5ba Add 3DNowA instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 20:23:13 +00:00
Chris Lattner
ece290226a unbreak buildbot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115476 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 20:02:48 +00:00
Chris Lattner
591d76ea5a the immediate field of pshufw is actually an 8-bit field, not a 8-bit field that is sign extended. This fixes PR8288
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 19:09:13 +00:00
Chris Lattner
cc07d7116a add support for the prefetch/prefetchw instructions, move femms into
the right file.  The assembler supports all the 3dnow instructions now,
but not the "3dnowa" ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115468 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 18:42:30 +00:00
Chris Lattner
f132fa0e74 what the heck, add support for the rest of the 3dNow! binary operations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 18:24:18 +00:00
Chris Lattner
548abfcbd6 Implement support for the bizarre 3DNow! encoding (which is unlike anything
else in X86), and add support for pavgusb.  This is apparently the
only instruction (other than movsx) that is preventing ffmpeg from building
with clang.

If someone else is interested in banging out the rest of the 3DNow! 
instructions, it should be quite easy now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115466 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 18:08:05 +00:00
Bill Wendling
8e956f7e3e Add test to make sure that the MMX intrinsic calls make it out the other end in
tact.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115458 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 03:30:30 +00:00
Bill Wendling
4066010302 Auto-upgrade tests for the new MMX intrinsic calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115456 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 01:12:20 +00:00
Rafael Espindola
9d8b7555cd Implement a very basic PIC case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115454 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 00:46:57 +00:00
Chris Lattner
d476914607 fix a regression introduced in r115243, in which the instruction
backing int_x86_ssse3_pshuf_w got removed.  This caused PR8280.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 21:32:15 +00:00
Chris Lattner
b539b76038 actually, move the elf tests into the existing elf dir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115416 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 18:53:48 +00:00
Chris Lattner
90b12590b6 consolidate ELF tests into asmparser tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115415 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 18:52:57 +00:00
Chris Lattner
9ab044f20b move ARM MC tests up one level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115414 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-02 18:52:05 +00:00
Bill Wendling
43c78cda10 Need to specify SSE4 for machines which don't have SSE4. The code checked for is generated by SSE4. Otherwise, we get something else.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115352 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 21:39:35 +00:00
Owen Anderson
7267e14327 Now that the profitable bits of EnableFullLoadPRE have been enabled by default, rip out the remainder.
Anyone interested in more general PRE would be better served by implementing it separately, to get real
anticipation calculation, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115337 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 20:02:55 +00:00
Devang Patel
27f46cd639 Fix code gen crash reported in PR 8235. We still lose debug info for the unused argument here. This is a known limitation recorded debuginfo-tests/trunk/dbg-declare2.ll function 'f6' test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 19:00:44 +00:00
Bill Wendling
273ac840bc We must check for something.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 10:20:10 +00:00
Bill Wendling
c160218081 Disable tests until I can figure out why they're failing on just two machines but not others.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115308 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 10:01:10 +00:00
Bill Wendling
cc958c928f Try adding an mtriple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115307 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 09:40:50 +00:00
Kalle Raiskila
8258135c90 Zap some redundant 'ori $?, $?, 0' from SPU.
Also remove some code that died in the process.
One now non-existant ori is checked for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115306 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 09:20:01 +00:00
Bill Wendling
b1170f0e62 FileCheck-ize this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115304 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 08:55:48 +00:00
Bill Wendling
2b0ab5c370 FileCheck-ize this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115303 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 08:50:12 +00:00
Chris Lattner
6eff75104e fix PR8267 - Instcombine shouldn't optimizer away volatile memcpy's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115296 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 05:51:02 +00:00
Chris Lattner
e94aa76d2a upgrade this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 05:47:16 +00:00
Chris Lattner
2831a19495 fix rdar://8494845 + PR8244 - a miscompile exposed by my patch in r101350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 05:36:09 +00:00
Dale Johannesen
b0ab5d04dd One more +sse2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115293 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 05:08:18 +00:00
Chris Lattner
3286db670c move X86 subdir up a level
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 04:32:20 +00:00
Dale Johannesen
5db1eea91a Mark all these as needing SSE2. Should fix PPC and
maybe even Linux.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115291 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 04:17:55 +00:00
Dale Johannesen
81a0b9e41c Disable these tests for now; it's not obvious why they fail on Linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 00:59:21 +00:00
Dale Johannesen
9efef89b80 Make test not sensitive to register choice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01 00:16:17 +00:00
Dale Johannesen
0488fb649a Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics. 

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces.  Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:57:10 +00:00
NAKAMURA Takumi
929910925d test/CodeGen/X86/sibcall.ll: Add explicit triplets and remove XFAIL: apple-darwin8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 22:02:06 +00:00
Owen Anderson
722cc1f414 We do want to allow LoadPRE to perform LICM-like transformations: we already consider PHI nodes to be negligible for
code size (making this transform code size neutral), and it allows us to hoist values out of loops, which is always
a good thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115205 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:53:04 +00:00
Jakob Stoklund Olesen
7eb589d3f9 Try again to disable critical edge splitting in CodeGenPrepare.
The bug that broke i386 linux has been fixed in r115191.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:51:52 +00:00
Rafael Espindola
7eae36b38b Factor some logic into ShouldRelocOnSymbol. This simplifies the code and
fixes some cases where we were producing relocations with at symbol that
should use a section instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 20:18:35 +00:00
Jakob Stoklund Olesen
2622f4622c When isel is emitting instructions for an x86 target without CMOV, the CFG is
edited during emission.

If the basic block ends in a switch that gets lowered to a jump table, any
phis at the default edge were getting updated wrong. The jump table data
structure keeps a pointer to the header blocks that wasn't getting updated
after the MBB is split.

This bug was exposed on 32-bit Linux when disabling critical edge splitting in
codegen prepare.

The fix is to uipdate stale MBB pointers whenever a block is split during
emission.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115191 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 19:44:31 +00:00
Chris Lattner
1344488d65 more cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115178 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:29:05 +00:00
Chris Lattner
27c5215fbd merge and clean up tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115177 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:24:05 +00:00
Chris Lattner
a879dc717e merge two tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115175 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:18:22 +00:00
Chris Lattner
e73774dbb0 rename test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115174 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:16:49 +00:00
Chris Lattner
84d7ffdede generalize test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115172 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:15:42 +00:00
Chris Lattner
9e46d78809 rename test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115171 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:14:55 +00:00
Chris Lattner
ebfa86b434 merge two tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115170 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:14:30 +00:00
Chris Lattner
905f2e0669 preemptively add the rest of the non-n fpstack instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115168 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:11:29 +00:00
Chris Lattner
5660904a2c merge two tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115165 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:05:37 +00:00
Chris Lattner
198b9797b4 fix this to not be completely broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:04:59 +00:00
Chris Lattner
18e5179f3d update, unxfail, fix bogus encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:03:20 +00:00
Chris Lattner
0d5d7a019c update and unxfail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115162 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 17:00:53 +00:00
Chris Lattner
bf840a198d unxfail this by fixing syntactic differences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:59:28 +00:00
Chris Lattner
9ee4aed3b6 implement support for finit, PR8258
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115156 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:42:53 +00:00
Chris Lattner
0bb83a84d4 add support for fstcw, PR8259
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 16:39:29 +00:00
Jan Wen Voung
186e7a0fb1 Move logic of determining ELF entsize from the .s printer to initialization
time. That way, the EntrySize field is initialized for other code paths, 
namely, the .ll -> .o code path.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115141 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 05:59:22 +00:00
Rafael Espindola
1b6285cd72 Add another test that now passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115137 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 04:22:07 +00:00
Rafael Espindola
a8c02c3bdd Correctly produce R_X86_64_32 or R_X86_64_32S.
With this patch in

movq    $foo, foo(%rip)
foo:
.long   foo

We produce a R_X86_64_32S for the first relocation and R_X86_64_32 for the
second one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 03:11:42 +00:00
Jason W Kim
afd1cc2578 Tiny patch for proof-of-concept cleanup of ARMAsmPrinter::EmitStartOfAsmFile()
Small test for sanity check of resulting ARM .s file.
Tested against -r115129.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115133 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:45:56 +00:00
Jan Wen Voung
12ad94e03c Have ELFAsmParser.cpp use the already parsed "Size" (entry size) when
constructing a section. Test for a few cases also included.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115132 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:41:46 +00:00
Rafael Espindola
7070387f08 Make it possible for the MCObjectWriter to decide if a given fixup is fully
resolved or not. Different object files have different restrictions and
different native assemblers have different idiosyncrasies we want to emulate
for now.

Move the existing MachO logic to the new place and implement an ELF one that
gets fixups to globals right.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115131 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 02:22:20 +00:00
Benjamin Kramer
9510a2538b Add constant folding for strspn and strcspn to SimplifyLibCalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 00:58:35 +00:00
Benjamin Kramer
05f585e28b Add strpbrk folding to SimplifyLibCalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115111 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 23:52:12 +00:00
Benjamin Kramer
e260990fa1 Simplify the loop in StrChrOptimizer. FileCheckize test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115095 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 22:29:12 +00:00
Benjamin Kramer
06f25cfb33 Teach SimplifyLibCalls how to optimize strrchr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 21:50:51 +00:00
Devang Patel
9dd2b47d44 Generalize DISubprogram element to encode various flags instead of just one boolean for isArtificial.
This is a backword compatible change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115084 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 21:04:46 +00:00
Owen Anderson
36c4debc94 Fix PR8247: JumpThreading can cause a block to become unreachable while still having predecessor, if it is part of a self-loop.
Because of this, we cannot use the Simplify* APIs, as they can assert-fail on unreachable code.  Since it's not easy to determine
if a given threading will cause a block to become unreachable, simply defer simplifying simplification to later InstCombine and/or
DCE passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115082 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 20:34:41 +00:00
Benjamin Kramer
3e45b77612 Remove PointerTracking tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115072 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 19:20:35 +00:00
Chris Lattner
a25f933396 implement rdar://8491845 - Gas supports commuted forms of non-commutable instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115061 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 18:39:16 +00:00
Bob Wilson
7122ba7efb Increase ARM APCS preferred alignment for i64 and f64 from 32 bits to 64 bits.
LDM/STM instructions can run one cycle faster on some ARM processors if the
memory address is 64-bit aligned.  Radar 8489376.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 17:54:10 +00:00
Rafael Espindola
9e3922e949 Move "local commons" to the end of .bss to match the gnu as behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115037 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 14:52:01 +00:00
Rafael Espindola
9804db1353 Add a test that I forgot to add with a previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115036 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 14:40:49 +00:00
Gabor Greif
1f01d45ee0 do not compare actual branch labels; this may fix llvm-gcc-x86_64-darwin10-cross-mingw32 buildbot too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115034 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 10:45:43 +00:00
Gabor Greif
05642a3eba improve heuristics to find the 'and' corresponding to 'tst' to also catch opportunities on thumb2
added some doxygen on the way

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115033 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 10:12:08 +00:00
Chris Lattner
6f42027263 fix rdar://8490728 - llvm-mc rejects gpr64 form of 'movmskpd'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115029 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 05:05:03 +00:00
Chris Lattner
f3654db458 add assembler support for the cvtsd2sil/cvtsd2siq mnemonics, rdar://8456382
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 04:55:40 +00:00
Michael J. Spencer
2baa2a8cc7 MC-COFF: Fix test. IMAGE_SYM_CLASS_LABEL should never have been emitted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115024 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 03:59:25 +00:00
Chris Lattner
78a194693b make the x86 mccode emitter emit the 0x67 and 0x66 prefix bytes in the same
order as cctools for diffability.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115022 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 03:43:43 +00:00
Chris Lattner
8a5072903e implement support for 32-bit address operands in 64-bit mode, which
are defined to emit the 0x67 prefix byte.  rdar://8482675


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 03:33:25 +00:00
Chris Lattner
b2ef4c1235 add basic avx support to the disassembler, also teach it about ssmem/sdmem
operands.

With this done, we can remove the _Int suffixes from the round instructions
without the disassembler blowing up.  This allows the assembler to support
them, implementing rdar://8456376 - llvm-mc rejects 'roundss'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115019 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 02:57:56 +00:00
Chris Lattner
bf6018ac5a add asmparser support for cvttpd2dq by removing some Int_ prefixes.
Clean up cvttps2dq by removing some redundant implementations of the
same instruction.  rdar://8456382


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115018 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 02:36:32 +00:00
Chris Lattner
0c04e4f58f implement rdar://8456382 - cvtsd2si support, by removing some Int_ prefixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115017 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 02:24:57 +00:00
Chris Lattner
7c51a3172c implement rdar://8456378 and PR7557 - support for the fstsw,
an instruction that requires a WHOLE NEW wonderful kind of alias.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29 01:50:45 +00:00
Bill Wendling
e48155b25a And remove r114997's test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115003 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 23:24:18 +00:00
Bill Wendling
2ff6e1e62c Revert r114997. It was causing a failure on darwin10-selfhost.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115002 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 23:11:55 +00:00
Bill Wendling
4edab1a9e8 Fix a FIXME. _foo.eh symbols are currently always exported so that the linker
knows about them. This is not necessary on 10.6 and later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114997 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 22:36:56 +00:00
Owen Anderson
654d5440a4 Add a subtarget hook for reporting the misprediction penalty. Use this to provide more precise
cost modeling for if-conversion.  Now if only we had a way to estimate the misprediction probability.

Adjsut CodeGen/ARM/ifcvt10.ll.  The pipeline on Cortex-A8 is long enough that it is still profitable
to predicate an ldm, but the shorter pipeline on Cortex-A9 makes it unprofitable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 21:57:50 +00:00
Anton Korobeynikov
4f922f2cca User proper libcall names & condcodes while compiling for ARM EABI.
Patch by Evzen Muller!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114991 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 21:39:26 +00:00
Owen Anderson
b20b85168c Part one of switching to using a more sane heuristic for determining if-conversion profitability.
Rather than having arbitrary cutoffs, actually try to cost model the conversion.

For now, the constants are tuned to more or less match our existing behavior, but these will be
changed to reflect realistic values as this work proceeds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 18:32:13 +00:00
Jim Grosbach
c2ec02c183 Add target triple info to these tests to make the results comparable when
hosted on different platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114965 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 17:10:36 +00:00
Rafael Espindola
53725bc57a On elf, undefined symbols can start with .L.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114958 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 16:19:11 +00:00
Bob Wilson
02aba73a9e Add a command line option "-arm-strict-align" to disallow unaligned memory
accesses for ARM targets that would otherwise allow it.  Radar 8465431.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114941 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-28 04:09:35 +00:00
Rafael Espindola
c3c413f631 Write relocations in the end of the file. This matches what gas does and
makes files easier to diff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114898 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 22:04:54 +00:00
Rafael Espindola
0453dd9ca0 Make sure .text doesn't produce extra alignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 21:40:27 +00:00
Jakob Stoklund Olesen
1f386c4ce1 Don't try to constant fold libm functions with non-finite arguments.
Usually we wouldn't do this anyway because llvm_fenv_testexcept would return an
exception, but we have seen some cases where neither errno nor fenv detect an
exception on arm-linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 21:29:20 +00:00
Daniel Dunbar
4f2afe3d39 MC/AsmParser: Handle exponents in floating point literals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 20:12:52 +00:00
Jakob Stoklund Olesen
08342f2d11 Revert "Disable codegen prepare critical edge splitting. Machine instruction passes now"
This reverts revision 114633. It was breaking llvm-gcc-i386-linux-selfhost.

It seems there is a downstream bug that is exposed by
-cgp-critical-edge-splitting=0. When that bug is fixed, this patch can go back
in.

Note that the changes to tailcallfp2.ll are not reverted. They were good are
required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114859 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 18:43:48 +00:00
Jakob Stoklund Olesen
b53afc6a12 Explicitly disable CGP critical edge splitting for this test so it won't break
by reenabling it temporarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 18:43:43 +00:00
Jakob Stoklund Olesen
4c2c865a51 Don't depend on basic block numbering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 18:43:40 +00:00
Michael J. Spencer
a72d87899b MC-COFF: Drop empty sections, and label symbols. Convert relocations
targeted at symbols into relocations relative to the containing section.

Patch by Nathan Jeffords!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 08:58:26 +00:00
Chris Lattner
2956462742 yet more aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114822 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 07:24:57 +00:00
Chris Lattner
b1162fc05e add a couple more aliases, rdar://8456378
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 07:21:41 +00:00
Chris Lattner
df967d6137 fix rdar://8470918 - llvm-mc can't assemble smovl
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 07:11:53 +00:00
Chris Lattner
cb296ec0b6 Fix rdar://8468087 - llvm-mc commutes fmul (and friend) operands.
My previous fix for rdar://8456371 should only apply to fmulp/faddp,
not to fmul/fadd.  Instruction set orthogonality is overrated or 
something.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 07:08:21 +00:00
Chris Lattner
8048ebe91d the latest assembler that runs on powerpc 10.4 machines doesn't
support aligned comm.  Detect when compiling for 10.4 and don't
emit an alignment for comm.  THis will hopefully fix PR8198.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 06:44:54 +00:00
Chris Lattner
fd8fddd830 implement support for 'clr' alias. This is part of rdar://8416805,
but balrog was wanting it on irc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-27 04:23:03 +00:00
Che-Liang Chiou
8db2defa83 Add test case for PTX ret instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 07:49:54 +00:00
Che-Liang Chiou
f9930da2ef Add ret instruction to PTX backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 07:46:17 +00:00
Rafael Espindola
73ffea47d2 Move ELF to HasReliableSymbolDifference=true. Also take the opportunity to put
symbols defined in merge sections in independent atoms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 05:42:19 +00:00
Owen Anderson
b0ba0f4170 LoadPRE was not properly checking that the load it was PRE'ing post-dominated the block it was being hoisted to.
Splitting critical edges at the merge point only addressed part of the issue; it is also possible for non-post-domination
to occur when the path from the load to the merge has branches in it.  Unfortunately, full anticipation analysis is
time-consuming, so for now approximate it.  This is strictly more conservative than real anticipation, so we will miss
some cases that real PRE would allow, but we also no longer insert loads into paths where they didn't exist before. :-)

This is a very slight net positive on SPEC for me (0.5% on average).  Most of the benchmarks are largely unaffected, but
when it pays off it pays off decently: 181.mcf improves by 4.5% on my machine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-25 05:26:18 +00:00
Rafael Espindola
a648918eb7 Reapply 114678 and 114667. Reverting them did not fix the bot:
http://google1.osuosl.org:8011/builders/llvm-gcc-i386-linux-selfhost/builds/69

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114761 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 21:19:03 +00:00
Jakob Stoklund Olesen
ed37a64c46 Be more precise when trying to XFAIL this tester: http://google1.osuosl.org:8011/builders/llvm-arm-linux
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114755 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 20:34:49 +00:00
Evan Cheng
fff606d7b2 Enable code placement optimization pass for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 19:07:23 +00:00
Rafael Espindola
cd4b20a25b Revert 114678 and 114667 to see if
http://google1.osuosl.org:8011/builders/llvm-gcc-i386-linux-selfhost

gets happy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 18:48:08 +00:00
Daniel Dunbar
facb34b41c MC/AsmParser: Handle a missed case of floating literals in the lexer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114733 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 17:10:26 +00:00
Michael J. Spencer
ee6944f4ab CMake: Build unittests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 09:01:13 +00:00
Michael J. Spencer
c8417d7165 Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114724 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 09:00:56 +00:00
Daniel Dunbar
b95a079cae MC/AsmParser: Support .single and .double for embedding floating point literals.
- I believe more modern 'gas' supports a more enhanced set of arithmetic on
   them, but for now the only thing we can do is emit them as data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-24 01:59:56 +00:00
Bob Wilson
2a6e616142 Set alignment operand for NEON VST instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 23:42:37 +00:00
Bob Wilson
40ff01a030 Set alignment operand for NEON VLD instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 21:43:54 +00:00
Rafael Espindola
e15eb4e14c Correctly handle weak undefined symbols. Before we would get a invalid binding
(2 == STB_WEAK | STB_GLOBAL).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 19:55:14 +00:00
Rafael Espindola
b142bef30b Represent relocations against local symbols as relocations against the section
they are in. Both ways should be equivalent, but gas produces relocations
against the section.

Roman wrote the patch, I added the test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 17:25:18 +00:00
Bob Wilson
edf017487f Fix llvm-extract so that it changes the linkage of all GlobalValues to
"external" even when doing lazy bitcode loading.  This was broken because
a function that is not materialized fails the !isDeclaration() test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 17:25:06 +00:00
Evan Cheng
dd3a41a6b3 Disable codegen prepare critical edge splitting. Machine instruction passes now
break critical edges on demand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114633 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 06:55:34 +00:00
Dan Gohman
be2d4e77b5 Fix llvm-extract -delete's lazy loading to materialize the functions that
will not be deleted, rather than the ones that will.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114614 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 00:33:13 +00:00
Owen Anderson
ed1088afb5 A select between a constant and zero, when fed by a bit test, can be efficiently
lowered using a series of shifts.
Fixes <rdar://problem/8285015>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114599 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 22:58:22 +00:00
Cameron Esfahani
4af1eaee70 Fix PR8201: Update the code to call via X86::CALL64pcrel32 in the 64-bit case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 22:35:21 +00:00
Rafael Espindola
59ff3c9134 Avoid some Mach-O specific alignment being done on ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 22:27:05 +00:00
Rafael Espindola
1963572f9d Correctly align bss.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114556 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 17:43:04 +00:00
Mikhail Glushenkov
3724945025 llvmc: Support '-emit-llvm -S' with -opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114541 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 09:00:41 +00:00
Chris Lattner
2c5291b563 fix rdar://8456371 - Handle commutable instructions written backward.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 06:26:39 +00:00
Chris Lattner
1eb1b68e3a Fix an inconsistency in the x86 backend that led it to reject "calll foo" on
x86-32: 32-bit calls were named "call" not "calll".  64-bit calls were correctly
named "callq", so this only impacted x86-32.

This fixes rdar://8456370 - llvm-mc rejects 'calll'

This also exposes that mingw/64 is generating a 32-bit call instead of a 64-bit call,
I will file a bugzilla.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 05:49:14 +00:00
Chris Lattner
bc57c6db4a fix rdar://8456412 - llvm-mc crash in encoder on "mov %rdx, %cr8"
Teaching the code generator about CR8-15, how to rex them up, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114533 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 05:29:50 +00:00
Chris Lattner
f7d4da0c1d fix rdar://8456417 - llvm-mc can't do basic math
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114532 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 05:05:16 +00:00
Chris Lattner
c2b942acf6 add the missing aliases for fp stack cmovs, rdar://8456391
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 04:56:20 +00:00
Chris Lattner
f93b90c5df reimplement elf TLS support in terms of addressing modes, eliminating SegmentBaseAddress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 04:39:11 +00:00
Chris Lattner
33d60d5e56 Fix rdar://8456364 - llvm-mc rejects '%CS'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 04:11:10 +00:00
Chris Lattner
0c289c140e fix rdar://8456389 - llvm-mc mismatch with 'as' on 'fstp'
-This line, and those below, will be ignored--

M    test/MC/AsmParser/X86/x86_instructions.s
M    lib/Target/X86/AsmParser/X86AsmParser.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114527 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 04:04:03 +00:00
Chris Lattner
61129252e4 fix rdar://8456361 - llvm-mc rejects 'rep movsd'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114526 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 03:50:32 +00:00
Chris Lattner
40d66052f4 linux has a different stack alignment than the mac, relax this a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114519 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:46:26 +00:00
Chris Lattner
8864155a35 give VZEXT_LOAD a memory operand, it now works with segment registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:34:38 +00:00
Chris Lattner
0b79cfee15 revert r114386 now that address modes work correctly, we get a nice
call through gs-relative memory now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114510 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:11:31 +00:00
Chris Lattner
93c4a5bef7 give LCMPXCHG_DAG[8] a memory operand, allowing it to work with addrspace 256/257
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 23:59:42 +00:00
Chris Lattner
b72d53d8ef filecheckize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 23:57:27 +00:00
Evan Cheng
691e64a54c OptimizeCompareInstr should avoid iterating pass the beginning of the MBB when the 'and' instruction is after the comparison.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114506 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 23:49:07 +00:00
Owen Anderson
8614167572 Enable target-specific mul-lowering on ARM, even at -Os. Remove a test that this makes
irrelevant, but add a new test for the new, improved functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 22:51:46 +00:00
Devang Patel
161f0caaf9 Use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114475 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:50:32 +00:00
Owen Anderson
c004eec71b When adding the carry bit to another value on X86, exploit the fact that the carry-materialization
(sbbl x, x) sets the registers to 0 or ~0.  Combined with two's complement arithmetic, we can fold
the intermediate AND and the ADD into a single SUB.

This fixes <rdar://problem/8449754>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114460 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:41:19 +00:00
Mikhail Glushenkov
46aa524f0d llvmc: Allow multiple output languages.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 14:59:42 +00:00
Chris Lattner
08bad54baf fix rdar://8453210, a crash handling a call through a GS relative load.
For now, just disable folding the load into the call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114386 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 03:37:00 +00:00
Rafael Espindola
f7c10a3cff Implement support for .local and its "interesting" interactions with .comm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114382 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 00:24:38 +00:00
Evan Cheng
44be1a8d66 Enable machine sinking critical edge splitting. e.g.
define double @foo(double %x, double %y, i1 %c) nounwind {
  %a = fdiv double %x, 3.2
  %z = select i1 %c, double %a, double %y
  ret double %z
}

Was:
_foo:
        divsd   LCPI0_0(%rip), %xmm0
        testb   $1, %dil
        jne     LBB0_2
        movaps  %xmm1, %xmm0
LBB0_2:
        ret

Now:
_foo:
        testb   $1, %dil
        je      LBB0_2
        divsd   LCPI0_0(%rip), %xmm0
        ret
LBB0_2:
        movaps  %xmm1, %xmm0
        ret

This avoids the divsd when early exit is taken.
rdar://8454886


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114372 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 22:52:00 +00:00
Owen Anderson
765fd9c62d CombinerAA is now reordering these stores.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114354 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 20:56:29 +00:00
Owen Anderson
4a9f150926 When TCO is turned on, it is possible to end up with aliasing FrameIndex's. Therefore,
CombinerAA cannot assume that different FrameIndex's never alias, but can instead use
MachineFrameInfo to get the actual offsets of these slots and check for actual aliasing.

This fixes CodeGen/X86/2010-02-19-TailCallRetAddrBug.ll and CodeGen/X86/tailcallstack64.ll
when CombinerAA is enabled, modulo a different register allocation sequence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 20:39:59 +00:00
Jim Grosbach
1dc335a79f Simplify ARM callee-saved register handling by removing the distinction
between the high and low registers for prologue/epilogue code. This was
a Darwin-only thing that wasn't providing a realistic benefit anymore.
Combining the save areas simplifies the compiler code and results in better
ARM/Thumb2 codegen.

For example, previously we would generate code like:
        push    {r4, r5, r6, r7, lr}
        add     r7, sp, #12
        stmdb   sp!, {r8, r10, r11}
With this change, we combine the register saves and generate:
        push    {r4, r5, r6, r7, r8, r10, r11, lr}
        add     r7, sp, #12

rdar://8445635



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 19:32:20 +00:00
Rafael Espindola
43779dcfef Produce a R_X86_64_32 when the value is >=0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 19:20:47 +00:00
NAKAMURA Takumi
e6af80d11d test/CodeGen/X86: Add explicit triplet -mtriple=i686-linux to 3 tests incompatible to Win32 codegen.
r114297 raises 3 failures. They might fail also on mingw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-19 21:58:55 +00:00
Eric Christopher
50880d08ec Add the exit instruction to the PTX target.
Patch by Che-Liang Chiou <clchiou@gmail.com>!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 18:52:28 +00:00
Rafael Espindola
ad49cf5866 Make sure the STT_FILE symbol is the first one in the symbol table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114285 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 15:03:21 +00:00
Owen Anderson
14ac1dd2be Invert the logic of reachesChainWithoutSideEffects(). What we want to check is that there is
NO path to the destination containing side effects, not that SOME path contains no side effects.
In  practice, this only manifests with CombinerAA enabled, because otherwise the chain has little
to no branching, so "any" is effectively equivalent to "all".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114268 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 04:45:14 +00:00
Rafael Espindola
d3dce16ffe Add test that was missing in my previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 00:37:27 +00:00
Dan Gohman
23110b3c16 Attempt to XFAIL this test on arm-linux, which is inexplicably failing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114241 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18 00:04:37 +00:00
Benjamin Kramer
92aa1f7123 Fix vmov.f64 disassembly on targets where sizeof(long) != 8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114240 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 23:48:07 +00:00
Bob Wilson
75f0288b7d Add target-specific DAG combiner for BUILD_VECTOR and VMOVRRD. An i64
value should be in GPRs when it's going to be used as a scalar, and we use
VMOVRRD to make that happen, but if the value is converted back to a vector
we need to fold to a simple bit_convert.  Radar 8407927.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114233 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 22:59:05 +00:00
Jim Grosbach
e6be85e9ff Teach the (non-MC) instruction printer to use the cannonical names for push/pop,
and shift instructions on ARM. Update the tests to match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114230 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 22:36:38 +00:00
Evan Cheng
6edb0eac87 Teach machine sink to
1) Do forward copy propagation. This makes it easier to estimate the cost of the
   instruction being sunk.
2) Break critical edges on demand, including cases where the value is used by
   PHI nodes.
Critical edge splitting is not yet enabled by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114227 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 22:28:18 +00:00
Jim Grosbach
9ce75625eb Update tests to handle MC-inst instruction printing of shift operations. The
legacy asm printer uses instructions of the form, "mov r0, r0, lsl #3", while
the MC-instruction printer uses the form "lsl r0, r0, #3". The latter mnemonic
is correct and preferred according the ARM documentation (A8.6.98). The former
are pseudo-instructions for the latter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114221 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 21:58:46 +00:00
Jim Grosbach
db664ad71e FileCheck-ize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114218 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 21:46:16 +00:00
Jim Grosbach
1aaf4cb393 Move thumb2 tests to the thumb2 directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114206 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:34:09 +00:00
Jim Grosbach
c0911c3b3e tweak test to check instructions rather than relying on the comment string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114204 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:27:26 +00:00
Dan Gohman
4e51a12ed7 Fix this test to avoid an "inexact" fold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114202 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:25:43 +00:00
Dan Gohman
d8c0a51362 Avoid emitting a PIC base register if no PIC addresses are needed.
This fixes rdar://8396318.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114201 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:24:24 +00:00
Jim Grosbach
d4ef24344a tweak test to check instructions rather than relying on the comment string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114200 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:21:03 +00:00
Jim Grosbach
48afc24274 tweak test to check instructions rather than relying on the comment string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114199 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:17:41 +00:00
Dan Gohman
80d6c96c2a Fix this test so that folding doesn't depend on a potentially
"inexact" result.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114198 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 20:15:53 +00:00
Chris Lattner
40cc3f8783 fix rdar://8444631 - encoder crash on 'enter'
What a weird instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114190 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 18:02:29 +00:00
Daniel Dunbar
23bea41ec6 MC/Mach-O/i386: Fix a crash in relocation handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114176 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 15:21:50 +00:00
Oscar Fuentes
c6a8c0580b tests/CMakeLists.txt: use configure_file' instead of sed'.
The Windows users will appreciate this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114158 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 03:22:21 +00:00
Daniel Dunbar
cceba83893 MC/AsmParser: Add support for 'a + 4@GOTPCREL' and friends, by reconsing the
expression to include the modifier.
 - Gross, but this a corner case we don't expect to see often in practice, but
   it is worth accepting.
 - Also improves diagnostics on invalid modifiers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114154 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 02:47:07 +00:00
Dan Gohman
8ee731f2ce Fix the folding of floating-point math library calls, like sin(infinity),
so that it detects errors on platforms where libm doesn't set errno.
It's still subject to host libm details though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114148 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-17 01:38:06 +00:00
Devang Patel
1905a18abc If FE forgot to provide a file name (usually it uses "stdin" as name in such situation) then make one up to ensure that debug info is not malformed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114119 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 20:57:49 +00:00
Chris Lattner
35aa94b229 fix rdar://8438816 - unrecognized 'fildq' instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114116 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 20:46:38 +00:00
Rafael Espindola
71859c640f Print the address of sections as 0 and create the metadata sections in the
same order as gnu as.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114109 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 19:46:31 +00:00
Owen Anderson
b86f57c606 Add missing RUN line to this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114106 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 18:46:23 +00:00
Dale Johannesen
677c6ecd08 When substituting sunkaddrs into indirect arguments an asm, we were
walking the asm arguments once and stashing their Values.  This is
wrong because the same memory location can be in the list twice, and
if the first one has a sunkaddr substituted, the stashed value for the
second one will be wrong (use-after-free).  PR 8154.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 18:30:55 +00:00
Owen Anderson
c2ce21ad51 It is possible, under specific circumstances involving ptrtoint ConstantExpr's, for LVI to end up trying to merge
a Constant into a ConstantRange.  Handle this conservatively for now, rather than asserting.  The testcase is
more complex that I would like, but the manifestation of the problem is sensitive to iteration orders and the state of the
LVI cache, and I have not been able to reproduce it with manually constructed or simplified cases.

Fixes PR8162.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114103 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 18:28:33 +00:00
Owen Anderson
4b91c3ac96 Fix PR8161, in which an unreachable loop causes recursive instruction simplification to try
to replace an instruction with itself.  Add a predicate to the simplifier to prevent this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 17:42:36 +00:00
Rafael Espindola
34e3d0cfe5 Make sure that names like .note.GNU-stack are accepted as valid section names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114091 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 17:05:55 +00:00
Rafael Espindola
2ea2ac798b Add support for the .zero directive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114077 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 15:03:59 +00:00
Kalle Raiskila
1cd1b0b283 Change SPU register re-interpretations from OR to COPY_TO_REGCLASS instruction.
This cleans up after the mess r108567 left in the CellSPU backend.
ORCvt-instruction were used to reinterpret registers, and the ORs were then
removed by isMoveInstr(). This patch now removes 350 instrucions of format:
	or $3, $3, $3
(from the 52 testcases in CodeGen/CellSPU). One case of a nonexistant or is
checked for.

Some moves of the form 'ori $., $., 0' and 'ai $., $., 0' still remain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114074 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16 12:29:33 +00:00
Jim Grosbach
b9dadc9066 add a test of an edge case value for the FP immediate (needs all digits of
precision)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114028 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 21:52:13 +00:00
Rafael Espindola
d80781b98b Add a InitSections method to the streamer interface.
The ELF implementation now creates text, data and bss to match the gnu as
behavior.

The text streamer still has the old MachO specific behavior since
the testsuite checks that it will error when a directive is given
before a setting the current section for example.

A nice benefit is that -n is not required anymore when producing
ELF files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114027 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 21:48:40 +00:00
Jim Grosbach
60396975be Teach the MC disassembler to handle vmov.f32 and vmov.f64 immediate to register
moves. Previously, the immediate was printed as the encoded integer value,
which is incorrect.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114021 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 21:04:54 +00:00
Eli Friedman
39e30124e5 PR7959: Handle negative scales in GEPs correctly in BasicAA for non-64-bit
targets.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114015 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 20:08:03 +00:00
Bob Wilson
3a951829fe Reapply Gabor's 113839, 113840, and 113876 with a fix for a problem
encountered while building llvm-gcc for arm.  This is probably the same issue
that the ppc buildbot hit. llvm::prior works on a MachineBasicBlock::iterator,
not a plain MachineInstr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113983 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 17:12:08 +00:00
Gabor Greif
7602993f2d the darwin9-powerpc buildbot keeps consistently crashing,
backing out following to get it back to green,
so I can investigate in peace:

svn merge -c -113840  llvm/test/CodeGen/ARM/arm-and-tst-peephole.ll
svn merge -c -113876 -c -113839 llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113980 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 16:53:07 +00:00
Mikhail Glushenkov
e6334d84f7 llvmc: make -x work with unknown suffixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113972 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 15:20:41 +00:00
Chris Lattner
d0bcc9a015 lcall and ljmp always default to lcalll and ljmpl. This finally
wraps up r8418316


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113949 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 05:30:20 +00:00
Chris Lattner
cbb442640f apparently jmpl $1,$2 is an alias for ljmpl, similiarly
for call.  Add this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113948 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 05:25:21 +00:00
Chris Lattner
250b948f21 Disambiguate lcall/ljmp to the 32-bit version. This happens
even in 64-bit mode apparently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 05:14:54 +00:00
Chris Lattner
6c1b3b1e32 fix the encoding of sldt GR16 to have the 0x66 prefix, and
add sldt GR32, which isn't documented in the intel manual
but which gas accepts.  Part of rdar://8418316


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113938 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 04:45:10 +00:00
Chris Lattner
cfad564043 implement aliases for shld/shrd, part of rdar://8418316
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113937 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 04:37:18 +00:00
Chris Lattner
e9e16a36d9 fix rdar://8431880 - rcl/rcr with no shift amount not recognized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113936 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 04:33:27 +00:00
Chris Lattner
84f362d891 add various broken forms of fnstsw. I didn't add the %rax
version because it adds a prefix and makes even less sense
than the other broken forms.  This wraps up rdar://8431422


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113932 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 04:15:16 +00:00
Chris Lattner
8f777a205e add some aliases for f[u]comi, part of rdar://8431422
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113930 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 04:08:38 +00:00
Chris Lattner
2d592d10a5 add a bunch of aliases for fp operations with no operand,
rdar://8431422


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113929 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 04:04:33 +00:00
Michael J. Spencer
00002796bb test: Fix coff-dump section array indicies to 1 based to match file format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 03:58:51 +00:00
Michael J. Spencer
9c0c5c16e9 Tabs to spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 03:58:39 +00:00
Michael J. Spencer
aeb83c4d40 Cleanup coff-dump.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 03:58:24 +00:00
Chris Lattner
49ddd3a1a4 fix PR8144, a bug where constant merge would merge globals marked
attribute(used).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113911 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15 00:30:11 +00:00
Jim Grosbach
05ae0c6026 Reapply r113875 with additional cleanups.
"The register specified for a dregpair is the corresponding Q register, so to
get the pair, we need to look up the sub-regs based on the qreg. Create a
lookup function since we don't have access to TargetRegisterInfo here to
be able to use getSubReg(ARM::dsub_[01])."

Additionaly, fix the NEON VLD1* and VST1* instruction patterns not to use
the dregpair modifier for the 2xdreg versions. Explicitly specifying the two
registers as operands is more correct and more consistent with the other
instruction patterns. This enables further cleanup of special case code in the
disassembler as a nice side-effect.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113903 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 23:54:06 +00:00
Chris Lattner
ef63c9a9b6 add a terrible hack to allow out with dx is parens, a gas bug.
This fixes PR8114


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 23:34:29 +00:00
Owen Anderson
2a0fd011c2 Remove dead option from tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 21:03:40 +00:00
Gabor Greif
6f9eea87f7 forgot the testcase change for r113839
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 09:30:17 +00:00
Gabor Greif
4e05b32509 test for and-tst peephole optimization
documents the status-quo with its opportunities

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 08:50:43 +00:00
Chris Lattner
7abdb22e52 fix PR8102, a case where we'd copyValue from a value that we already
deleted.  Fix this by doing the copyValue's before we delete stuff!

The testcase only repros the problem on my system with valgrind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113820 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14 00:19:00 +00:00
Dale Johannesen
8e88c908b0 Basic smoke test for new x86mmx type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 21:01:36 +00:00
Owen Anderson
da53582d11 Add a reduced testcase for the infinite loop fixed in r113763.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 18:28:40 +00:00
Owen Anderson
2c5f19db2e Re-apply r113679, which was reverted in r113720, which added a paid of new instcombine transforms
to expose greater opportunities for store narrowing in codegen.  This patch fixes a potential
infinite loop in instcombine caused by one of the introduced transforms being overly aggressive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 17:59:27 +00:00
Duncan Sands
51a645520a Spelling fixes in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 13:32:22 +00:00
Eric Christopher
298c45e845 Revert 113679, it was causing an infinite loop in a testcase that I've sent
on to Owen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-12 06:09:23 +00:00
Chris Lattner
0989d29d09 add a missed cmov alias, part of rdar://8416805
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 17:08:22 +00:00
Chris Lattner
697d37a436 add support for all the setCC aliases. Part of rdar://8416805
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 17:06:05 +00:00
Rafael Espindola
b98ac2a71e Add support for leb128 of absolute expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 16:45:15 +00:00
Chris Lattner
dfa3c9d982 add support for pushfd/popfd which are aliases for pushfl/popfl.
This fixes rdar://8408129 - pushfd and popfd get invalid instruction mnemonic errors


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 16:39:16 +00:00
Chris Lattner
ee211d0ed6 implement rdar://8407928 - support for in/out with a missing "a" register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113689 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 16:32:12 +00:00
Rafael Espindola
1264937212 Add missing single quotes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 15:45:48 +00:00
Rafael Espindola
228290c0d1 Change section_data dumping to print hex numbers instead of using
python's %r.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113685 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 15:25:58 +00:00
Owen Anderson
26c5663283 Invert and-of-or into or-of-and when doing so would allow us to clear bits of the and's mask.
This can result in increased opportunities for store narrowing in code generation.  Update a number of
tests for this change.  This fixes <rdar://problem/8285027>.

Additionally, because this inverts the order of ors and ands, some patterns for optimizing or-of-and-of-or
no longer fire in instances where they did originally.  Add a simple transform which recaptures most of these
opportunities: if we have an or-of-constant-or and have failed to fold away the inner or, commute the order 
of the two ors, to give the non-constant or a chance for simplification instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113679 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-11 05:48:06 +00:00
Benjamin Kramer
6844c8ea5a Teach InstructionSimplify to fold (A & B) & A -> A & B and (A | B) | A -> A | B.
Reassociate does this but it doesn't catch all cases (e.g. if the operands are i1).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113651 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 22:39:55 +00:00
Bill Wendling
de49f360ec Auto-upgrade the magic ".llvm.eh.catch.all.value" global to
"llvm.eh.catch.all.value". Only the name needs to be changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113600 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 18:51:56 +00:00
Evan Cheng
3dc0bb3afd Fix test so it passes on non-Darwin hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113577 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 06:20:01 +00:00
Bob Wilson
efe7d9a12f Fix merging base-updates for VLDM/VSTM: Before I switched these instructions
to use AddrMode4, there was a count of the registers stored in one of the
operands.  I changed that to just count the operands but forgot to adjust for
the size of D registers.  This was noticed by Evan as a performance problem
but it is a potential correctness bug as well, since it is possible that this
could merge a base update with a non-matching immediate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113576 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 05:15:04 +00:00
Evan Cheng
3ef1c8759a Teach if-converter to be more careful with predicating instructions that would
take multiple cycles to decode.
For the current if-converter clients (actually only ARM), the instructions that
are predicated on false are not nops. They would still take machine cycles to
decode. Micro-coded instructions such as LDM / STM can potentially take multiple
cycles to decode. If-converter should take treat them as non-micro-coded
simple instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10 01:29:16 +00:00
Daniel Dunbar
1ab6f2fa7a llvm-mc: Don't crash when using -n and we see a directive before the initial section.
- This is annoying, because we have to scatter this check everywhere that could emit real data, but I see no better solution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 22:42:59 +00:00
Daniel Dunbar
93bd4d1e6b llvm-mc: Make sure we exit != 0 if any errors are encountered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113551 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 22:42:56 +00:00
Jakob Stoklund Olesen
61ca48e0da XFAIL test under valgrind. It is not really our problem if sh is leaking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 22:02:13 +00:00
Owen Anderson
547462b98c Revert r113439, which relaxed the requirement that loops containing calls cannot be unrolled. After some discussion,
there seems to be a better way to achieve the same effect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 20:02:23 +00:00
Bruno Cardoso Lopes
ae4f7421c0 Add one more pattern to fallback movddup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113522 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 18:48:34 +00:00
Daniel Dunbar
874f021bc1 tests: XFAIL a handful of tests on the vg_leak builder, so we can get back to
green.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113491 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 15:50:19 +00:00
Benjamin Kramer
a754be42da Add an elf-dumper utility.
- Output format and some of the code stolen from macho-dump.
- Somewhat incomplete and probably buggy.
- Comes with a very basic test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113488 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 15:00:41 +00:00
Duncan Sands
7aed4ec957 Get rid of the last use of -m64 in FrontendC. This solution
of checking for either 4 or 8 is not very satisfactory, but
it would catch the original problem (an alignment of 1).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113485 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09 12:57:29 +00:00