Commit Graph

72430 Commits

Author SHA1 Message Date
Eli Friedman
24a69c7be2 Fix up this test to use explicit triples (Win64 passes a different number of arguments in registers).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131676 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 21:13:08 +00:00
Jason W Kim
861b9c6a39 This fixes one divergence between LLVM and binutils for ARM in the
text section.

Assume the following bit of annotated assembly:

.section	.data.rel.ro,"aw",%progbits
.align	2
.LAlpha:
.long	startval(GOTOFF)

.text
.align	2
.type	main,%function
.align	4

main: ;;; assume "main" starts at offset 0x20
0x0	push	{r11, lr}
0x4	movw	r0, :lower16:(.LAlpha-(.LBeta+8))
;;; ==> (.AddrOf(.LAlpha) - ((.AddrOf(.LBeta) - .AddrOf(".")) + 8)
;;; ==> (??? - ((16-4) + 8) = -20
0x8	movt	r0, :upper16:(.LAlpha-(.LBeta+8))
;;; ==> (.AddrOf(.LAlpha) - ((.AddrOf(.LBeta) - .AddrOf(".")) + 8)
;;; ==> (??? - ((16-8) + 8) = -16
0xc	... blah

.LBeta:
0x10	add	r0, pc, r0
0x14	... blah

.LGamma:
0x18	add	r1, pc, r1

Above snippet results in the following relocs in the .o file for the
first pair of movw/movt instructions

00000024 R_ARM_MOVW_PREL_NC .LAlpha
00000028 R_ARM_MOVT_PREL .LAlpha

And the encoded instructions in the .o file for main: must be

00000020 <main>:
20:	e92d4800 push	{fp, lr}
24:	e30f0fec movw	r0, #65516	; 0xffec i.e. -20
28:	e34f0ff0 movt	r0, #65520	; 0xfff0 i.e. -16

However, llc (prior to this commit) generates the following sequence

00000020 <main>:
20:	e92d4800 push	{fp, lr}
24:	e30f0fec movw	r0, #65516	; 0xffec - i.e. -20
28:	e34f0fff movt	r0, #65535	; 0xffff - i.e. -1

What has to happen in the ArmAsmBackend is that if the relocation is PC
relative, the 16 bits encoded as part of movw and movt must be both addends,
not addresses. It makes sense to encode addresses by right shifting the value
by 16, but the result is incorrect for PIC.
i.e., the right shift by 16 for movt is ONLY valid for the NON-PCRel case.

This change agrees with what GNU as does, and makes the PIC code run.

MC/ARM/elf-movt.s covers this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131674 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 20:55:25 +00:00
Devang Patel
d3a1788da1 Reapply r131605. This time with a fix, which is to use NoFolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131673 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 20:52:46 +00:00
Rafael Espindola
a3bff99f0a ADD64ri32 sign extends its argument, so we need to use a R_X86_64_32S.
Fixes PR9934.

We really need to start tblgening the relocation info :-(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131669 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 20:32:34 +00:00
Akira Hatanaka
a1a7ba8382 Align i64 arguments to 64 bit boundaries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131668 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 20:29:48 +00:00
Charles Davis
c3b162857a Implement the Win64 EH prolog instruction methods on the base MCStreamer.
I had to change the API slightly to avoid overloading issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131666 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 19:35:55 +00:00
Eli Friedman
097f9a94f6 Fix up the new StandardPasses to run the same scalarrepl passes as the old one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 19:14:54 +00:00
Evan Cheng
0efaa5e6a1 crc32 with 64-bit output zeros upper 32-bits. rdar://9467055
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131664 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:57:12 +00:00
Stuart Hastings
3dfc4b1222 Update some currently-disabled code, preparing for eventual use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131663 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:48:20 +00:00
Akira Hatanaka
59d266029c Increase number of available registers when target is MIPS32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131660 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:25:03 +00:00
Evan Cheng
aaa7f499c1 Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131659 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:18:39 +00:00
Akira Hatanaka
95b8ae190e Simplify CC_MipsO32 and merge it with CC_MipsO32_VarArgs. Patch by Sasa Stankovic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131657 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:06:05 +00:00
Joerg Sonnenberger
f8cd708f14 Reapply 131644 including the missing header changes:
Introduce -fatal-assembler-warnings for the obvious purpose


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131655 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 18:00:13 +00:00
Stuart Hastings
d22f036c2a Reverting 131641 to investigate 'bot complaint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131654 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:54:42 +00:00
Eli Friedman
8bd71a1ec1 Revert r131644; it's breaking the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131653 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:48:09 +00:00
Charles Davis
440596ffe5 Turns out GAS does have Win64 EH directives. (It also supports WinCE EH.) Make
ours compatible with GAS.

In retrospect, I should have emailed binutils about this earlier. Thanks to
Kai Tietz for pointing out that GAS already had SEH directives.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131652 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:46:39 +00:00
Jim Grosbach
6635b04a43 80 columns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131649 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:34:53 +00:00
Joerg Sonnenberger
bae1c924ce Introduce -fatal-assembler-warnings for the obvious purpose
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131644 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:27:01 +00:00
Akira Hatanaka
d48cfaec35 Fix data layout string. i64 is aligned to 64 bit boundaries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131642 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 17:21:09 +00:00
Stuart Hastings
b6dcf3c514 Revise MOVSX16rr8/MOVZX16rr8 (and rm variants) to no longer be
pseudos.  rdar://problem/8614450


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131641 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 16:59:50 +00:00
Stuart Hastings
26847d40db Move test to Transforms/InstCombine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 05:53:22 +00:00
Cameron Zwarich
055cdfc541 Use the correct register class for Cell varargs spilling. This fixes all of the
verifier failures in the CodeGen/CellSPU tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131631 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 04:44:19 +00:00
Mon P Wang
28e2b1d29a Fixed sdiv and udiv for <4 x i16>. The test from r125402 still applies for this change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131630 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 04:15:07 +00:00
Charles Davis
91d9a1c0f7 Implement the StartChained and EndChained Win64 EH methods on MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131629 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 04:04:13 +00:00
Cameron Zwarich
d76773a221 Make CodeGen/PowerPC/2007-09-11-RegCoalescerAssert.ll pass with the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131627 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 03:11:06 +00:00
Cameron Zwarich
0113e4e3f2 Fix PR8828 by removing the explicit def in MovePCToLR as well as the pointless
piclabel operand. The operand in the tablegen definition doesn't actually turn
into an MI operand, so it just confuses anything checking the TargetInstrDesc
for the number of operands. It suffices to just have an implicit def of LR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131626 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:56:28 +00:00
Cameron Zwarich
462b6dc6bf Reuse the TargetInstrDesc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131625 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:56:23 +00:00
Francois Pichet
2536f801dc Fix the MSVC build.
Use a set of overloaded functions instead of template function for CreatePassFn.

It seems that template deduction for functions type that differs only by return type doesn't work with MSVC. 

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131624 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:54:11 +00:00
Charles Davis
0855bc5b97 Implement the StartProc and EndProc Win64 EH methods on the base MCStreamer.
Based largely on Rafael Espindola's work on CFI. Other methods soon to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131623 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:49:00 +00:00
Charles Davis
fa89218a43 Fix build issues with headers, which I discovered by actually using them.
Also, convert all the inline functions on UnwindInfo into methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131622 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:47:23 +00:00
Rafael Espindola
cf227d5ad9 Add test for PR9946.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131621 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:35:26 +00:00
Rafael Espindola
216dde91d1 revert 131605 to fix PR9946.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131620 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:26:30 +00:00
Cameron Zwarich
21803721d5 Correctly constrain a register class when computing frame offsets, as the Thumb2
add instruction takes an rGPR. This fixes the last of PR8825.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131619 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 02:18:27 +00:00
Cameron Zwarich
6fcb6e454b Revert r128961 because it didn't include a test and causes the verifier to fail
on CodeGen/X86/2007-05-07-InvokeSRet.ll. There is probably a bug here that was
fixed by r128961, but since there is no test or reference to a source file I have
to revert it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131618 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 01:56:19 +00:00
Eli Friedman
6fd5a6000b Make the demanded bits/elements optimizations preserve debug line information.
I'm not sure this is quite ideal, but I can't really think of any better way to do it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 01:20:42 +00:00
Jim Grosbach
c0ceedb6f8 Avoid a Twine that referenced a tmp (which proceded to go out of scope before
the Twine was used).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131612 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 00:45:05 +00:00
Devang Patel
1f5812bd99 Use IRBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131609 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 00:13:33 +00:00
Rafael Espindola
ed1d0ac57d Another try at fixing cmake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131608 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 00:13:04 +00:00
Devang Patel
1aa89a2f91 Use IRBuilder while simplifying unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131607 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 00:09:21 +00:00
Rafael Espindola
7205d431f1 Revert my previous patch. The cmake build had already been fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-19 00:02:45 +00:00
Devang Patel
0b4ccdc98c Use IRBuilder while simplifying conditional branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131605 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:59:51 +00:00
Eli Friedman
e6f364b6c4 More instcombine cleanup, towards improving debug line info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131604 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:58:37 +00:00
Jim Grosbach
e0b58634a1 Restore sanity to 131601.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131603 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:56:43 +00:00
Rafael Espindola
e37234739e Fix the cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131602 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:56:40 +00:00
Jim Grosbach
3ec2c7c3e4 Objective C functions may use a magic '\1' on the name. Handle that when
dealing with them in the MCJIT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131601 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:53:21 +00:00
Eli Friedman
49fcf571da Shuffle StandardPasses.cpp into VMCore; add it to CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131600 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:51:11 +00:00
Devang Patel
02dd5418d2 Use IRBuilder while simplifying branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131598 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:18:47 +00:00
Eli Friedman
22486c9aba Revert unintentional commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131597 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:13:10 +00:00
Eli Friedman
107ffd58f7 More instcombine simplifications towards better debug locations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131596 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:11:30 +00:00
Cameron Zwarich
631fcbf810 Add missing mayLoad / mayStore flags to instruction definitions without patterns,
which fixes all of the CodeGen/MBlaze verifier failures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 23:03:10 +00:00