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

9895 Commits

Author SHA1 Message Date
Dan Gohman
cdaa08e706 Re-apply r80926, with fixes: keep the domtree informed of new blocks
that get created during loop unswitching, and fix SplitBlockPredecessors'
LCSSA updating code to create new PHIs instead of trying to just move
existing ones.

Also, optimize Loop::verifyLoop, since it gets called a lot. Use
searches on a sorted list of blocks instead of calling the "contains"
function, as is done in other places in the Loop class, since "contains"
does a linear search. Also, don't call verifyLoop from LoopSimplify or
LCSSA, as the PassManager is already calling verifyLoop as part of
LoopInfo's verifyAnalysis.

llvm-svn: 81221
2009-09-08 15:45:00 +00:00
Chris Lattner
b3778be4fa fix pasto
llvm-svn: 81184
2009-09-08 03:39:55 +00:00
Chris Lattner
042b1f3367 add getVectorOperand/getIndexOperand accessors to ExtractElementInst.
Fix some const correctness problems in SelectInst.

llvm-svn: 81183
2009-09-08 03:32:53 +00:00
Chris Lattner
fb09f6e5ea fix PR4915, a crash in -debug mode.
llvm-svn: 81177
2009-09-08 01:22:54 +00:00
Chris Lattner
1247f36e13 add some comments to describe the invariants.
llvm-svn: 81173
2009-09-08 00:06:16 +00:00
Dan Gohman
1147a7ba87 Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
llvm-svn: 81172
2009-09-07 23:54:19 +00:00
Duncan Sands
9987d81255 Change "const static" to "static const", as warned about
by icc (#82).  Patch by Erick Tryzelaar.

llvm-svn: 81117
2009-09-06 13:10:36 +00:00
Duncan Sands
0d5fa5f018 Mark more constants unsigned, as warned about by icc (#68).
Patch by Erick Tryzelaar.

llvm-svn: 81116
2009-09-06 12:56:52 +00:00
Duncan Sands
8c36c0f009 Mark constants as unsigned, as pointed out by icc
warnings (#174).  Patch by Erick Tryzelaar.

llvm-svn: 81111
2009-09-06 11:45:14 +00:00
Duncan Sands
4b92376ba8 Tweak code into an equivalent form for which icc
doesn't warn about unreachable instructions.  Patch
by Erick Tryzelaar (#111).

llvm-svn: 81110
2009-09-06 10:53:22 +00:00
Duncan Sands
750b1f5de2 Public and private corrections, warned about by icc (#304).
Patch by Erick Tryzelaar.

llvm-svn: 81107
2009-09-06 08:55:57 +00:00
Duncan Sands
f4d7fcb5a0 Remove unneeded declaration, as warned about by
icc (#1170).  Patch by Erick Tryzelaar.

llvm-svn: 81104
2009-09-06 07:23:28 +00:00
Evan Cheng
a191202da5 Revert r80926. It causes loop unswitch assertion and slow down some JIT tests significantly.
llvm-svn: 81101
2009-09-06 02:26:10 +00:00
Daniel Dunbar
452643b58c Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

llvm-svn: 81098
2009-09-06 00:11:24 +00:00
Benjamin Kramer
8e70ffa886 Delete unused #include.
llvm-svn: 81076
2009-09-05 08:50:14 +00:00
Bob Wilson
013dfaa93a Stabilize the order of live intervals in the priority_queue used by the
linear scan reg alloc.  This fixes a problem I ran into where extracting
a function from a larger file caused the generated code to change (masking
the problem I was trying to debug) because the allocator behaved differently.

This changes the results for two X86 regression checks.  stack-color-with-reg
is improved, with one less instruction, but pr3495 is worse, with one more
copy.  As far as I can tell, these tests were just getting lucky or unlucky,
so I've changed the expected results.

llvm-svn: 81060
2009-09-05 01:19:16 +00:00
Benjamin Kramer
f5c5c341d1 Prune #includes.
llvm-svn: 81052
2009-09-04 22:45:23 +00:00
Benjamin Kramer
dde42c936d Remove an unneeded call to c_str().
llvm-svn: 81051
2009-09-04 22:44:03 +00:00
Kevin Enderby
8aeb8c1f8c Added AsmToken enum constants to MCAsmLexer.h for '[', ']', '{', and '}' in
preparation of supporting other targets. Then changed the lexer to parse these
as tokens.

llvm-svn: 81050
2009-09-04 22:40:31 +00:00
Kevin Enderby
f697ad5e30 Added the AsmToken::Hash enum constant to MCAsmLexer.h in preparation of
supporting other targets.  Changed the code to pass MCAsmInfo to the parser
and the lexer.  Then changed the lexer to use CommentString from MCAsmInfo
instead of a literal '#' character.

llvm-svn: 81046
2009-09-04 21:45:34 +00:00
Lang Hames
82f4d9b9fc Removed yet another std::ostream reference.
llvm-svn: 81042
2009-09-04 21:03:07 +00:00
Lang Hames
011d0c0755 Removed some junk and a std::ostream operator that was hanging around.
llvm-svn: 81041
2009-09-04 20:54:51 +00:00
Lang Hames
e504e61ab5 Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
a new class, MachineInstrIndex, which hides arithmetic details from
most clients. This is a step towards allowing the register allocator
to update/insert code during allocation.

llvm-svn: 81040
2009-09-04 20:41:11 +00:00
Dan Gohman
8b386a0b63 Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects
with the same operation and different flags.

Even though a ConstantExpr "a + b" is either always overflowing or
never overflowing (due to being a ConstantExpr), it's still necessary
to be able to represent it both with and without overflow flags at
the same time within the IR, because the safety of the flag may
depend on the context of the use. If the constant really does overflow,
it wouldn't ever be safe to use with the flag set, however the use
may be in code that is never actually executed.

This also makes it possible to merge all the flags tests into a single test.

llvm-svn: 80998
2009-09-04 12:08:11 +00:00
Dan Gohman
b9b2864a49 Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.

llvm-svn: 80969
2009-09-03 23:34:49 +00:00
Dan Gohman
c24fb1af4f LLVM currently represents floating-point negation as -0.0 - x. Fix
FastISel to recognize this pattern and emit a floating-point
negation using xor.

llvm-svn: 80963
2009-09-03 22:53:57 +00:00
Dan Gohman
e5ec3c1a26 Remove the API for creating ConstantExprs with the nsw, nuw, inbounds,
and exact flags. Because ConstantExprs are uniqued, creating an
expression with this flag causes all expressions with the same operands
to have the same flag, which may not be safe. Add, sub, mul, and sdiv
ConstantExprs are usually folded anyway, so the main interesting flag
here is inbounds, and the constant folder already knows how to set the
inbounds flag automatically in most cases, so there isn't an urgent need
for the API support.

This can be reconsidered in the future, but for now just removing these
API bits eliminates a source of potential trouble with little downside.

llvm-svn: 80959
2009-09-03 22:17:40 +00:00
Ted Kremenek
e4f2f7f6b2 Make ImmutableMap/ImmutableSet quicker by only canonicalizing the tree after an
Add or Remove operation complete, and not while building the intermediate tree.
This trades a little bit more memory usage for less accesses to the FoldingSet.  On a benchmark for the clang static analyzer, this shaves off another 13% of execution time when using field/array sensitivity.

llvm-svn: 80955
2009-09-03 22:07:30 +00:00
Dan Gohman
69e9573064 Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary.

llvm-svn: 80940
2009-09-03 20:34:31 +00:00
Kevin Enderby
5f29771ea2 Removed the non-target independent AsmToken::Register enum constant
from MCAsmLexer.h in preparation of supporting other targets.  Changed the
X86AsmParser code to reflect this by removing AsmLexer::LexPercent and looking
for AsmToken::Percent when parsing in places that used AsmToken::Register.
Then changed X86ATTAsmParser::ParseRegister to parse out registers as an
AsmToken::Percent followed by an AsmToken::Identifier.

llvm-svn: 80929
2009-09-03 17:15:07 +00:00
Dan Gohman
7296225414 Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verify
that these passes are properly preserved.

Fix several transformation passes that claimed to preserve LoopSimplify
form but weren't.

llvm-svn: 80926
2009-09-03 16:31:42 +00:00
Dan Gohman
382f174be1 Move getUniqueExitBlocks from LoopBase to Loop, since they depend on
LoopSimplify form, which is currently only available on Loops (and
not MachineLoops). Also, move the code out of the header file.

llvm-svn: 80923
2009-09-03 16:10:48 +00:00
Dan Gohman
66c853f17f Change PHINode::hasConstantValue to have a DominatorTree argument
instead of a bool argument, and to do the dominator check itself.
This makes it eaiser to use when DominatorTree information is
available.

llvm-svn: 80920
2009-09-03 15:34:35 +00:00
Dan Gohman
d32bdb4c58 Remove references to expression "handles", which are no longer used.
llvm-svn: 80918
2009-09-03 15:00:26 +00:00
Chris Lattner
52f982c2f9 improve comments.
llvm-svn: 80897
2009-09-03 06:00:00 +00:00
Chris Lattner
d4f19950e3 Thread an MCAsmInfo pointer through the various MC printing APIs,
and fix a few things using << on MCSymbols to use ->print(). No
functionality change other than unbreaking my previous patch.

llvm-svn: 80890
2009-09-03 05:46:51 +00:00
Ted Kremenek
6d0baa578a Set the 'cached digest' flag after computing the digest for an
ImutAVLTree.  This was accidentally left out, and essentially caused
digest caching to be ignored in ImmutableMap and ImmutableSet (this
bug was detected from shark traces that showed ComputeDigest was in
the hot path in the clang static analyzer).

This reduces the running time of the clang static analyzer on an
example benchmark by ~32% for both RegionStore (field-sensitivty) and
BasicStore (without field-sensitivity).

llvm-svn: 80877
2009-09-03 04:21:34 +00:00
Lang Hames
3c7f6b706c Fixed a test that ensures the LocalRewriter does not attempt to
avoid reloads by reusing clobbered registers.

This was causing issues in 256.bzip2 when compiled with PIC for
a while (starting at r78217), though the problem has since been masked. 

llvm-svn: 80872
2009-09-03 02:52:02 +00:00
Gabor Greif
4604e0739b back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
llvm-svn: 80871
2009-09-03 02:02:59 +00:00
Devang Patel
27616c3c80 Now Bitcode reader bug is fixed. Reapply 80839.
Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80868
2009-09-03 01:39:20 +00:00
Gabor Greif
68c4f27e59 re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
llvm-svn: 80858
2009-09-03 00:18:58 +00:00
Devang Patel
317ab82083 Revert 80839 for now. It causes test failures.
llvm-svn: 80841
2009-09-02 21:49:26 +00:00
Devang Patel
c4be6559c4 Use CallbackVH, instead of WeakVH, to hold MDNode elements.
Use FoldingSetNode to unique MDNodes in a context.
Use CallbackVH hooks to update context's MDNodeSet appropriately.

llvm-svn: 80839
2009-09-02 21:22:09 +00:00
Dan Gohman
55db099330 Add a comment noting the memory ownership rules.
llvm-svn: 80827
2009-09-02 19:21:56 +00:00
Dan Gohman
1efdd727b3 Add convenience functions for reading in LLVM IR that autodetect
and LLVM Assembly and LLVM Bitcode and automatically call the
corresponding reader.

llvm-svn: 80809
2009-09-02 17:54:06 +00:00
Dan Gohman
6166bac383 Add const qualifiers for isBitcodeWrapper, and add new functions
isRawBitcode and isBitcode to allow clients to test whether a given
memory buffer holds a bitcode image.

llvm-svn: 80804
2009-09-02 17:21:29 +00:00
Dan Gohman
3f7a370991 Refactor common code from ParseAssemblyString and ParseAssemblyFile,
to expose a low-level interface for parsing from an existing MemoryBuffer.

llvm-svn: 80803
2009-09-02 17:18:19 +00:00
Dan Gohman
58b376193d Add const qualifiers to dominates' arguments.
llvm-svn: 80801
2009-09-02 17:05:05 +00:00
Sandeep Patel
9c4e094e2a Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
llvm-svn: 80773
2009-09-02 08:44:58 +00:00
Dan Gohman
076277763d Add a comment.
llvm-svn: 80749
2009-09-02 01:14:16 +00:00