Commit Graph

95912 Commits

Author SHA1 Message Date
Owen Anderson 0e7d728327 Add correct Thumb2 encodings for mvn and friends.
llvm-svn: 119170
2010-11-15 18:45:17 +00:00
Dan Gohman 56f3a4c761 Update examples and documentation to explicitly add basicaa, now that it's
no longer included by default.

llvm-svn: 119169
2010-11-15 18:41:10 +00:00
Johnny Chen 913af510c7 Also add a test for "frame variable '(anonymous namespace)::i'",
plus expression command using fully qualified names.

llvm-svn: 119168
2010-11-15 18:40:06 +00:00
Jim Grosbach 5cf10ea1d1 Add FIXMEs.
llvm-svn: 119167
2010-11-15 18:36:48 +00:00
Rafael Espindola d1002f6fce Fixes PR8611.
Silence warning about -g not being used during linking. I couldn't find any
change in behavior in gcc liking when given -g. Please open another bug if
I missed something.

llvm-svn: 119166
2010-11-15 18:28:16 +00:00
Johnny Chen 6ba9d1f944 Add test sequences for 'frame variable' address-of operator and 'frame variable' fully-qualified name variable.
Also add some comments.

llvm-svn: 119165
2010-11-15 18:27:57 +00:00
Jim Grosbach 40a7f57d0d Nuke redundant encoding bit set.
llvm-svn: 119164
2010-11-15 18:17:24 +00:00
Dan Gohman b83aed95c9 -basicaa is no longer the default.
llvm-svn: 119163
2010-11-15 18:07:16 +00:00
Johnny Chen 92dac7ae1b Add test sequence for 'frame variable this' and 'expression this' when stopped
inside a ctor.

llvm-svn: 119162
2010-11-15 18:04:54 +00:00
Duncan Sands f12ba1dfe1 Teach InstructionSimplify the trick of skipping incoming phi
values that are equal to the phi itself.

llvm-svn: 119161
2010-11-15 17:52:45 +00:00
Johnny Chen deac523f7c Remove the @expectedFailure decorator and uncomment 'expression -- i + j" test,
as both rdar://problem/8659840 and rdar://problem/8660275 have been fixed.

llvm-svn: 119160
2010-11-15 17:42:22 +00:00
Fariborz Jahanian c961119dcd Restore these tests. I think I fixed the problem.
We shall see.

llvm-svn: 119158
2010-11-15 17:06:17 +00:00
Duncan Sands 01157b027b Move PHI tests to phi.ll, out of select.ll.
llvm-svn: 119153
2010-11-15 16:43:28 +00:00
Rafael Espindola 8c3039b67b Change MCExpr::EvaluateAsRelocatableImpl of variables to return the original
variable if recursing fails to simplify it.

Factor AliasedSymbol to be a method of MCSymbol.

Update MCAssembler::EvaluateFixup to match the change in
EvaluateAsRelocatableImpl.

Remove the WeakRefExpr hack, as the object writer now sees the weakref with
no extra effort needed.

Nothing else is using MCTargetExpr, but keep it for now.

Now that the ELF writer sees relocations with aliases, handle

    .weak    foo2
foo2:
    .weak    bar2
    .set    bar2,foo2
    .quad    bar2

the same way gas does and produce a relocation with bar2.

llvm-svn: 119152
2010-11-15 16:33:49 +00:00
Jason W Kim 96f4c01cb3 Dovetail with Dan Dunbar's rework of ELFObjectWriter.
Added 2 new subclasses - X86ELFObjectWriter and ARMELFObectWriter.
ARM and X86 require different code for RecordRelocation(), possibly others.

llvm-svn: 119149
2010-11-15 16:18:39 +00:00
Douglas Gregor ee430a39c3 Implement C++0x [temp.func.order]p3 (aka DR532) properly. In
particular, we only add the implement object parameter type if only
one of the function templates is a non-static member function
template.

Moreover, since this DR differs from existing practice in C++98/03,
this commit implements the existing practice (which ignores the
first parameter of the function template that is not the non-static
member function template) in C++98/03 mode.

llvm-svn: 119145
2010-11-15 15:41:16 +00:00
Rafael Espindola 46c79ef113 Fix PR8565.
This moves most of the isUsed logic to the MCSymbol itself. With this we
get a bit more relaxed about allowing definitions after uses: uses that
don't evaluate their argument immediately (jmp foo) are accepted.

ddunbar, this was the smallest compromise I could think of that lets us
accept gcc (and clang!) assembly.

llvm-svn: 119144
2010-11-15 14:40:36 +00:00
Chandler Carruth 99da11cf04 Silence an unused variable warning during release builds by folding the
expression into the assert.

llvm-svn: 119143
2010-11-15 13:54:43 +00:00
Kalle Raiskila 731d392d1c Improve code layout, mostly indentation.
No functionality change.

llvm-svn: 119142
2010-11-15 10:12:32 +00:00
John McCall 3065d046b5 Yes, vector conversions are bitcasts.
llvm-svn: 119141
2010-11-15 10:08:00 +00:00
John McCall f608debd9b Kill CK_Unknown references in the ObjC rewriter. The actual
choice of cast doesn't matter here, but I've tried to choose
the right one anyway.

llvm-svn: 119140
2010-11-15 09:46:46 +00:00
Chandler Carruth 3b702674f4 Fix a think-o. Fixes PR8606.
llvm-svn: 119139
2010-11-15 09:28:23 +00:00
John McCall 8cb679e4e1 Assorted work leading towards the elimination of CK_Unknown.
llvm-svn: 119138
2010-11-15 09:13:47 +00:00
Zhongxing Xu 14776cf96a Add driver support for Ubuntu 9.10.
llvm-svn: 119137
2010-11-15 09:01:52 +00:00
Chris Lattner aac9fa731d Wire up primitive support in the assembler backend for writing .o files
directly on the mac.  This is very early, doesn't support relocations and
has a terrible hack to avoid .machine from being printed, but despite
that it generates an bitwise-identical-to-cctools .o file for stuff like 
this:

  define i32 @test() nounwind { ret i32 42 }

I don't plan to continue pushing this forward, but if anyone else was
interested in doing it, it should be really straight-forward.

llvm-svn: 119136
2010-11-15 08:49:58 +00:00
Zhongxing Xu 5d30c69813 Add skeleton for handling other kinds of CFGElements.
llvm-svn: 119135
2010-11-15 08:48:43 +00:00
Chris Lattner efacb9ee42 split out an encoder for memri operands, allowing a relocation to be plopped
into the immediate field.  This allows us to encode stuff like this:

        lbz r3, lo16(__ZL4init)(r4)     ; globalopt.cpp:5
                                        ; encoding: [0x88,0x64,A,A]
                                        ;   fixup A - offset: 0, value: lo16(__ZL4init), kind: fixup_ppc_lo16

        stw r3, lo16(__ZL1s)(r5)        ; globalopt.cpp:6
                                        ; encoding: [0x90,0x65,A,A]
                                        ;   fixup A - offset: 0, value: lo16(__ZL1s), kind: fixup_ppc_lo16

With this, we should have a completely function MCCodeEmitter for PPC, wewt.

llvm-svn: 119134
2010-11-15 08:22:03 +00:00
Chris Lattner 8f4444d003 add support for encoding the lo14 forms used for a few PPC64 addressing
modes.  For example, we now get:

	ld r3, lo16(_G)(r3)             ; encoding: [0xe8,0x63,A,0bAAAAAA00]
                                        ;   fixup A - offset: 0, value: lo16(_G), kind: fixup_ppc_lo14

llvm-svn: 119133
2010-11-15 08:02:41 +00:00
Chris Lattner 15e9d5ef8a fix a regression with the new instprinter: we lost the ability to
print DBG_VALUE instructions.  This should unbreak the llvm-gcc-powerpc-darwin9
buildbot.

llvm-svn: 119132
2010-11-15 07:52:06 +00:00
Chandler Carruth eb84200747 Clean up some names and fix the handling of default sysroots on Windows and
other platforms where the textual default of '/' isn't the system's root
directory. We should probably still make the textual default platform specific,
but this should avoid the particularly bad problem with the previous state: we
applied a sysroot of '/' to '/usr/local/google' which added
'//usr/local/include' to the windows header search path, a share on another
machine named 'usr'. Oops.

llvm-svn: 119131
2010-11-15 07:15:26 +00:00
Chris Lattner 578c765fc8 pull the code to get the operand value out of the loop.
llvm-svn: 119130
2010-11-15 07:09:28 +00:00
Chris Lattner c19d510363 split the giant encoder loop into two new helper functions.
llvm-svn: 119129
2010-11-15 06:59:17 +00:00
Chris Lattner 42c4ac4841 reduce nesting and minor cleanups, no functionality change.
llvm-svn: 119128
2010-11-15 06:42:13 +00:00
Chris Lattner 6566112e9c implement the start of support for lo16 and ha16, allowing us to get stuff like:
lis r4, ha16(__ZL4init)         ; encoding: [0x3c,0x80,A,A]
                                        ;   fixup A - offset: 0, value: ha16(__ZL4init), kind: fixup_ppc_ha16

llvm-svn: 119127
2010-11-15 06:33:39 +00:00
Chris Lattner 85e37684bf add a fixup for conditional branches, giving us output like this:
beq cr0, LBB0_4                 ; encoding: [0x41,0x82,A,0bAAAAAA00]
                                        ;   fixup A - offset: 0, value: LBB0_4, kind: fixup_ppc_brcond14

llvm-svn: 119126
2010-11-15 06:12:22 +00:00
Chris Lattner 0e3461e417 change direct branches to encode with the same encoding method
as direct calls.  Change conditional branches to encode with
their own method, simplifying the JIT encoder and making room
for adding an mc fixup.

llvm-svn: 119125
2010-11-15 06:09:35 +00:00
Chris Lattner 7064198397 eliminate a now-unneeded operand printer.
llvm-svn: 119124
2010-11-15 06:01:10 +00:00
Chris Lattner 79fa37152a split call operands out to their own encoding class, simplifying
code in the JIT.  Use this to form the first fixup for the PPC backend,
giving us stuff like this:

	bl L_foo$stub ; encoding: [0b010010AA,A,A,0bAAAAAA01]
                                        ;   fixup A - offset: 0, value: L_foo$stub, kind: fixup_ppc_br24

llvm-svn: 119123
2010-11-15 05:57:53 +00:00
Chris Lattner 9e7d8c0313 correct the fixup comment printer to work on big endian platforms.
llvm-svn: 119122
2010-11-15 05:56:19 +00:00
Chris Lattner d6a07ccd10 add proper encoding for MTCRF instead of using a hack.
llvm-svn: 119121
2010-11-15 05:19:25 +00:00
Chris Lattner 63274cbc5d add fields to the .td files unconditionally, simplifying tblgen a bit.
Switch the ARM backend to use 'let' instead of 'set' with this change.

llvm-svn: 119120
2010-11-15 05:19:05 +00:00
Chris Lattner 85854eb4d9 remove a pointless testcase.
llvm-svn: 119119
2010-11-15 05:07:03 +00:00
Chris Lattner c877d8f44c add basic encoding support for immediates and registers, allowing us
to encode all of these instructions correctly (for example):

        mflr r0                         ; encoding: [0x7c,0x08,0x02,0xa6]
        stw r0, 8(r1)                   ; encoding: [0x90,0x01,0x00,0x08]
        stwu r1, -64(r1)                ; encoding: [0x94,0x21,0xff,0xc0]

llvm-svn: 119118
2010-11-15 04:51:55 +00:00
Chris Lattner 0ae07e1484 add a dummy entry to fix a build error
llvm-svn: 119117
2010-11-15 04:47:16 +00:00
Chris Lattner 9ec375c8ea Implement a basic MCCodeEmitter for PPC. This doesn't handle
fixups yet, and doesn't handle actually encoding operand values,
but this is enough for llc -show-mc-encoding to show the base
instruction encoding information, e.g.:

	mflr r0                         ; encoding: [0x7c,0x08,0x02,0xa6]
	stw r0, 8(r1)                   ; encoding: [0x90,0x00,0x00,0x00]
	stwu r1, -64(r1)                ; encoding: [0x94,0x00,0x00,0x00]
Ltmp0:
	lhz r4, 4(r3)                   ; encoding: [0xa0,0x00,0x00,0x00]
	cmplwi cr0, r4, 8               ; encoding: [0x28,0x00,0x00,0x00]
	beq cr0, LBB0_2                 ; encoding: [0x40,0x00,0x00,0x00]

llvm-svn: 119116
2010-11-15 04:16:32 +00:00
Chris Lattner 045e04dbfe dissolve some more hacks.
llvm-svn: 119115
2010-11-15 03:53:53 +00:00
Chris Lattner fd56ee2c40 fix some fixme's, removing dead code.
llvm-svn: 119114
2010-11-15 03:51:13 +00:00
Chris Lattner aa4d03d1f5 remove asmstrings (which can never be printed) from pseudo
instructions, allowing is to eliminate some dead operand 
printing methods from the instprinter.

llvm-svn: 119113
2010-11-15 03:48:58 +00:00
Chris Lattner 8bcfdab194 strength reduce TOC temp label generation, no functionality change.
llvm-svn: 119112
2010-11-15 03:42:54 +00:00
Chris Lattner 510c66f549 rip out a ton of old instruction printing junk now that the
new instprinting logic is there.

llvm-svn: 119111
2010-11-15 03:39:06 +00:00