1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

35826 Commits

Author SHA1 Message Date
Kevin Enderby
57859abd72 Added support for X86 instruction prefixes so llvm-mc can assemble them. The
Lock prefix, Repeat string operation prefixes and the Segment override prefixes.
Also added versions of the move string and store string instructions without the
repeat prefixes to X86InstrInfo.td. And finally marked the rep versions of
move/store string records in X86InstrInfo.td as isCodeGenOnly = 1 so tblgen is
happy building the disassembler files.

llvm-svn: 95252
2010-02-03 21:04:42 +00:00
Devang Patel
32eb7508e4 Emit appropriate expression to find virtual base offset.
llvm-svn: 95242
2010-02-03 20:08:48 +00:00
Devang Patel
83d905f82b Provide interface to identifiy artificial methods.
llvm-svn: 95240
2010-02-03 19:57:19 +00:00
Jeffrey Yasskin
92abe5abcc r94686 changed all ModuleProvider parameters to Modules, which made the
1-argument ExecutionEngine::create(Module*) ambiguous with the signature that
used to be ExecutionEngine::create(ModuleProvider*, defaulted_params).  Fixed
by removing the 1-argument create().  Fixes PR6221.

llvm-svn: 95236
2010-02-03 19:18:04 +00:00
Daniel Dunbar
d997cd69cd llvm-mc: Add --show-inst option, for showing the MCInst inline with the assembly
output.

llvm-svn: 95227
2010-02-03 18:18:30 +00:00
Bob Wilson
8635e08b7f Adjust the heuristics used to decide when SROA is likely to be profitable.
The SRThreshold value makes perfect sense for checking if an entire aggregate
should be promoted to a scalar integer, but it is not so good for splitting
an aggregate into its separate elements.  A struct may contain a large embedded
array along with some scalar fields that would benefit from being split apart
by SROA.  Even if the total aggregate size is large, it may still be good to
perform SROA.  Thus, the most important piece of this patch is simply moving
the aggregate size comparison vs. SRThreshold so that it guards only the
aggregate promotion.

We have also been checking the number of elements to decide if an aggregate
should be split up.  The limit of "SRThreshold/4" seemed rather arbitrary,
and I don't think it's very useful to derive this limit from SRThreshold
anyway.  I've collected some data showing that the current default limit of
32 (since SRThreshold defaults to 128) is a reasonable cutoff for struct
types.  One thing suggested by the data is that distinguishing between structs
and arrays might be useful.  There are (obviously) a lot more large arrays
than large structs (as measured by the number of elements and not the total
size -- a large array inside a struct still counts as a single element given
the way we do SROA right now).  Out of 8377 arrays where we successfully
performed SROA while compiling a large set of benchmarks, only 16 of them had
more than 8 elements.  And, for those 16 arrays, it's not at all clear that
SROA was actually beneficial.  So, to offset the compile time cost of
investigating more large structs for SROA, the patch lowers the limit on array
elements to 8.

This fixes Apple Radar 7563690.

llvm-svn: 95224
2010-02-03 17:23:56 +00:00
Chris Lattner
4b6b2b1363 reapply r95206, this time actually delete the code I'm replacing in the third stub case.
llvm-svn: 95209
2010-02-03 06:42:38 +00:00
Chris Lattner
427e5bf013 revert r95206, it is apparently causing bootstrap failure on i386-darwin9
llvm-svn: 95208
2010-02-03 06:41:18 +00:00
Chris Lattner
6fe16de58e print instruction encodings with the existing comment facilities,
so that llvm-mc -show-encoding prints like this:

	hlt                                                 ## encoding: [0xf4]

instead of like this:

	hlt
                     # encoding: [0xf4]

llvm-svn: 95207
2010-02-03 06:28:13 +00:00
Chris Lattner
39e5f7d84d make the x86 backend emit darwin stubs through mcstreamer
instead of textually.

llvm-svn: 95206
2010-02-03 06:21:16 +00:00
Chris Lattner
837d242070 make MachineModuleInfoMachO hold non-const MCSymbol*'s instead
of const ones.  non-const ones aren't very useful, because you can't
even, say, emit them.

llvm-svn: 95205
2010-02-03 06:18:30 +00:00
Chris Lattner
e8811c3222 change addPassesToEmitFile to return true on failure instead of its input,
add -filetype=null for performance testing and remove -filetype=dynlib,
which isn't planned to be implemented.

llvm-svn: 95202
2010-02-03 05:55:08 +00:00
Evan Cheng
e273e42195 Revert 94937 and move the noreturn check to codegen.
llvm-svn: 95198
2010-02-03 03:55:59 +00:00
John McCall
8bcabdeffc Make APInt::countLeadingZerosSlowCase() treat the contents of padding bits
as undefined.  Fixes an assertion in APFloat::toString noticed by Dale.

llvm-svn: 95196
2010-02-03 03:42:44 +00:00
Evan Cheng
d9cf09b0d6 Allow all types of callee's to be tail called. But avoid automatic tailcall if the callee is a result of bitcast to avoid losing necessary zext / sext etc.
llvm-svn: 95195
2010-02-03 03:28:02 +00:00
Chris Lattner
eb6d6da2e4 don't emit \n's at the start of X86AsmPrinter::runOnMachineFunction,
.o files don't like that.

llvm-svn: 95187
2010-02-03 01:49:49 +00:00
Chris Lattner
a64be6d665 privatize a bunch of methods and move \n printing into them.
llvm-svn: 95186
2010-02-03 01:46:05 +00:00
Chris Lattner
dda5d34934 rename printMachineInstruction -> EmitInstruction
llvm-svn: 95184
2010-02-03 01:41:03 +00:00
Dale Johannesen
1e9d147461 Reapply 95050 with a tweak to check the register class.
llvm-svn: 95183
2010-02-03 01:40:33 +00:00
Chris Lattner
0bb2e04b36 print instructions through the mcstreamer.
llvm-svn: 95181
2010-02-03 01:16:28 +00:00
Chris Lattner
bcba6c8a07 emit instructions through the streamer.
llvm-svn: 95180
2010-02-03 01:15:03 +00:00
Chris Lattner
1797ff9f5a Finally eliminate printMCInst and send instructions through
the streamer.  Demo:

$ cat t.ll 
define i32 @test() nounwind {
  ret i32 42
}
$ llc t.ll -o -
...
_test: 
	movl	$42, %eax
	ret
$ llc t.ll -o t.o -filetype=obj
$ otool -tv t.o 
t.o:
(__TEXT,__text) section
_test:
00000000	movl	$0x0000002a,%eax
00000005	ret

llvm-svn: 95179
2010-02-03 01:13:25 +00:00
Chris Lattner
edf1e280a2 rejigger the world so that EmitInstruction prints the \n at
the end of the instruction instead of expecting the caller to
do it.  This currently causes the asm-verbose instruction 
comments to be on the next line.

llvm-svn: 95178
2010-02-03 01:09:55 +00:00
Chris Lattner
cd07a3a0b7 sink handling of target-independent machine instrs (other
than DEBUG_VALUE :(  ) into the target indep AsmPrinter.cpp
file.   This allows elimination of the 
NO_ASM_WRITER_BOILERPLATE hack among other things.

llvm-svn: 95177
2010-02-03 01:00:52 +00:00
Dale Johannesen
7c4c39e651 Print FPImm a less kludgy way; APFloat.toString seems
to have some problems anyway.

llvm-svn: 95171
2010-02-03 00:36:40 +00:00
Bob Wilson
cabb8bea4c Fix some comment typos.
llvm-svn: 95170
2010-02-03 00:33:21 +00:00
Chris Lattner
7e4c2b183b pass an instprinter into the AsmPrinter if it is available.
llvm-svn: 95168
2010-02-03 00:29:55 +00:00
Chris Lattner
bdd4ae564a make any use of the "O" stream in asmprinter print to
stderr if in filetype=obj mode.  This is a hack, and will
live until dwarf emission and other random stuff that is
not yet going through MCStreamer is upgraded.  It only
impacts filetype=obj mode.

llvm-svn: 95166
2010-02-03 00:22:02 +00:00
Eric Christopher
ac28e14b77 Recommit this, looks like it wasn't the cause.
llvm-svn: 95165
2010-02-03 00:21:58 +00:00
Evan Cheng
1d121ec4d1 ByVal frame object size should be that of the byval argument, not the size of the type which is just a pointer. This is not known to break stuff but is wrong nevertheless.
llvm-svn: 95163
2010-02-02 23:58:13 +00:00
Chris Lattner
78f57ac8dc Hook up -filetype=obj through the MachO streamer. Here's a demo:
$ cat t.ll 
@g = global i32 42
$ llc t.ll -o t.o -filetype=obj
$ nm t.o
00000000 D _g

There is still a ton of work left.  Instructions are not being encoded
yet apparently.

llvm-svn: 95162
2010-02-02 23:57:42 +00:00
Jim Grosbach
23b76845a7 As of r79039, we still try to eliminate the frame pointer on leaf functions,
even when -disable-fp-elim is specified.

llvm-svn: 95161
2010-02-02 23:56:14 +00:00
Evan Cheng
9057fea7ef Revert 95130.
llvm-svn: 95160
2010-02-02 23:55:14 +00:00
Dale Johannesen
ca2fe230d2 Accept floating point immediates in DEBUG_VALUE.
llvm-svn: 95159
2010-02-02 23:54:23 +00:00
Daniel Dunbar
c6f8382263 AsmParser/X86: Add temporary hack to allow parsing "sal". Eventually we need
some mechanism for specifying alternative syntaxes, but I'm not sure what form
that should take yet.

llvm-svn: 95158
2010-02-02 23:46:47 +00:00
Chris Lattner
62ba09bb47 use OwningPtr and factor code better.
llvm-svn: 95156
2010-02-02 23:45:17 +00:00
Chris Lattner
643f2f9bc4 refactor code so that LLVMTargetMachine creates the asmstreamer and
mccontext instead of having AsmPrinter do it.  This allows other 
types of MCStreamer's to be passed in.

llvm-svn: 95155
2010-02-02 23:37:42 +00:00
Eric Christopher
f070aae6f7 Hopefully temporarily revert this.
llvm-svn: 95154
2010-02-02 23:01:31 +00:00
Chris Lattner
9ba7b16a19 simplify getVerboseAsm
llvm-svn: 95153
2010-02-02 22:58:13 +00:00
Chris Lattner
501138c6ad move handling of asm-verbose out of AsmPrinter.cpp into LLVMTargetMachine.cpp with the rest of the command line options.
llvm-svn: 95152
2010-02-02 22:54:51 +00:00
Chris Lattner
665a764dbe remove dead #include, stupid symlinks.
llvm-svn: 95150
2010-02-02 22:37:42 +00:00
Chris Lattner
7dd4ad3ced Remove a bunch of stuff around the edges of the ELF writer.
Now the only use of the ELF writer is the JIT, which won't be
easy to fix in the short term. :( :(

llvm-svn: 95148
2010-02-02 22:31:11 +00:00
Eric Christopher
048492d669 Reformat my last patch slightly.
llvm-svn: 95147
2010-02-02 22:29:26 +00:00
Chris Lattner
6996a481db tidy some targets.
llvm-svn: 95146
2010-02-02 22:13:21 +00:00
Eric Christopher
575fe8690d Re-add strcmp and known size object size checking optimization.
Passed bootstrap and nightly test run here.

llvm-svn: 95145
2010-02-02 22:10:43 +00:00
Chris Lattner
04d5dfafae remove dead code.
llvm-svn: 95144
2010-02-02 22:03:00 +00:00
Chris Lattner
b3d8901ca8 detemplatize the ppc code emitter.
llvm-svn: 95142
2010-02-02 21:55:58 +00:00
Chris Lattner
40e4a9d982 remove dead code.
llvm-svn: 95141
2010-02-02 21:52:03 +00:00
Chris Lattner
3dedba8e8c add a definition for ID.
llvm-svn: 95140
2010-02-02 21:49:29 +00:00
Chris Lattner
00a839b592 detemplatize ARM code emitter.
llvm-svn: 95138
2010-02-02 21:48:51 +00:00