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

10737 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
de018e2d8e Don't verify physical registers going into landing pads.
Magic is happening that we don't understand.

llvm-svn: 117370
2010-10-26 16:49:23 +00:00
Evan Cheng
324e678bb7 Use instruction itinerary to determine what instructions are 'cheap'.
llvm-svn: 117348
2010-10-26 02:08:50 +00:00
Nick Lewycky
f7dddd658f For statistics that are only used in functions declared in !NDEBUG, wrap the
declarations in !NDEBUG to avoid -Wunused-variable warnings. Patch by
Matt Beaumont-Gay!

llvm-svn: 117345
2010-10-26 00:51:57 +00:00
Jakob Stoklund Olesen
b0c10ed95a InlineSpiller can also update LiveStacks.
llvm-svn: 117338
2010-10-26 00:11:35 +00:00
Jakob Stoklund Olesen
3988c3fb55 Make the spiller responsible for updating the LiveStacks analysis.
llvm-svn: 117337
2010-10-26 00:11:33 +00:00
Bob Wilson
309484bb46 When the "true" and "false" blocks of a diamond if-conversion are the same,
do not double-count the duplicate instructions by counting once from the
beginning and again from the end.  Keep track of where the duplicates from
the beginning ended and don't go past that point when counting duplicates
at the end.  Radar 8589805.

This change causes one of the MC/ARM/simple-fp-encoding tests to produce
different (better!) code without the vmovne instruction being tested.
I changed the test to produce vmovne and vmoveq instructions but moving
between register files in the opposite direction.  That's not quite the same
but predicated versions of those instructions weren't being tested before,
so at least the test coverage is not any worse, just different.

llvm-svn: 117333
2010-10-26 00:02:24 +00:00
Bob Wilson
685e143630 Change if-conversion to keep track of the extra cost due to microcoded
instructions separately from the count of non-predicated instructions.  The
instruction count is used in places to determine how many instructions to
copy, predicate, etc. and things get confused if that count includes the
extra cost for microcoded ops.

llvm-svn: 117332
2010-10-26 00:02:21 +00:00
Evan Cheng
2439e51388 Neuter r117193 as it causes significant post-ra scheduler compile time regression.
llvm-svn: 117329
2010-10-25 23:56:21 +00:00
Devang Patel
fa145a94d1 Simplify.
Do not count use of sdisel for single call instruction.

llvm-svn: 117316
2010-10-25 21:31:46 +00:00
Devang Patel
3779ad5d59 Add counters to count basic blocks and machine basic blocks with out of order line number info.
Add counters to count how many basic blocks are entirely selected by fastisel.

llvm-svn: 117310
2010-10-25 20:55:43 +00:00
Devang Patel
24a6b791b6 Add simple counter to count no. of basic blocks without any line number information. At -O0, these basic block coule cause less than optimial debugging experience.
llvm-svn: 117307
2010-10-25 20:45:32 +00:00
Jakob Stoklund Olesen
7aeb8acd65 In which I learn how to forward declare template classes.
llvm-svn: 117272
2010-10-25 17:27:30 +00:00
Chandler Carruth
7dd652736f Move the remaining attribute macros to systematic names based on the attribute
name and prefixed with 'LLVM_'.

llvm-svn: 117203
2010-10-23 08:40:19 +00:00
Chandler Carruth
25324e76ae Fix a likely bug in an assertion by adding parentheses around '||'. This bug
was found by a GCC warning. ;]

llvm-svn: 117199
2010-10-23 07:46:14 +00:00
Evan Cheng
030f55c496 Properly model the latency of register defs which are 1) function returns or
2) live-outs.

Previously the post-RA schedulers completely ignore these dependencies since
returns, branches, etc. are all scheduling barriers. This patch model the
latencies between instructions being scheduled and the barriers. It also
handle calls by marking their register uses.

llvm-svn: 117193
2010-10-23 02:10:46 +00:00
Jakob Stoklund Olesen
964f6a6be6 Verify LiveIntervals against the CFG, ensuring that live-in values are live-out
of all predecessors.

llvm-svn: 117191
2010-10-23 00:49:09 +00:00
Andrew Trick
4043309a54 Nonvirtual dtor that was accessible enough to be bad.
llvm-svn: 117180
2010-10-22 23:33:19 +00:00
Andrew Trick
7a1dadd47d This is a prototype of an experimental register allocation
framework. It's purpose is not to improve register allocation per se,
but to make it easier to develop powerful live range splitting. I call
it the basic allocator because it is as simple as a global allocator
can be but provides the building blocks for sophisticated register
allocation with live range splitting. 

A minimal implementation is provided that trivially spills whenever it
runs out of registers. I'm checking in now to get high-level design
and style feedback. I've only done minimal testing. The next step is
implementing a "greedy" allocation algorithm that does some register
reassignment and makes better splitting decisions.

llvm-svn: 117174
2010-10-22 23:09:15 +00:00
Jakob Stoklund Olesen
c78f761faf Add more verification of LiveIntervals.
llvm-svn: 117170
2010-10-22 22:48:58 +00:00
Jakob Stoklund Olesen
68258f467a Be more strict about detecting multi-use blocks for isolation.
When a block has exactly two uses and the register is both live-in and live-out,
don't isolate the block. We would be inserting two copies, so we haven't really
made any progress.

If the live-in and live-out values separate into disconnected components after
splitting, we would be making progress. We can't detect that for now.

llvm-svn: 117169
2010-10-22 22:48:56 +00:00
Evan Cheng
2c2dcc69d8 Unbreak build.
llvm-svn: 117155
2010-10-22 21:49:09 +00:00
Evan Cheng
20b70697bb Transfer implicit ops when forming load multiple and return instructions.
llvm-svn: 117151
2010-10-22 21:29:58 +00:00
Jakob Stoklund Olesen
de1439ce2b Be more strict when detecting critical edges before loop splitting.
An exit block with a critical edge must only have predecessors in the loop, or
just before the loop. This guarantees that the inserted copies in the loop
predecessors dominate the exit block.

llvm-svn: 117144
2010-10-22 20:28:23 +00:00
Jakob Stoklund Olesen
967bcbf445 Add print methods
llvm-svn: 117143
2010-10-22 20:28:21 +00:00
Michael J. Spencer
08602f9803 X86: Base _fltused on the FunctionType of the called value instead of the potentially null "CalledFunction". Thanks Duncan!
This is needed for indirect calls.

llvm-svn: 117061
2010-10-21 20:49:23 +00:00
Jakob Stoklund Olesen
4794d28044 Don't include the destination interval in the union when computing
Parent - union(Y, ...). Doh.

llvm-svn: 117042
2010-10-21 18:47:08 +00:00
Jakob Stoklund Olesen
82da267156 Permit landing pad successor blocks when verifying basic blocks that end in an
unconditional branch.

llvm-svn: 117041
2010-10-21 18:47:06 +00:00
Duncan Sands
c40461600a The variable liTRC is not used for anything useful, zap it
(gcc-4.6 warning).

llvm-svn: 117022
2010-10-21 16:04:43 +00:00
Duncan Sands
0c166168a0 Remove some variables that are never really used
(gcc-4.6 warns about these).

llvm-svn: 117021
2010-10-21 16:03:28 +00:00
Michael J. Spencer
b9cffadc06 CodeGen-Windows: Only emit _fltused if a VarArg function is called with floating point args.
This should be the minimum set of functions that could possibly need it.

llvm-svn: 116978
2010-10-21 00:08:21 +00:00
Jakob Stoklund Olesen
03fd8bf61c Remember to keep track of rematted values.
llvm-svn: 116962
2010-10-20 22:50:42 +00:00
Evan Cheng
9a06e4c7c8 More accurate estimate / tracking of register pressure.
- Initial register pressure in the loop should be all the live defs into the
  loop. Not just those from loop preheader which is often empty.
- When an instruction is hoisted, update register pressure from loop preheader
  to the original BB.
- Treat only use of a virtual register as kill since the code is still SSA.

llvm-svn: 116956
2010-10-20 22:03:58 +00:00
Jakob Stoklund Olesen
9121d7b293 Move some of the InlineSpiller rematerialization code into LiveRangeEdit.
llvm-svn: 116951
2010-10-20 22:00:51 +00:00
Dale Johannesen
58fe3193a6 Remove Synthesizable from the Type system; as MMX vector
types are no longer Legal on X86, we don't need it.
No functional change.  8499854.

llvm-svn: 116947
2010-10-20 21:32:10 +00:00
Jakob Stoklund Olesen
c04876b607 When SimpleRegisterCoalescing is trimming kill flags on a physical register
operand, also check if subregisters are killed.

Add <imp-def> operands for subregisters that remain alive after a super register
is killed.

I don't have a testcase for this that reproduces on trunk. <rdar://problem/8441758>

llvm-svn: 116940
2010-10-20 18:45:55 +00:00
Dan Gohman
c781a28a1d Make CodeGen TBAA-aware.
llvm-svn: 116890
2010-10-20 00:31:05 +00:00
Jim Grosbach
a8c0be5343 Add a pre-dispatch SjLj EH hook on the unwind edge for targets to do any
setup they require. Use this for ARM/Darwin to rematerialize the base
pointer from the frame pointer when required. rdar://8564268

llvm-svn: 116879
2010-10-19 23:27:08 +00:00
Jakob Stoklund Olesen
02d7f65c49 Shrink MachineOperand from 40 to 32 bytes on 64-bit hosts.
Pull an unsigned out of the Contents union such that it has the same size as two
pointers and no padding.

Arrange members such that the Contents union and all pointers can be 8-byte
aligned without padding.

This speeds up code generation by 0.8% on a 64-bit host. 32-bit hosts should be
unaffected.

llvm-svn: 116857
2010-10-19 20:56:32 +00:00
Evan Cheng
1c8dafd12a Re-enable register pressure aware machine licm with fixes. Hoist() may have
erased the instruction during LICM so UpdateRegPressureAfter() should not
reference it afterwards.

llvm-svn: 116845
2010-10-19 18:58:51 +00:00
Owen Anderson
46990c17f7 Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
registration/creation, please send the testcase to me directly.

llvm-svn: 116820
2010-10-19 17:21:58 +00:00
Daniel Dunbar
6ff550c84d Revert r116781 "- Add a hook for target to determine whether an instruction def
is", which breaks some nightly tests.

llvm-svn: 116816
2010-10-19 17:14:24 +00:00
NAKAMURA Takumi
4a85646d6c lib/CodeGen/TargetLoweringObjectFileImpl.cpp: Tweak to emit ".{section}${name}" instead of ".{section}$linkonce_{name}" for linkonce sections.
It seems GNU ld/PECOFF relies on section names, linking with g++'s libstdc++.a would fail.

llvm-svn: 116791
2010-10-19 03:24:42 +00:00
Andrew Trick
3df2830391 Fix for machine licm assert: RCCost <= RegPressure[RCId]
in MultiSource/Benchmarks/VersaBench/beamformer/beamformer.
SmallSet.insert returns true if the element is inserted.

llvm-svn: 116790
2010-10-19 02:50:50 +00:00
Evan Cheng
9c3f6f486e - Add a hook for target to determine whether an instruction def is
"long latency" enough to hoist even if it may increase spilling. Reloading
  a value from spill slot is often cheaper than performing an expensive
  computation in the loop. For X86, that means machine LICM will hoist
  SQRT, DIV, etc. ARM will be somewhat aggressive with VFP and NEON
  instructions.
- Enable register pressure aware machine LICM by default.

llvm-svn: 116781
2010-10-19 00:55:07 +00:00
Bill Wendling
3b3d9aaa86 Don't recompute MachineRegisterInfo in the Optimize* method.
llvm-svn: 116750
2010-10-18 21:22:31 +00:00
Dan Gohman
df5c887e86 Add TypeBasedAliasAnalysis to the standard pass lists. Note that it
is currently inert by default.

llvm-svn: 116732
2010-10-18 18:50:27 +00:00
Dan Gohman
6aff5b94ff Make BasicAliasAnalysis a normal AliasAnalysis implementation which
does normal initialization and normal chaining. Change the default
AliasAnalysis implementation to NoAlias.

Update StandardCompileOpts.h and friends to explicitly request
BasicAliasAnalysis.

Update tests to explicitly request -basicaa.

llvm-svn: 116720
2010-10-18 18:04:47 +00:00
Jim Grosbach
315bb0cf2b Trivial grammar tweak.
llvm-svn: 116710
2010-10-18 16:29:26 +00:00
Michael J. Spencer
e57b670425 X86-Windows: Emit an undefined global __fltused symbol when targeting Windows
if any floating point arguments are passed to an external function.

llvm-svn: 116665
2010-10-16 08:25:41 +00:00
Michael J. Spencer
16ad2c129c Whitespace!
llvm-svn: 116664
2010-10-16 08:25:21 +00:00