Commit Graph

41168 Commits

Author SHA1 Message Date
Devang Patel
81b79b5fa8 Revert r112623. It is causing self host build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:41:03 +00:00
Owen Anderson
9ba353627a Add an RAII helper to make cleanup of the RecursionSet more fool-proof.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 19:24:27 +00:00
Owen Anderson
869a144f4e Only try to clean up the current block if we changed that block already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112625 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:55:52 +00:00
Jim Grosbach
c1dc78de76 SP relative offsets need to be adjusted by the local allocation size when
determining if they're likely to be in range of the SP when resolving
frame references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112624 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:52:31 +00:00
Devang Patel
8480c2e314 Remember byval argument's frame index during argument lowering and use this info to emit debug info.
Fixes Radar 8367011.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112623 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:50:09 +00:00
Jim Grosbach
d4511e947e this assert should just be a condition, since this function is just asking if
the offset is legally encodable, not actually trying to do the encoding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112622 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:49:31 +00:00
Owen Anderson
c1bdac66ff Refactor my fix for PR5652 to terminate the predecessor lookups after the first failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112620 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 18:48:48 +00:00
Jim Grosbach
864d22ea72 Improve virtual frame base register allocation heuristics.
1. Allocate them in the entry block of the function to enable function-wide
     re-use. The instructions to create them should be re-materializable, so
     there shouldn't be additional cost compared to creating them local
     to the basic blocks where they are used.
  2. Collect all of the frame index references for the function and sort them
     by the local offset referenced. Iterate over the sorted list to
     allocate the virtual base registers. This enables creation of base
     registers optimized for positive-offset access of frame references.
     (Note: This may be appropriate to later be a target hook to do the
     sorting in a target appropriate manner. For now it's done here for
     simplicity.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112609 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:58:19 +00:00
Dan Gohman
f3bba4c1ae Speculatively revert r112433.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112608 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:56:47 +00:00
Benjamin Kramer
19dc7faf25 Allow creation of SHT_NULL sections, from Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112605 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 17:03:33 +00:00
Duncan Sands
22efc18f12 Stop using the dom frontier in DwarfEHPrepare by not promoting alloca's
any more.  I plan to reimplement alloca promotion using SSAUpdater later.
It looks like Bill's URoR logic really always needs domtree, so the pass
now always asks for domtree info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112597 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 09:05:06 +00:00
Nick Lewycky
65a0af3855 Fix an infinite loop; merging two functions will create a new function (if the
two are weak, we make them thunks to a new strong function) so don't iterate
through the function list as we're modifying it.

Also add back the outermost loop which got removed during the cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112595 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 08:29:37 +00:00
Owen Anderson
7c37f6d2d9 Don't perform an extra traversal of the function just to do cleanup. We can safely simplify instructions after each block has been processed without worrying about iterator invalidation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 07:55:56 +00:00
Bill Wendling
da2ae63206 - Cleanup some whitespaces.
- Convert {0,1} and friends into 0b01, which is identical and more consistent.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112593 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 07:50:46 +00:00
Owen Anderson
25e9405272 Rename ValuePropagation to a more descriptive CorrelatedValuePropagation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 07:48:34 +00:00
Owen Anderson
7aff1cd038 Rename file to something more descriptive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112590 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 07:41:39 +00:00
Owen Anderson
cb21190cbd More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly constant-fold undef, and be more careful with its return value.
This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's
handling of and/or of i1's), but never manifested before.  This patch adds a tracking set to prevent this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112589 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 07:36:34 +00:00
Michael J. Spencer
4a295d301d Cleanup Whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:36:46 +00:00
Michael J. Spencer
1211d43abf System: Fix getMagicNumber on windows.
getMagicNumber was treating the _binary_ data it read in as a
null terminated string. This resulted in the std::string
calculating the length, and causing an assert in other code that
assumed that the length it passed was the same as the length of
the string it would get back.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:36:33 +00:00
Devang Patel
34ca5ed797 Offset is not always unsigned number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112584 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:12:08 +00:00
Devang Patel
9e3bd2c476 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112583 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 06:11:28 +00:00
Nick Lewycky
f53de86cba Switch to DenseSet, simplifying much more code. We now have a single iteration
where we hash, compare and fold, instead of one iteration where we build up
the hash buckets and a second one to fold.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112582 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 05:53:05 +00:00
Owen Anderson
c97fb52799 Remove r111665, which implemented store-narrowing in InstCombine. Chris discovered a miscompilation in it, and it's not easily
fixable at the optimizer level. I'll investigate reimplementing it in DAGCombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 04:41:06 +00:00
Bruno Cardoso Lopes
2e46e78c53 zap unused method. x86 is the only user and already has a more powerfull version
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112571 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 02:36:20 +00:00
Bruno Cardoso Lopes
20a07f422d Use X86ISD::MOVSS and MOVSD to represent the movl mask pattern, also fix the handling of those nodes when seeking for scalars inside vector shuffles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112570 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 02:26:40 +00:00
Eric Christopher
dc90804a40 Rewrite slightly so we can expand for floating point types easier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112568 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 01:28:42 +00:00
Jakob Stoklund Olesen
e49e6a852b Add experimental -disable-physical-join command line option.
Eventually, we want to disable physreg coalescing completely, and let the
register allocator do its job using hints.

This option makes it possible to measure the impact of disabling physreg
coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112567 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-31 01:27:49 +00:00
Owen Anderson
49998ce46a Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 23:59:30 +00:00
Eric Christopher
548d1bb97e If we have an unhandled type then assert, we shouldn't get here for
things we can't handle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112559 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 23:48:26 +00:00
Owen Anderson
a081d15b84 Cleanups suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112553 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 23:34:17 +00:00
Owen Anderson
327ca7bec2 Re-apply r112539, being more careful to respect the return values of the constant folding methods. Additionally,
use the ConstantExpr::get*() methods to simplify some constant folding.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112550 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 23:22:36 +00:00
Anton Korobeynikov
6d1e29d2f2 Expand MOVi32imm in ARM mode after regalloc. This provides
scheduling opportunities (extra instruction can go in between
MOVT / MOVW pair removing the stall).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112546 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 22:50:36 +00:00
Owen Anderson
f523b3e087 Add statistics to evaluate this pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 22:45:55 +00:00
Owen Anderson
d930f205db Revert r112539. It accidentally introduced a miscompilation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112543 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 22:33:41 +00:00
Owen Anderson
1e35610f20 Fixes and cleanups pointed out by Chris. In general, be careful to handle 0 results from ComputeValueKnownInPredecessors
(indicating undef), and re-use existing constant folding APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112539 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 22:07:52 +00:00
Bill Wendling
55c134a261 Use the existing T2I_bin_s_irs pattern instead of creating T2I_bin_sw_irs, which
is meant to do exactly the same thing. Thanks to Jim Grosbach for pointing this
out! :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112538 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 22:05:23 +00:00
NAKAMURA Takumi
17f9bfaa83 Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 21:54:03 +00:00
Jakob Stoklund Olesen
2536279674 Remember to clear the shadow kill flag at the same time as clearing the real
kill flag.

This could cause duplicate kill flags when the same register was used twice in a
continuous sequence of STRs.

There is no small test case. <rdar://problem/8218046>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112534 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 21:52:40 +00:00
Dan Gohman
56b092e4cd Add comments explaining why it's not necessary to include the
is-function-local flag in metadata uniquing bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 21:18:41 +00:00
Bob Wilson
973a074345 Remove NEON vmovn intrinsic, replacing it with vector truncate operations.
Auto-upgrade the old intrinsic and update tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112507 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 20:02:30 +00:00
Jim Grosbach
663e339e20 Make ARM add rN, sp, #imm instructions rematerializable. That's how the address of locals is calculated, so this should
help relieve register pressure a bit. Recalculating the local address is
almost always going to be better than spilling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 19:49:58 +00:00
Chris Lattner
1875ce4ad9 two changes:
1) nuke ConstDataCoalSection, which is dead.
2) revise my previous patch for rdar://8018335,
  which was completely wrong.  Specifically, it doesn't 
  make sense to mark __TEXT,__const_coal as PURE_INSTRUCTIONS,
  because it is for readonly data.  templates (it turns out)
  go to const_coal_nt.  The real fix for rdar://8018335 was
  to give ConstTextCoalSection a section kind of ReadOnly 
  instead of Text.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112496 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 18:12:35 +00:00
Bob Wilson
7e701979ad When expanding NEON VST pseudo instructions, if the original super-register
operand is killed, add it to the expanded instruction as an implicit kill
operand instead of marking the individual subregs with kill flags.  This
should work better in general and also handles the case for VST3 where one
of the subregs was not referenced in the expanded instruction and so was
not marked killed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112494 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 18:10:48 +00:00
Benjamin Kramer
6cc53be24c MCELF: The value of all common symbols is the offset from the start of the section. Patch by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112492 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 17:20:17 +00:00
Owen Anderson
392953262e It is possible to try to merge a not-constant with a constantrage, when dealing with ptrtoint ConstantExpr's.
Unfortunately, the only testcase I have for this is huge and doesn't reduce well because the error is
sensitive to iteration-order issues, since the problem only occurs when merging values in a particular order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 17:03:45 +00:00
Benjamin Kramer
033927408e Don't print two "0x" prefixes. Use a raw_ostream overload instead of llvm::format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112479 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 14:46:53 +00:00
NAKAMURA Takumi
37ce5650e6 EE/JIT: Do not invoke parent's ctors/dtors from main()! (PR3897)
On Mingw and Cygwin, the symbol __main is resolved to
callee's(eg. tools/lli) one, to invoke wrong duplicated ctors
(and register wrong callee's dtors with atexit(3)).
We expect, by callee, ExecutionEngine::runStaticConstructorsDestructors()
is called before ExecutionEngine::runFunctionAsMain() is called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112474 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 14:00:29 +00:00
Benjamin Kramer
51799ddc7c The value is offset from the start of the section for non-common symbols, submitted by Jordan Gordeev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 12:00:16 +00:00
Benjamin Kramer
679d236117 Index external symbols by symbol table instead of parent section, by Roman Divacky.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112472 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 11:59:29 +00:00
Benjamin Kramer
82a3171b72 Mark all common symbols external. This is not exactly correct but it lets apps
link for now and can be adjusted later. Patch by Roman Divacky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112471 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-30 11:56:55 +00:00