1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

11095 Commits

Author SHA1 Message Date
Evan Cheng
1d50dccdc5 Enable code placement optimization pass for ARM.
llvm-svn: 114746
2010-09-24 19:07:23 +00:00
Rafael Espindola
909ffec6eb Revert 114678 and 114667 to see if
http://google1.osuosl.org:8011/builders/llvm-gcc-i386-linux-selfhost

gets happy.

llvm-svn: 114742
2010-09-24 18:48:08 +00:00
Daniel Dunbar
452f5345c5 MC/AsmParser: Handle a missed case of floating literals in the lexer.
llvm-svn: 114733
2010-09-24 17:10:26 +00:00
Michael J. Spencer
090c16fb92 CMake: Build unittests.
llvm-svn: 114725
2010-09-24 09:01:13 +00:00
Michael J. Spencer
7160458b8e Fix whitespace.
llvm-svn: 114724
2010-09-24 09:00:56 +00:00
Daniel Dunbar
702c4ef9d8 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.

llvm-svn: 114719
2010-09-24 01:59:56 +00:00
Bob Wilson
ff8139baa0 Set alignment operand for NEON VST instructions.
llvm-svn: 114709
2010-09-23 23:42:37 +00:00
Bob Wilson
026ef4b7f8 Set alignment operand for NEON VLD instructions.
llvm-svn: 114696
2010-09-23 21:43:54 +00:00
Rafael Espindola
4b0d25a0db Correctly handle weak undefined symbols. Before we would get a invalid binding
(2 == STB_WEAK | STB_GLOBAL).

llvm-svn: 114690
2010-09-23 19:55:14 +00:00
Rafael Espindola
ce04ba0f70 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.

llvm-svn: 114667
2010-09-23 17:25:18 +00:00
Bob Wilson
0fdee121f7 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.

llvm-svn: 114666
2010-09-23 17:25:06 +00:00
Evan Cheng
1493b1799e Disable codegen prepare critical edge splitting. Machine instruction passes now
break critical edges on demand.

llvm-svn: 114633
2010-09-23 06:55:34 +00:00
Dan Gohman
007957687e Fix llvm-extract -delete's lazy loading to materialize the functions that
will not be deleted, rather than the ones that will.

llvm-svn: 114614
2010-09-23 00:33:13 +00:00
Owen Anderson
7d6373ea9d 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>.

llvm-svn: 114599
2010-09-22 22:58:22 +00:00
Cameron Esfahani
662193bddc Fix PR8201: Update the code to call via X86::CALL64pcrel32 in the 64-bit case.
llvm-svn: 114597
2010-09-22 22:35:21 +00:00
Rafael Espindola
3cfff6e0c5 Avoid some Mach-O specific alignment being done on ELF.
llvm-svn: 114594
2010-09-22 22:27:05 +00:00
Rafael Espindola
a2d73f0a38 Correctly align bss.
llvm-svn: 114556
2010-09-22 17:43:04 +00:00
Mikhail Glushenkov
dba65f26d2 llvmc: Support '-emit-llvm -S' with -opt.
llvm-svn: 114541
2010-09-22 09:00:41 +00:00
Chris Lattner
f90b2a5a26 fix rdar://8456371 - Handle commutable instructions written backward.
llvm-svn: 114536
2010-09-22 06:26:39 +00:00
Chris Lattner
1864d6728d 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.

llvm-svn: 114534
2010-09-22 05:49:14 +00:00
Chris Lattner
1ff3935290 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.

llvm-svn: 114533
2010-09-22 05:29:50 +00:00
Chris Lattner
1c5e55f787 fix rdar://8456417 - llvm-mc can't do basic math
llvm-svn: 114532
2010-09-22 05:05:16 +00:00
Chris Lattner
77d657ae6a add the missing aliases for fp stack cmovs, rdar://8456391
llvm-svn: 114531
2010-09-22 04:56:20 +00:00
Chris Lattner
26d11d7501 reimplement elf TLS support in terms of addressing modes, eliminating SegmentBaseAddress.
llvm-svn: 114529
2010-09-22 04:39:11 +00:00
Chris Lattner
2e61516c5a Fix rdar://8456364 - llvm-mc rejects '%CS'
llvm-svn: 114528
2010-09-22 04:11:10 +00:00
Chris Lattner
2d350c46e2 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

llvm-svn: 114527
2010-09-22 04:04:03 +00:00
Chris Lattner
f43f09693e fix rdar://8456361 - llvm-mc rejects 'rep movsd'
llvm-svn: 114526
2010-09-22 03:50:32 +00:00
Chris Lattner
d42791ad4a linux has a different stack alignment than the mac, relax this a bit.
llvm-svn: 114519
2010-09-22 00:46:26 +00:00
Chris Lattner
e52da86fab give VZEXT_LOAD a memory operand, it now works with segment registers.
llvm-svn: 114515
2010-09-22 00:34:38 +00:00
Chris Lattner
706b9206da revert r114386 now that address modes work correctly, we get a nice
call through gs-relative memory now.

llvm-svn: 114510
2010-09-22 00:11:31 +00:00
Chris Lattner
f9861312cb give LCMPXCHG_DAG[8] a memory operand, allowing it to work with addrspace 256/257
llvm-svn: 114508
2010-09-21 23:59:42 +00:00
Chris Lattner
08b4ce2b31 filecheckize
llvm-svn: 114507
2010-09-21 23:57:27 +00:00
Evan Cheng
1d58965067 OptimizeCompareInstr should avoid iterating pass the beginning of the MBB when the 'and' instruction is after the comparison.
llvm-svn: 114506
2010-09-21 23:49:07 +00:00
Owen Anderson
d9fd152c3a 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.

llvm-svn: 114494
2010-09-21 22:51:46 +00:00
Devang Patel
53b709a85c Use FileCheck
llvm-svn: 114475
2010-09-21 20:50:32 +00:00
Owen Anderson
97a8fdc19c 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>.

llvm-svn: 114460
2010-09-21 18:41:19 +00:00
Mikhail Glushenkov
35e2ea68d2 llvmc: Allow multiple output languages.
llvm-svn: 114433
2010-09-21 14:59:42 +00:00
Chris Lattner
ecdba24738 fix rdar://8453210, a crash handling a call through a GS relative load.
For now, just disable folding the load into the call.

llvm-svn: 114386
2010-09-21 03:37:00 +00:00
Rafael Espindola
02af3cdd58 Implement support for .local and its "interesting" interactions with .comm.
llvm-svn: 114382
2010-09-21 00:24:38 +00:00
Evan Cheng
1ce02d180e 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

llvm-svn: 114372
2010-09-20 22:52:00 +00:00
Owen Anderson
b8811b9ed9 CombinerAA is now reordering these stores.
llvm-svn: 114354
2010-09-20 20:56:29 +00:00
Owen Anderson
fc94b337eb 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.

llvm-svn: 114348
2010-09-20 20:39:59 +00:00
Jim Grosbach
cf90f8beb1 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

llvm-svn: 114340
2010-09-20 19:32:20 +00:00
Rafael Espindola
78fc1f7f66 Produce a R_X86_64_32 when the value is >=0.
llvm-svn: 114339
2010-09-20 19:20:47 +00:00
NAKAMURA Takumi
a8d8b5f3c3 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.

llvm-svn: 114317
2010-09-19 21:58:55 +00:00
Eric Christopher
2901b19344 Add the exit instruction to the PTX target.
Patch by Che-Liang Chiou <clchiou@gmail.com>!

llvm-svn: 114294
2010-09-18 18:52:28 +00:00
Rafael Espindola
9c3a9bf8aa Make sure the STT_FILE symbol is the first one in the symbol table.
llvm-svn: 114285
2010-09-18 15:03:21 +00:00
Owen Anderson
015641f659 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".

llvm-svn: 114268
2010-09-18 04:45:14 +00:00
Rafael Espindola
32e423fe2b Add test that was missing in my previous commit.
llvm-svn: 114248
2010-09-18 00:37:27 +00:00
Dan Gohman
e96841854e Attempt to XFAIL this test on arm-linux, which is inexplicably failing.
llvm-svn: 114241
2010-09-18 00:04:37 +00:00
Benjamin Kramer
1cad9b6521 Fix vmov.f64 disassembly on targets where sizeof(long) != 8.
llvm-svn: 114240
2010-09-17 23:48:07 +00:00
Bob Wilson
670e1915c0 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.

llvm-svn: 114233
2010-09-17 22:59:05 +00:00
Jim Grosbach
8ae5cfffdd Teach the (non-MC) instruction printer to use the cannonical names for push/pop,
and shift instructions on ARM. Update the tests to match.

llvm-svn: 114230
2010-09-17 22:36:38 +00:00
Evan Cheng
8c2bde65f0 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.

llvm-svn: 114227
2010-09-17 22:28:18 +00:00
Jim Grosbach
d2cf0742a4 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.

llvm-svn: 114221
2010-09-17 21:58:46 +00:00
Jim Grosbach
b86aebe2b7 FileCheck-ize
llvm-svn: 114218
2010-09-17 21:46:16 +00:00
Jim Grosbach
b21c19d666 Move thumb2 tests to the thumb2 directory
llvm-svn: 114206
2010-09-17 20:34:09 +00:00
Jim Grosbach
026811c86f tweak test to check instructions rather than relying on the comment string
llvm-svn: 114204
2010-09-17 20:27:26 +00:00
Dan Gohman
4487f42592 Fix this test to avoid an "inexact" fold.
llvm-svn: 114202
2010-09-17 20:25:43 +00:00
Dan Gohman
aaed2c137f Avoid emitting a PIC base register if no PIC addresses are needed.
This fixes rdar://8396318.

llvm-svn: 114201
2010-09-17 20:24:24 +00:00
Jim Grosbach
fd21b4bb15 tweak test to check instructions rather than relying on the comment string
llvm-svn: 114200
2010-09-17 20:21:03 +00:00
Jim Grosbach
5ca55bd98b tweak test to check instructions rather than relying on the comment string
llvm-svn: 114199
2010-09-17 20:17:41 +00:00
Dan Gohman
0e6744d219 Fix this test so that folding doesn't depend on a potentially
"inexact" result.

llvm-svn: 114198
2010-09-17 20:15:53 +00:00
Chris Lattner
4bce01542c fix rdar://8444631 - encoder crash on 'enter'
What a weird instruction.

llvm-svn: 114190
2010-09-17 18:02:29 +00:00
Daniel Dunbar
ed92665b19 MC/Mach-O/i386: Fix a crash in relocation handling.
llvm-svn: 114176
2010-09-17 15:21:50 +00:00
Oscar Fuentes
402ac1bb1c tests/CMakeLists.txt: use configure_file' instead of sed'.
The Windows users will appreciate this.

llvm-svn: 114158
2010-09-17 03:22:21 +00:00
Daniel Dunbar
a43c86b354 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.

llvm-svn: 114154
2010-09-17 02:47:07 +00:00
Dan Gohman
9dc559bdef 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.

llvm-svn: 114148
2010-09-17 01:38:06 +00:00
Devang Patel
99777d1d07 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.
llvm-svn: 114119
2010-09-16 20:57:49 +00:00
Chris Lattner
73fc5e794d fix rdar://8438816 - unrecognized 'fildq' instruction
llvm-svn: 114116
2010-09-16 20:46:38 +00:00
Rafael Espindola
d542892fc0 Print the address of sections as 0 and create the metadata sections in the
same order as gnu as.

llvm-svn: 114109
2010-09-16 19:46:31 +00:00
Owen Anderson
37a6d67bd6 Add missing RUN line to this test.
llvm-svn: 114106
2010-09-16 18:46:23 +00:00
Dale Johannesen
cf9dc14249 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.

llvm-svn: 114104
2010-09-16 18:30:55 +00:00
Owen Anderson
6f3516065f 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.

llvm-svn: 114103
2010-09-16 18:28:33 +00:00
Owen Anderson
521e8dfef8 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.

llvm-svn: 114097
2010-09-16 17:42:36 +00:00
Rafael Espindola
fa964e153e Make sure that names like .note.GNU-stack are accepted as valid section names.
llvm-svn: 114091
2010-09-16 17:05:55 +00:00
Rafael Espindola
58aa9e8010 Add support for the .zero directive.
llvm-svn: 114077
2010-09-16 15:03:59 +00:00
Kalle Raiskila
68e2c15954 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.

llvm-svn: 114074
2010-09-16 12:29:33 +00:00
Jim Grosbach
75ae6f4ebb add a test of an edge case value for the FP immediate (needs all digits of
precision)

llvm-svn: 114028
2010-09-15 21:52:13 +00:00
Rafael Espindola
8a987c002e 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.

llvm-svn: 114027
2010-09-15 21:48:40 +00:00
Jim Grosbach
90aca3a6bf 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.

llvm-svn: 114021
2010-09-15 21:04:54 +00:00
Eli Friedman
b5aea103fc PR7959: Handle negative scales in GEPs correctly in BasicAA for non-64-bit
targets.

llvm-svn: 114015
2010-09-15 20:08:03 +00:00
Bob Wilson
e7e2f983e5 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.

llvm-svn: 113983
2010-09-15 17:12:08 +00:00
Gabor Greif
f7635897c8 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

llvm-svn: 113980
2010-09-15 16:53:07 +00:00
Mikhail Glushenkov
649b391de6 llvmc: make -x work with unknown suffixes.
llvm-svn: 113972
2010-09-15 15:20:41 +00:00
Chris Lattner
fff8e3495b lcall and ljmp always default to lcalll and ljmpl. This finally
wraps up r8418316

llvm-svn: 113949
2010-09-15 05:30:20 +00:00
Chris Lattner
726aae87ee apparently jmpl $1,$2 is an alias for ljmpl, similiarly
for call.  Add this.

llvm-svn: 113948
2010-09-15 05:25:21 +00:00
Chris Lattner
5b8a3129a5 Disambiguate lcall/ljmp to the 32-bit version. This happens
even in 64-bit mode apparently.

llvm-svn: 113945
2010-09-15 05:14:54 +00:00
Chris Lattner
e542e3e2ad 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

llvm-svn: 113938
2010-09-15 04:45:10 +00:00
Chris Lattner
c4a2e044f3 implement aliases for shld/shrd, part of rdar://8418316
llvm-svn: 113937
2010-09-15 04:37:18 +00:00
Chris Lattner
ad73a2623c fix rdar://8431880 - rcl/rcr with no shift amount not recognized
llvm-svn: 113936
2010-09-15 04:33:27 +00:00
Chris Lattner
c48bd41698 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

llvm-svn: 113932
2010-09-15 04:15:16 +00:00
Chris Lattner
b6167a8674 add some aliases for f[u]comi, part of rdar://8431422
llvm-svn: 113930
2010-09-15 04:08:38 +00:00
Chris Lattner
c9f1a5cd94 add a bunch of aliases for fp operations with no operand,
rdar://8431422

llvm-svn: 113929
2010-09-15 04:04:33 +00:00
Michael J. Spencer
aa187e9b54 test: Fix coff-dump section array indicies to 1 based to match file format.
llvm-svn: 113928
2010-09-15 03:58:51 +00:00
Michael J. Spencer
02665c9d92 Tabs to spaces
llvm-svn: 113927
2010-09-15 03:58:39 +00:00
Michael J. Spencer
ef888b5023 Cleanup coff-dump.py
llvm-svn: 113926
2010-09-15 03:58:24 +00:00
Chris Lattner
8729e47b8f fix PR8144, a bug where constant merge would merge globals marked
attribute(used).

llvm-svn: 113911
2010-09-15 00:30:11 +00:00
Jim Grosbach
901a646188 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.

llvm-svn: 113903
2010-09-14 23:54:06 +00:00
Chris Lattner
cd4eadce11 add a terrible hack to allow out with dx is parens, a gas bug.
This fixes PR8114

llvm-svn: 113894
2010-09-14 23:34:29 +00:00
Owen Anderson
788b93febd Remove dead option from tests.
llvm-svn: 113855
2010-09-14 21:03:40 +00:00
Gabor Greif
a37b447ba6 forgot the testcase change for r113839
llvm-svn: 113840
2010-09-14 09:30:17 +00:00
Gabor Greif
40a8053a15 test for and-tst peephole optimization
documents the status-quo with its opportunities

llvm-svn: 113838
2010-09-14 08:50:43 +00:00
Chris Lattner
0718ff9be2 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.

llvm-svn: 113820
2010-09-14 00:19:00 +00:00
Dale Johannesen
e788b5e436 Basic smoke test for new x86mmx type.
llvm-svn: 113783
2010-09-13 21:01:36 +00:00
Owen Anderson
e305c119b9 Add a reduced testcase for the infinite loop fixed in r113763.
llvm-svn: 113770
2010-09-13 18:28:40 +00:00
Owen Anderson
9c34a7831d 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.

llvm-svn: 113763
2010-09-13 17:59:27 +00:00
Duncan Sands
e08df07d11 Spelling fixes in comments.
llvm-svn: 113746
2010-09-13 13:32:22 +00:00
Eric Christopher
d4aaabfa74 Revert 113679, it was causing an infinite loop in a testcase that I've sent
on to Owen.

llvm-svn: 113720
2010-09-12 06:09:23 +00:00
Chris Lattner
46844daf49 add a missed cmov alias, part of rdar://8416805
llvm-svn: 113693
2010-09-11 17:08:22 +00:00
Chris Lattner
57c170e15b add support for all the setCC aliases. Part of rdar://8416805
llvm-svn: 113692
2010-09-11 17:06:05 +00:00
Rafael Espindola
ce9b27497e Add support for leb128 of absolute expressions.
llvm-svn: 113691
2010-09-11 16:45:15 +00:00
Chris Lattner
7cb9d276e0 add support for pushfd/popfd which are aliases for pushfl/popfl.
This fixes rdar://8408129 - pushfd and popfd get invalid instruction mnemonic errors

llvm-svn: 113690
2010-09-11 16:39:16 +00:00
Chris Lattner
1fd69dd039 implement rdar://8407928 - support for in/out with a missing "a" register.
llvm-svn: 113689
2010-09-11 16:32:12 +00:00
Rafael Espindola
96fc40312b Add missing single quotes.
llvm-svn: 113687
2010-09-11 15:45:48 +00:00
Rafael Espindola
f926b1b27d Change section_data dumping to print hex numbers instead of using
python's %r.

llvm-svn: 113685
2010-09-11 15:25:58 +00:00
Owen Anderson
d4ebde12ce 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.

llvm-svn: 113679
2010-09-11 05:48:06 +00:00
Benjamin Kramer
6110efbf8c 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).

llvm-svn: 113651
2010-09-10 22:39:55 +00:00
Bill Wendling
f6ee5c5231 Auto-upgrade the magic ".llvm.eh.catch.all.value" global to
"llvm.eh.catch.all.value". Only the name needs to be changed.

llvm-svn: 113600
2010-09-10 18:51:56 +00:00
Evan Cheng
e2425602c5 Fix test so it passes on non-Darwin hosts.
llvm-svn: 113577
2010-09-10 06:20:01 +00:00
Bob Wilson
01b7bf3510 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.

llvm-svn: 113576
2010-09-10 05:15:04 +00:00
Evan Cheng
c9cb37516d 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.

llvm-svn: 113570
2010-09-10 01:29:16 +00:00
Daniel Dunbar
547563df12 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.

llvm-svn: 113552
2010-09-09 22:42:59 +00:00
Daniel Dunbar
07c0ca2a51 llvm-mc: Make sure we exit != 0 if any errors are encountered.
llvm-svn: 113551
2010-09-09 22:42:56 +00:00
Jakob Stoklund Olesen
79f7387096 XFAIL test under valgrind. It is not really our problem if sh is leaking.
llvm-svn: 113550
2010-09-09 22:02:13 +00:00
Owen Anderson
db6a08beef 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.

llvm-svn: 113528
2010-09-09 20:02:23 +00:00
Bruno Cardoso Lopes
49efee5c95 Add one more pattern to fallback movddup
llvm-svn: 113522
2010-09-09 18:48:34 +00:00
Daniel Dunbar
90172ab0b5 tests: XFAIL a handful of tests on the vg_leak builder, so we can get back to
green.

llvm-svn: 113491
2010-09-09 15:50:19 +00:00
Benjamin Kramer
8849104392 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.

llvm-svn: 113488
2010-09-09 15:00:41 +00:00
Duncan Sands
4a66e8e24d 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).

llvm-svn: 113485
2010-09-09 12:57:29 +00:00
Duncan Sands
3030644248 Another test that uses -m64. Here too it looks like it can be
removed.  Not that the XTARGET wasn't doing anything since it
does nothing without an accompanying XFAIL.

llvm-svn: 113484
2010-09-09 12:48:04 +00:00
Duncan Sands
e89d619d23 On i386, llvm-gcc cannot be assumed to support -m64. Since these
tests pass here (i686-linux and x86-64-linux) without -m64, simply
remove the -m64.

llvm-svn: 113483
2010-09-09 12:43:44 +00:00
Bob Wilson
524123343c Fix NEON VLD pseudo instruction itineraries that were incorrectly copied from
the VST pseudos.  The VLD/VST scheduling still needs work (see pr6722), but
at least we shouldn't confuse the loads with the stores.

llvm-svn: 113473
2010-09-09 05:40:26 +00:00
Owen Anderson
956afdd1f2 Relax the "don't unroll loops containing calls" rule. Instead, when a loop contains a call, lower the
unrolling threshold to the optimize-for-size threshold.  Basically, for loops containing calls, unrolling
can still be profitable as long as the loop is REALLY small.

llvm-svn: 113439
2010-09-08 23:10:07 +00:00
Chris Lattner
43c86a062c fix rdar://8407548, I missed the commuted form of xchg/test without a suffix.
llvm-svn: 113427
2010-09-08 22:27:05 +00:00
Owen Anderson
c51d7d1a8d Generalize instcombine's support for combining multiple bit checks into a single test. Patch by Dirk Steinke!
llvm-svn: 113423
2010-09-08 22:16:17 +00:00
Chris Lattner
5234733554 fix bugs in push/pop segment support, rdar://8407242
llvm-svn: 113422
2010-09-08 22:13:08 +00:00
Jim Grosbach
0f01a7319e Re-enable usage of the ARM base pointer. r113394 fixed the known failures.
Re-running some nightly testers w/ it enabled to verify.

llvm-svn: 113399
2010-09-08 20:12:02 +00:00
Eric Christopher
95fe7f6d38 Remove ssp from this test.
llvm-svn: 113392
2010-09-08 19:32:34 +00:00
Kalle Raiskila
be22226628 Fix CellSPU vector shuffles, again.
Some cases of lowering to rotate were miscompiled.

llvm-svn: 113355
2010-09-08 11:53:38 +00:00
Chris Lattner
4e8c89174f add support for the commuted form of the test instruction, rdar://8018260.
llvm-svn: 113352
2010-09-08 05:51:12 +00:00
Chris Lattner
752daa9624 implement proper support for sysret{,l,q}, rdar://8403907
llvm-svn: 113350
2010-09-08 05:45:34 +00:00
Chris Lattner
40f9f0fdba implement the iret suite of instructions properly,
fixing rdar://8403974

llvm-svn: 113349
2010-09-08 05:38:31 +00:00
Chris Lattner
05818145f8 add support for instruction prefixes on the same line as the instruction,
implementing rdar://8033482 and PR7254.

llvm-svn: 113348
2010-09-08 05:17:37 +00:00
Chris Lattner
7435beb421 gas accepts xchg <mem>, <reg> as a synonym for xchg <reg>, <mem>.
Add this to the mc assembler, fixing PR8061

llvm-svn: 113346
2010-09-08 04:53:27 +00:00
Chris Lattner
8f621d5039 fix the encoding of the "jump on *cx" family of instructions,
rdar://8061602

llvm-svn: 113343
2010-09-08 04:30:51 +00:00
Jim Grosbach
7a957dc761 disable for the moment while tracking down a few Thumb2-O0 failure that look
related. (attempt deux, complete w/ test update this time)

llvm-svn: 113333
2010-09-08 02:00:34 +00:00
Devang Patel
acddbab1a5 remove these tests for now.
llvm-svn: 113293
2010-09-07 22:03:44 +00:00
Devang Patel
751d5ec40a There is no need to force target if the test is going to run on other x86 platforms.
llvm-svn: 113285
2010-09-07 20:59:09 +00:00
Stuart Hastings
92dd0fd9ba Typo. Thanks to BillW for pointing it out!
llvm-svn: 113281
2010-09-07 20:39:07 +00:00
Chris Lattner
a58a97dafc Fix a serious performance regression introduced by r108687 on linux:
turning (fptrunc (sqrt (fpext x))) -> (sqrtf x)  is great, but we have
to delete the original sqrt as well.  Not doing so causes us to do 
two sqrt's when building with -fmath-errno (the default on linux).

llvm-svn: 113260
2010-09-07 20:01:38 +00:00
Chris Lattner
f2534b401f rename test.
llvm-svn: 113257
2010-09-07 19:57:06 +00:00
Stuart Hastings
f0d248515f Test case for r113248. Raar 8361341.
llvm-svn: 113249
2010-09-07 18:43:57 +00:00
Devang Patel
e9dcee0a69 Fix command line used to link these test cases.
llvm-svn: 113237
2010-09-07 18:17:56 +00:00
Devang Patel
ca974014e7 Reintroduce dbg-declare tests.
llvm-svn: 113232
2010-09-07 18:01:49 +00:00
Devang Patel
c1cdbbb6d5 Remove last three tests. I need to make them independent of my setup.
llvm-svn: 113213
2010-09-07 17:08:57 +00:00
Devang Patel
cb223026e6 Add a test case to check handling of dbg-declare during hybrid mode where we begin using fast-isel but switch back to DAG building at some point.
llvm-svn: 113210
2010-09-07 17:03:44 +00:00
Devang Patel
5b5dd1d32b Add a test case to check handling of dbg-declare by selection DAG builder.
llvm-svn: 113209
2010-09-07 16:56:35 +00:00
Devang Patel
bcdf6f20ac Add a test case to check handling of dbg-declare by fast-isel.
llvm-svn: 113208
2010-09-07 16:40:53 +00:00
Chris Lattner
fd65cfd3eb add missing cmov aliases, this resolves rdar://8208499
llvm-svn: 113189
2010-09-07 00:05:45 +00:00
Chris Lattner
5a696fb3ca "sldt <mem>" is ambiguous in 64-bit mode, but should
always be disambiguated as sldtw.  sldtw and sldtq with
a mem operands have the same effect, but sldtw is more
compact.  Force it to sldtw, resolving rdar://8017530

llvm-svn: 113186
2010-09-06 23:51:44 +00:00
Chris Lattner
3377802111 fix rdar://8017621 - llvm-mc can't guess encoding for "push $(1000)"
llvm-svn: 113184
2010-09-06 23:40:56 +00:00
Chris Lattner
6ecbbff857 fix the operand constraints of the immediate form of in/out,
allowing unsigned 8-bit operands.  This fixes rdar://8208481

llvm-svn: 113182
2010-09-06 23:29:05 +00:00
Chris Lattner
6e6a535055 fix PR8067, an over-aggressive assertion in LICM.
llvm-svn: 113146
2010-09-06 05:11:24 +00:00
Chris Lattner
4100881939 Teach loop rotate to hoist trivially invariant instructions
in the duplicated block instead of duplicating them.  

Duplicating them into the end of the loop and the preheader 
means that we got a phi node in the header of the loop, 
which prevented LICM from hoisting them.  GVN would
usually come around later and merge the duplicated 
instructions so we'd get reasonable output... except that
anything dependent on the shoulda-been-hoisted value can't
be hoisted.  In PR5319 (which this fixes), a memory value
didn't get promoted.

llvm-svn: 113134
2010-09-06 01:10:22 +00:00
Chris Lattner
4dccd368f3 fix PR8063, a crash in globalopt in the malloc analysis code.
llvm-svn: 113109
2010-09-05 17:20:46 +00:00
Chris Lattner
684ae57b8e implement rdar://6653118 - fastisel should fold loads where possible.
Since mem2reg isn't run at -O0, we get a ton of reloads from the stack,
for example, before, this code:

int foo(int x, int y, int z) {
  return x+y+z;
}

used to compile into:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	movl	4(%rsp), %esi
	addl	%edx, %esi
	movl	(%rsp), %edx
	addl	%esi, %edx
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Now we produce:

_foo:                                   ## @foo
	subq	$12, %rsp
	movl	%edi, 8(%rsp)
	movl	%esi, 4(%rsp)
	movl	%edx, (%rsp)
	movl	8(%rsp), %edx
	addl	4(%rsp), %edx    ## Folded load
	addl	(%rsp), %edx     ## Folded load
	movl	%edx, %eax
	addq	$12, %rsp
	ret

Fewer instructions and less register use = faster compiles.

llvm-svn: 113102
2010-09-05 02:18:34 +00:00
Dan Gohman
e1ad0ebbcc Fix LoopSimplify to notify ScalarEvolution when splitting a loop backedge
into an inner loop, as the new loop iteration may differ substantially.
This fixes PR8078.

llvm-svn: 113057
2010-09-04 02:42:48 +00:00
Chris Lattner
2b77a2a167 fix a bug in my licm rewrite when a load from the promoted memory
location is being re-stored to the memory location.  We would get
a dangling pointer from the SSAUpdate data structure and miss a 
use.  This fixes PR8068

llvm-svn: 113042
2010-09-04 00:12:30 +00:00
Owen Anderson
94d98b12c8 Propagate non-local comparisons. Fixes PR1757.
llvm-svn: 113025
2010-09-03 22:47:08 +00:00
Dale Johannesen
2f4f8f5705 Remove the rest of the nonexistent 64-bit AVX instructions.
Bruno, please review.

llvm-svn: 113014
2010-09-03 21:23:00 +00:00
David Greene
903408c475 Generalize getFieldType to work on all TypedInits. Add a couple of testcases from
Amaury Pouly.

llvm-svn: 113010
2010-09-03 21:00:49 +00:00
Owen Anderson
9161c79ffe Add support for simplifying a load from a computed value to a load from a global when it
is provable that they're equivalent.  This fixes PR4855.

llvm-svn: 112994
2010-09-03 19:08:37 +00:00
Jim Grosbach
c50df6cfad Re-apply r112883:
"For ARM stack frames that utilize variable sized objects and have either
large local stack areas or require dynamic stack realignment, allocate a
base register via which to access the local frame. This allows efficient
access to frame indices not accessible via the FP (either due to being out
of range or due to dynamic realignment) or the SP (due to variable sized
object allocation). In particular, this greatly improves efficiency of access
to spill slots in Thumb functions which contain VLAs."

r112986 fixed a latent bug exposed by the above.

llvm-svn: 112989
2010-09-03 18:37:12 +00:00
Owen Anderson
f700be9fb2 Add a test for PR4413, which was apparently fixed at some point in the past.
llvm-svn: 112987
2010-09-03 18:33:08 +00:00
Owen Anderson
91cc1ae13c Add PR number to test.
llvm-svn: 112971
2010-09-03 16:58:25 +00:00
Daniel Dunbar
3fa5ea53fa Revert "For ARM stack frames that utilize variable sized objects and have either", it is breaking oggenc with Clang for ARMv6.
This reverts commit 8d6e29cfda270be483abf638850311670829ee65.

llvm-svn: 112962
2010-09-03 15:26:42 +00:00
NAKAMURA Takumi
736651f79b test/CodeGen/X86: Add explicit -mtriple=(i686|x86_64)-linux for Win32 host.
llvm-svn: 112947
2010-09-03 03:24:08 +00:00
Bruno Cardoso Lopes
f91bd70e9a AVX doesn't support mm operations neither its instrinsics.
The AVX versions of PALIGN and PABS* should only exist for
128-bit. Remove the unnecessary stuff.

llvm-svn: 112944
2010-09-03 02:08:45 +00:00
Bob Wilson
24fa0b33b1 Replace NEON vabdl, vaba, and vabal intrinsics with combinations of the
vabd intrinsic and add and/or zext operations.  In the case of vaba, this
also avoids the need for a DAG combine pattern to combine vabd with add.
Update tests.  Auto-upgrade the old intrinsics.

llvm-svn: 112941
2010-09-03 01:35:08 +00:00
Chris Lattner
4062754b22 update one more test
llvm-svn: 112910
2010-09-02 23:32:55 +00:00
Chris Lattner
ee42f75f8b add a new "llvm-dis -show-annotations" option, which causes it to print
#uses comments, with a testcase.

llvm-svn: 112906
2010-09-02 23:21:44 +00:00
Anton Korobeynikov
32cecc0ecc Properly emit __chkstk call instead of __alloca on non-mingw windows targets.
Patch by Cameron Esfahani!

llvm-svn: 112902
2010-09-02 23:03:46 +00:00
Chris Lattner
a1691fc6cb more test cleanup
llvm-svn: 112892
2010-09-02 22:38:56 +00:00
Chris Lattner
238f46d92e remove some noise from tests.
llvm-svn: 112889
2010-09-02 22:35:33 +00:00
Chris Lattner
2fe6cd2026 we are past the point where these tests are useful.
llvm-svn: 112887
2010-09-02 22:32:02 +00:00
Jim Grosbach
fb89154d21 For ARM stack frames that utilize variable sized objects and have either
large local stack areas or require dynamic stack realignment, allocate a
base register via which to access the local frame. This allows efficient
access to frame indices not accessible via the FP (either due to being out
of range or due to dynamic realignment) or the SP (due to variable sized
object allocation). In particular, this greatly improves efficiency of access
to spill slots in Thumb functions which contain VLAs.

rdar://7352504
rdar://8374540
rdar://8355680

llvm-svn: 112883
2010-09-02 22:29:01 +00:00
Chris Lattner
1edeb00c72 fix more AST updating bugs, correcting miscompilation in PR8041
llvm-svn: 112878
2010-09-02 22:19:10 +00:00
Dan Gohman
6824bfc554 Don't narrow the load and store in a load+twiddle+store sequence unless
there are clearly no stores between the load and the store. This fixes
this miscompile reported as PR7833.

This breaks the test/CodeGen/X86/narrow_op-2.ll optimization, which is
safe, but awkward to prove safe. Move it to X86's README.txt.

llvm-svn: 112861
2010-09-02 21:18:42 +00:00
Sandeep Patel
1c6b7d8a96 Fix an unnecessary XFAIL
llvm-svn: 112853
2010-09-02 20:19:24 +00:00
Owen Anderson
86201cfdd9 Fix typo. I accidentally edited the wrong file before my last commit.
llvm-svn: 112851
2010-09-02 19:52:06 +00:00
Benjamin Kramer
dd16ed1618 Add AsmParser support for the ELF .previous directive. Patch by Roman Divacky.
llvm-svn: 112849
2010-09-02 18:53:37 +00:00
Owen Anderson
3206920eb2 Fix a bug in LazyValueInfo that CorrelatedValuePropagation exposed: In the LVI lattice, undef and the full set ConstantRange should not
be treated as equivalent.

llvm-svn: 112843
2010-09-02 18:23:58 +00:00
Jim Grosbach
8f30718112 Now that register allocation properly considers reserved regs, simplify the
ARM register class allocation order functions to take advantage of that.

llvm-svn: 112841
2010-09-02 18:14:29 +00:00
Bob Wilson
8951c7592c Convert VLD1 and VLD2 instructions to use pseudo-instructions until
after regalloc.

llvm-svn: 112825
2010-09-02 16:00:54 +00:00
Duncan Sands
6b382d04f4 Print the number of uses of a function in the .ll since it can be informative
and there seems to be no reason not to.

llvm-svn: 112812
2010-09-02 08:52:23 +00:00
NAKAMURA Takumi
f5566eebf8 test/loop-strength-reduce4: Add explicit triplet for Win32 host.
llvm-svn: 112802
2010-09-02 03:45:58 +00:00
NAKAMURA Takumi
8e620796b6 test/twoaddr-coalesce: Do not use @main.
Win32 codegen emits implicit invoking __main into, to fail.

llvm-svn: 112801
2010-09-02 03:45:51 +00:00
Bob Wilson
3348d2eb50 Remove NEON vmull, vmlal, and vmlsl intrinsics, replacing them with multiply,
add, and subtract operations with zero-extended or sign-extended vectors.
Update tests.  Add auto-upgrade support for the old intrinsics.

llvm-svn: 112773
2010-09-01 23:50:19 +00:00
Chris Lattner
b1c861e28c deepen my MMX/SRoA hack to avoid hurting non-x86 codegen.
llvm-svn: 112763
2010-09-01 23:09:27 +00:00
Bruno Cardoso Lopes
601bf4c6d3 Using target specific nodes for shuffle nodes makes the mask
check more strict, breaking some cases not checked in the
testsuite, but also exposes some foldings not done before,
as this example:

  movaps  (%rdi), %xmm0
  movaps  (%rax), %xmm1
  movaps  %xmm0, %xmm2
  movss %xmm1, %xmm2
  shufps  $36, %xmm2, %xmm0

now is generated as:

  movaps  (%rdi), %xmm0
  movaps  %xmm0, %xmm1
  movlps  (%rax), %xmm1
  shufps  $36, %xmm1, %xmm0

llvm-svn: 112753
2010-09-01 22:33:20 +00:00
Jakob Stoklund Olesen
fe11c81560 Teach RemoveCopyByCommutingDef to check all aliases, not just subregisters.
This caused a miscompilation in WebKit where %RAX had conflicting defs when
RemoveCopyByCommutingDef was commuting a %EAX use.

llvm-svn: 112751
2010-09-01 22:15:35 +00:00
Dale Johannesen
8ac2805d6f Apparently only Darwin passes long double misaligned. Compensate.
llvm-svn: 112748
2010-09-01 21:57:20 +00:00
Dan Gohman
d0dc80485c Fix loop unswitching's assumption that a code path which either
infinite loops or exits will eventually exit. This fixes PR5373.

llvm-svn: 112745
2010-09-01 21:46:45 +00:00
Bill Wendling
988287ae88 The output of opt -stats must be sent to stderr. Patch by NAKAMURA Takumi!
llvm-svn: 112724
2010-09-01 18:32:56 +00:00
Chris Lattner
b74759a9fa temporarily revert r112664, it is causing a decoding conflict, and
the testcases should be merged.

llvm-svn: 112711
2010-09-01 16:00:50 +00:00
Michael J. Spencer
e2f3acedf8 COFF: Update tests to reflect changes in last commit.
llvm-svn: 112704
2010-09-01 14:15:31 +00:00
Dale Johannesen
43b0adff96 Attempt to fix buildbot.
llvm-svn: 112697
2010-09-01 05:19:06 +00:00
Chris Lattner
9759e898f0 add a gross hack to work around a problem that Argiris reported
on llvmdev: SRoA is introducing MMX datatypes like <1 x i64>,
which then cause random problems because the X86 backend is
producing mmx stuff without inserting proper emms calls.

In the short term, force off MMX datatypes.  In the long term,
the X86 backend should not select generic vector types to MMX
registers.  This is being worked on, but won't be done in time
for 2.8.  rdar://8380055

llvm-svn: 112696
2010-09-01 05:14:33 +00:00
Chris Lattner
c7ae149253 filecheckize
llvm-svn: 112695
2010-09-01 05:10:14 +00:00
Dan Gohman
ad593f9d93 Revert 112442 and 112440 until the compile time problems introduced
by 112440 are resolved.

llvm-svn: 112692
2010-09-01 01:45:53 +00:00
Dale Johannesen
a36b4eee9f Testcase for llvm checkin 112674.
llvm-svn: 112675
2010-08-31 23:43:55 +00:00
Chris Lattner
5ed5e29575 licm is wasting time hoisting constant foldable operations,
instead of hoisting them, just fold them away.  This occurs in the
testcase for PR8041, for example.

llvm-svn: 112669
2010-08-31 23:00:16 +00:00
Bill Wendling
bb6052cfd6 We have a chance for an optimization. Consider this code:
int x(int t) {
  if (t & 256)
    return -26;
  return 0;
}

We generate this:

     tst.w   r0, #256
     mvn     r0, #25
     it      eq
     moveq   r0, #0

while gcc generates this:

     ands    r0, r0, #256
     it      ne
     mvnne   r0, #25
     bx      lr

Scandalous really!

During ISel time, we can look for this particular pattern. One where we have a
"MOVCC" that uses the flag off of a CMPZ that itself is comparing an AND
instruction to 0. Something like this (greatly simplified):

  %r0 = ISD::AND ...
  ARMISD::CMPZ %r0, 0         @ sets [CPSR]
  %r0 = ARMISD::MOVCC 0, -26  @ reads [CPSR]

All we have to do is convert the "ISD::AND" into an "ARM::ANDS" that sets [CPSR]
when it's zero. The zero value will all ready be in the %r0 register and we only
need to change it if the AND wasn't zero. Easy!

llvm-svn: 112664
2010-08-31 22:41:22 +00:00
Devang Patel
46570e6783 Reapply r112623. Included additional check for unused byval argument.
llvm-svn: 112659
2010-08-31 22:22:42 +00:00
Owen Anderson
c9c199c531 Merge 2010-08-31-InfiniteRecursion.ll into crash.ll.
llvm-svn: 112635
2010-08-31 20:27:17 +00:00
Devang Patel
b94251aea0 Revert r112623. It is causing self host build failures.
llvm-svn: 112631
2010-08-31 19:41:03 +00:00
Devang Patel
414cbc940a Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.

llvm-svn: 112623
2010-08-31 18:50:09 +00:00
Owen Anderson
3ab91d56b4 Add a test for the duplicated-conditional situation illutrated by PR5652.
llvm-svn: 112621
2010-08-31 18:49:12 +00:00
Chris Lattner
98902c15fa merge two tests.
llvm-svn: 112617
2010-08-31 18:44:03 +00:00
Owen Anderson
43ac4da8d1 Manually reduce this testcase.
llvm-svn: 112615
2010-08-31 18:16:29 +00:00
Chris Lattner
8535204036 merge two tests and convert to filecheck.
llvm-svn: 112613
2010-08-31 18:05:08 +00:00
Owen Anderson
e4af4b10f1 Add a micro-test for the transforms I added to JumpThreading.
I have not been able to find a way to test each in isolation, for a few reasons:
1) The ability to look-through non-i1 BinaryOperator's requires the ability to look through non-constant
   ICmps in order for it to ever trigger.
2) The ability to do LVI-powered PHI value determination only matters in cases that ProcessBranchOnPHI
   can't handle.  Since it already handles all the cases without other instructions in the def-use chain
   between the PHI and the branch, it requires the ability to look through ICmps and/or BinaryOperators
   as well.

llvm-svn: 112611
2010-08-31 17:59:07 +00:00
Jim Grosbach
0a357d79c7 Update test for 112609
llvm-svn: 112610
2010-08-31 17:58:47 +00:00
Owen Anderson
e930c65b2c Rename test directory to reflect new pass name.
llvm-svn: 112592
2010-08-31 07:50:31 +00:00
Owen Anderson
ccaee65189 Rename ValuePropagation to a more descriptive CorrelatedValuePropagation.
llvm-svn: 112591
2010-08-31 07:48:34 +00:00
Owen Anderson
ba28fe3dcb More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly constant-fold undef, and be more careful with its return value.
This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's
handling of and/or of i1's), but never manifested before.  This patch adds a tracking set to prevent this case.

llvm-svn: 112589
2010-08-31 07:36:34 +00:00
Owen Anderson
bd9edea8a3 Remove r111665, which implemented store-narrowing in InstCombine. Chris discovered a miscompilation in it, and it's not easily
fixable at the optimizer level. I'll investigate reimplementing it in DAGCombine.

llvm-svn: 112575
2010-08-31 04:41:06 +00:00
Anton Korobeynikov
c3f039784a Fix borken test
llvm-svn: 112555
2010-08-30 23:41:49 +00:00
Owen Anderson
18110f0db4 Combine these two tests, and make sure there's a newline at the end of the file.
llvm-svn: 112554
2010-08-30 23:37:41 +00:00
Bob Wilson
826a677f94 Remove NEON vmovn intrinsic, replacing it with vector truncate operations.
Auto-upgrade the old intrinsic and update tests.

llvm-svn: 112507
2010-08-30 20:02:30 +00:00
Chris Lattner
765e59210c two changes:
1) nuke ConstDataCoalSection, which is dead.
2) revise my previous patch for rdar://8018335,
  which was completely wrong.  Specifically, it doesn't 
  make sense to mark __TEXT,__const_coal as PURE_INSTRUCTIONS,
  because it is for readonly data.  templates (it turns out)
  go to const_coal_nt.  The real fix for rdar://8018335 was
  to give ConstTextCoalSection a section kind of ReadOnly 
  instead of Text.

llvm-svn: 112496
2010-08-30 18:12:35 +00:00
Michael J. Spencer
51a65365f3 Partially revert r112480. Caused test failures.
llvm-svn: 112486
2010-08-30 15:34:08 +00:00
NAKAMURA Takumi
89dab50acd coff-dump.py: Fix PR7996. Now it is compatible to Python-2.4.
llvm-svn: 112485
2010-08-30 15:19:56 +00:00
Michael J. Spencer
2f463fc492 Fix constant-over-index.ll test on windows.
llvm-svn: 112483
2010-08-30 15:08:02 +00:00
Michael J. Spencer
cd662e3540 Test: Fix LLVMC tests on CMake.
The CMake build didn't define TEST_COMPILE_CXX_CMD. The tests assumed gcc.

llvm-svn: 112480
2010-08-30 14:49:00 +00:00
Duncan Sands
254f8ff0a6 Correct bogus module triple specifications.
llvm-svn: 112469
2010-08-30 10:48:29 +00:00
Chris Lattner
51639dea34 LICM does get dead instructions input to it. Instead of sinking them
out of loops, just delete them.

llvm-svn: 112451
2010-08-29 18:22:25 +00:00
Dan Gohman
9ea315c5ca Make IVUsers iterative instead of recursive.
This has the side effect of reversing the order of most of
IVUser's results.

llvm-svn: 112442
2010-08-29 16:40:03 +00:00
Dan Gohman
0fdab32e0f Make this test less dependent on register allocation choices.
llvm-svn: 112426
2010-08-29 14:49:42 +00:00
Dan Gohman
68929091e5 Use exec.
llvm-svn: 112425
2010-08-29 14:49:00 +00:00
Kalle Raiskila
daba4ffc75 Fix lowering of INSERT_VECTOR_ELT in SPU.
The IDX was treated as byte index, not element index.

llvm-svn: 112422
2010-08-29 12:41:50 +00:00
Bob Wilson
807d004452 Remove NEON vaddl, vaddw, vsubl, and vsubw intrinsics. Instead, use llvm
IR add/sub operations with one or both operands sign- or zero-extended.
Auto-upgrade the old intrinsics.

llvm-svn: 112416
2010-08-29 05:57:34 +00:00
Chris Lattner
5f911e6fe9 merge a bunch of shuffle tests into sse2.ll
llvm-svn: 112398
2010-08-29 03:19:04 +00:00
Chris Lattner
c2ef3180a8 add some nounwind's
llvm-svn: 112396
2010-08-29 03:07:47 +00:00
Chris Lattner
b6eee35ca6 fixme accomplished
llvm-svn: 112386
2010-08-28 20:40:28 +00:00
Chris Lattner
8cb4abbc0e fix the buildvector->insertp[sd] logic to not always create a redundant
insertp[sd] $0, which is a noop.  Before:

_f32:                                   ## @f32
	pshufd	$1, %xmm1, %xmm2
	pshufd	$1, %xmm0, %xmm3
	addss	%xmm2, %xmm3
	addss	%xmm1, %xmm0
                                        ## kill: XMM0<def> XMM0<kill> XMM0<def>
	insertps	$0, %xmm0, %xmm0
	insertps	$16, %xmm3, %xmm0
	ret

after:

_f32:                                   ## @f32
	movdqa	%xmm0, %xmm2
	addss	%xmm1, %xmm2
	pshufd	$1, %xmm1, %xmm1
	pshufd	$1, %xmm0, %xmm3
	addss	%xmm1, %xmm3
	movdqa	%xmm2, %xmm0
	insertps	$16, %xmm3, %xmm0
	ret

The extra movs are due to a random (poor) scheduling decision.

llvm-svn: 112379
2010-08-28 17:59:08 +00:00
Chris Lattner
c3b630d64b fix the BuildVector -> unpcklps logic to not do pointless shuffles
when the top elements of a vector are undefined.  This happens all
the time for X86-64 ABI stuff because only the low 2 elements of
a 4 element vector are defined.  For example, on:

_Complex float f32(_Complex float A, _Complex float B) {
  return A+B;
}

We used to produce (with SSE2, SSE4.1+ uses insertps):

_f32:                                   ## @f32
	movdqa	%xmm0, %xmm2
	addss	%xmm1, %xmm2
	pshufd	$16, %xmm2, %xmm2
	pshufd	$1, %xmm1, %xmm1
	pshufd	$1, %xmm0, %xmm0
	addss	%xmm1, %xmm0
	pshufd	$16, %xmm0, %xmm1
	movdqa	%xmm2, %xmm0
	unpcklps	%xmm1, %xmm0
	ret

We now produce:

_f32:                                   ## @f32
	movdqa	%xmm0, %xmm2
	addss	%xmm1, %xmm2
	pshufd	$1, %xmm1, %xmm1
	pshufd	$1, %xmm0, %xmm3
	addss	%xmm1, %xmm3
	movaps	%xmm2, %xmm0
	unpcklps	%xmm3, %xmm0
	ret

This implements rdar://8368414

llvm-svn: 112378
2010-08-28 17:28:30 +00:00
Benjamin Kramer
92e13eeec0 Update ocaml test.
llvm-svn: 112364
2010-08-28 10:29:41 +00:00
Chris Lattner
ecf276b787 remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.

llvm-svn: 112356
2010-08-28 04:09:24 +00:00