Chris Lattner
9c58de2dc4
fix rdar://8490728 - llvm-mc rejects gpr64 form of 'movmskpd'
...
llvm-svn: 115029
2010-09-29 05:05:03 +00:00
Chris Lattner
890c21a20a
add assembler support for the cvtsd2sil/cvtsd2siq mnemonics, rdar://8456382
...
llvm-svn: 115027
2010-09-29 04:55:40 +00:00
Michael J. Spencer
65330be0ae
MC-COFF: Fix test. IMAGE_SYM_CLASS_LABEL should never have been emitted.
...
llvm-svn: 115024
2010-09-29 03:59:25 +00:00
Chris Lattner
54939ddf1f
make the x86 mccode emitter emit the 0x67 and 0x66 prefix bytes in the same
...
order as cctools for diffability.
llvm-svn: 115022
2010-09-29 03:43:43 +00:00
Chris Lattner
13354d7bbc
implement support for 32-bit address operands in 64-bit mode, which
...
are defined to emit the 0x67 prefix byte. rdar://8482675
llvm-svn: 115021
2010-09-29 03:33:25 +00:00
Chris Lattner
c14d59589c
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'
llvm-svn: 115019
2010-09-29 02:57:56 +00:00
Chris Lattner
f90296b045
add asmparser support for cvttpd2dq by removing some Int_ prefixes.
...
Clean up cvttps2dq by removing some redundant implementations of the
same instruction. rdar://8456382
llvm-svn: 115018
2010-09-29 02:36:32 +00:00
Chris Lattner
e5c5c8dc1f
implement rdar://8456382 - cvtsd2si support, by removing some Int_ prefixes.
...
llvm-svn: 115017
2010-09-29 02:24:57 +00:00
Chris Lattner
cbecb9a4d3
implement rdar://8456378 and PR7557 - support for the fstsw,
...
an instruction that requires a WHOLE NEW wonderful kind of alias.
llvm-svn: 115015
2010-09-29 01:50:45 +00:00
Bill Wendling
b01224f53c
And remove r114997's test.
...
llvm-svn: 115003
2010-09-28 23:24:18 +00:00
Bill Wendling
fc29f0d706
Revert r114997. It was causing a failure on darwin10-selfhost.
...
llvm-svn: 115002
2010-09-28 23:11:55 +00:00
Bill Wendling
13775375ed
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.
llvm-svn: 114997
2010-09-28 22:36:56 +00:00
Owen Anderson
c34e1296b8
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.
llvm-svn: 114995
2010-09-28 21:57:50 +00:00
Anton Korobeynikov
f1be021755
User proper libcall names & condcodes while compiling for ARM EABI.
...
Patch by Evzen Muller!
llvm-svn: 114991
2010-09-28 21:39:26 +00:00
Owen Anderson
c0e1200323
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.
llvm-svn: 114973
2010-09-28 18:32:13 +00:00
Jim Grosbach
ad51f6522d
Add target triple info to these tests to make the results comparable when
...
hosted on different platforms.
llvm-svn: 114965
2010-09-28 17:10:36 +00:00
Rafael Espindola
c604f87ba4
On elf, undefined symbols can start with .L.
...
llvm-svn: 114958
2010-09-28 16:19:11 +00:00
Bob Wilson
dc396388cb
Add a command line option "-arm-strict-align" to disallow unaligned memory
...
accesses for ARM targets that would otherwise allow it. Radar 8465431.
llvm-svn: 114941
2010-09-28 04:09:35 +00:00
Rafael Espindola
c4d0ee0b96
Write relocations in the end of the file. This matches what gas does and
...
makes files easier to diff.
llvm-svn: 114898
2010-09-27 22:04:54 +00:00
Rafael Espindola
442f81681e
Make sure .text doesn't produce extra alignment.
...
llvm-svn: 114895
2010-09-27 21:40:27 +00:00
Jakob Stoklund Olesen
c9755c5213
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.
llvm-svn: 114893
2010-09-27 21:29:20 +00:00
Daniel Dunbar
7179426193
MC/AsmParser: Handle exponents in floating point literals.
...
llvm-svn: 114861
2010-09-27 20:12:52 +00:00
Jakob Stoklund Olesen
cfed90fe40
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.
llvm-svn: 114859
2010-09-27 18:43:48 +00:00
Jakob Stoklund Olesen
51362ba70e
Explicitly disable CGP critical edge splitting for this test so it won't break
...
by reenabling it temporarily.
llvm-svn: 114858
2010-09-27 18:43:43 +00:00
Jakob Stoklund Olesen
d1779cf19c
Don't depend on basic block numbering.
...
llvm-svn: 114857
2010-09-27 18:43:40 +00:00
Michael J. Spencer
4867bf0fad
MC-COFF: Drop empty sections, and label symbols. Convert relocations
...
targeted at symbols into relocations relative to the containing section.
Patch by Nathan Jeffords!
llvm-svn: 114823
2010-09-27 08:58:26 +00:00
Chris Lattner
b335259960
yet more aliases.
...
llvm-svn: 114822
2010-09-27 07:24:57 +00:00
Chris Lattner
be06321564
add a couple more aliases, rdar://8456378
...
llvm-svn: 114821
2010-09-27 07:21:41 +00:00
Chris Lattner
26c94e7200
fix rdar://8470918 - llvm-mc can't assemble smovl
...
llvm-svn: 114819
2010-09-27 07:11:53 +00:00
Chris Lattner
5cadf79b60
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.
llvm-svn: 114818
2010-09-27 07:08:21 +00:00
Chris Lattner
0ebcc18dec
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.
llvm-svn: 114817
2010-09-27 06:44:54 +00:00
Chris Lattner
75edc6b6e0
implement support for 'clr' alias. This is part of rdar://8416805,
...
but balrog was wanting it on irc.
llvm-svn: 114809
2010-09-27 04:23:03 +00:00
Che-Liang Chiou
aeccb0793b
Add test case for PTX ret instruction
...
llvm-svn: 114789
2010-09-25 07:49:54 +00:00
Che-Liang Chiou
0eaf890a31
Add ret instruction to PTX backend
...
llvm-svn: 114788
2010-09-25 07:46:17 +00:00
Rafael Espindola
e4c0edf697
Move ELF to HasReliableSymbolDifference=true. Also take the opportunity to put
...
symbols defined in merge sections in independent atoms.
llvm-svn: 114786
2010-09-25 05:42:19 +00:00
Owen Anderson
856fcd57d1
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.
llvm-svn: 114785
2010-09-25 05:26:18 +00:00
Rafael Espindola
b70ab59ca8
Reapply 114678 and 114667. Reverting them did not fix the bot:
...
http://google1.osuosl.org:8011/builders/llvm-gcc-i386-linux-selfhost/builds/69
llvm-svn: 114761
2010-09-24 21:19:03 +00:00
Jakob Stoklund Olesen
eb9c5129d1
Be more precise when trying to XFAIL this tester: http://google1.osuosl.org:8011/builders/llvm-arm-linux
...
llvm-svn: 114755
2010-09-24 20:34:49 +00:00
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