Commit Graph

10033 Commits

Author SHA1 Message Date
Nate Begeman
e6798372ea Add an "original alignment" field to load and store nodes. This enables the
DAG Combiner to disambiguate chains for loads and stores of types which are
 broken up by the Legalizer into smaller pieces.  


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 00:13:12 +00:00
Evan Cheng
752195e3c6 Add early coalescing to liveintervals. This is work in progress and is known to miscompute some tests. Read it at your own rish, I have aged 10 year while writing this.
The gist of this is if source of some of the copies that feed into a phi join is defined by the phi join, we'd like to eliminate them. However, if any of the non-identity source overlaps the live interval of the phi join then the coalescer won't be able to coalesce them. The early coalescer's job is to eliminate the identity copies by partially-coalescing the two live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 21:33:42 +00:00
Dan Gohman
c43fd5a68f Update a comment to match the source. PseudoSourceValues are now
obtained via accessor functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 20:40:10 +00:00
Chris Lattner
662316c997 PIC16 does allow colon after MBB labels, simplify EmitBasicBlockStart.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81755 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 03:15:54 +00:00
Chris Lattner
90edac0e8b Change MCAsmStreamer to take an MCInstPrinter instead of a
full AsmPrinter, and change TargetRegistry to keep track
of registered MCInstPrinters.

llvm-mc is still linking in the entire
target foo to get the code emitter stuff, but this is an
important step in the right direction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81754 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 03:02:37 +00:00
Chris Lattner
c493fb2f4d Give MCInstPrinter a MCAsmInfo member, make X86ATTInstPrinter
be a MCInstPrinter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:49:26 +00:00
Chris Lattner
65b0b297db add a new MCInstPrinter class, move the (trivial) MCDisassmbler ctor inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81745 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-14 01:43:38 +00:00
Chris Lattner
e7f3107772 eliminate the TargetRegisterDesc::AsmName field, the asmprinters now have this table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81728 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 22:45:04 +00:00
Chris Lattner
762ccea600 remove all but one reference to TargetRegisterDesc::AsmName.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81714 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 20:31:40 +00:00
Chris Lattner
56d339f687 second part to r81695, I missed a directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 19:03:08 +00:00
Chris Lattner
70a54c07a0 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-13 18:25:37 +00:00
Chris Lattner
7cb384dcca devirtualize AsmPrinter::printBasicBlockLabel since it is never overridden.
Move GetMBBSymbol up to AsmPrinter and make printBasicBlockLabel use it so that
we only have one place that decides what to name bb labels.  Hopefully various
clients of printBasicBlockLabel can start using GetMBBSymbol instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 23:02:08 +00:00
Chris Lattner
b6a2fc080f eliminate the "MBBLabel" MCOperand type, and just use a MCSymbol for
MBB labels like everything else.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 20:45:03 +00:00
Lang Hames
4a39ba9926 Whoops. Committed the headers for r81605 - 'Moved some more index operations over to LiveIntervals.'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81609 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-12 04:54:18 +00:00
Dan Gohman
ec080467f5 Fix llvm-extract's "writing bitcode to a terminal" warning, which wasn't
working. To support this, add an is_displayed() function to raw_ostream,
and generalize Process::StandardOutIsDisplayed and friends in order to
support it.

Also, call RemoveFileOnSignal before creating a file instead of after, so
that the file isn't left behind if the program is interrupted between when
the file is created and RemoveFileOnSignal is called.

While here, add a -S to llvm-extract and port it to IRReader so that it
supports assembly input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81568 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 20:46:33 +00:00
Chris Lattner
724f675144 give densemap iterators real iterator traits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 18:15:46 +00:00
Chris Lattner
892e44a07c default construct MCInst's ctor to 0, which is "PHI" which is invalid for MCInsts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 16:33:58 +00:00
Chris Lattner
5b7dfeebff add a new Mangler::getNameWithPrefix API which returns the
(uniqued if unnamed) global variable name with the prefix that
it is supposed to get.  It doesn't do "mangling" in the sense of
adding quotes and hacking on bad characters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 05:40:42 +00:00
Dan Gohman
e6992f728a Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 23:37:55 +00:00
Dan Gohman
83e3c4f9d7 Give these files top-level comments that describe the current code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 23:07:18 +00:00
Kevin Enderby
9c656450d6 Added the ParseInstruction() hook for target specific assembler directives so
that things like .word can be parsed as target specific.  Moved parsing .word
out of AsmParser.cpp into X86AsmParser.cpp as it is 2 bytes on X86 and 4 bytes
for other targets that support the .word directive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 20:51:44 +00:00
Mikhail Glushenkov
2d04ec5fe6 Distinguish between 'empty' and empty DAG marker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 16:22:02 +00:00
Mikhail Glushenkov
684a8b0f10 Add a logical 'not' operator to llvmc's TableGen dialect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 16:21:38 +00:00
Nick Lewycky
fd5249e15b Correctly handle the case where a comparison is created in one BasicBlock and
used by a terminator in another.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 07:02:09 +00:00
Evan Cheng
fabcb9127f Add malloc call utility functions. Patch by Victor Hernandez.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 04:36:43 +00:00
Daniel Dunbar
b8b70521de MC: Give target specific parsers access to the MCStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-10 00:59:15 +00:00
Chris Lattner
c5ea263a23 remove DebugLoc from MCInst and eliminate "Comment printing" from
the MCInst path of the asmprinter.  Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter.  This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.

This also fixes an xcore strangeness where it inserted two tabs
before every instruction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 23:14:36 +00:00
Sean Callanan
251ef612a8 Added an abstract superclass, MCDisassembler, for
all disassemblers.

Modified the MemoryObject to support 64-bit address
spaces, regardless of the LLVM process's address
width.

Modified the Target class to allow extraction of a
MCDisassembler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 22:49:13 +00:00
Chris Lattner
65c060064d add a gross hack to get "SrcLine" comments to show up with the
new asmprinter.  Differently gross hack coming next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 20:45:42 +00:00
Lang Hames
9647994e09 Removed static qualifier from a few index related methods. These methods may require a LiveIntervals instance in future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 20:14:17 +00:00
Andreas Neustifter
07abe17bd2 Add the first functions for updating ProfileInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 17:52:57 +00:00
Chris Lattner
273a488cdf revert r81335, which breaks the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 16:00:57 +00:00
Andreas Neustifter
1f3b00272a Updated ProfileInfo to have clean seperation between different sentinels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81335 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 12:48:26 +00:00
Mikhail Glushenkov
581af5f10a Copy-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81331 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 10:14:55 +00:00
Mikhail Glushenkov
4f51d99ca5 Revert 81248 for now.
Program objects have ownership semantics on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 09:52:04 +00:00
Jeffrey Yasskin
4a38930a45 Make TypeBuilder's result depend on the LLVMContext it's passed.
TypeBuilder was using a local static variable to cache its result. This made it
ignore changes in its LLVMContext argument and always return a type constructed
from the argument to the first call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81316 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 05:04:01 +00:00
Daniel Dunbar
baf9b56230 Add Triple::getArchTypeForDarwinArchName, which converts a "Darwin" architecture
name (e.g. "ppc") to the appropriate constant.

Also, StringRefize additional Triple constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 23:32:51 +00:00
Dan Gohman
f316579901 Use MemoryBuffer::getBufferIdentifier() in the AsmPrinter instead
of requiring a name be passed in. This makes it use "<stdin>"
instead of "-" and makes it more consistent with the Bitcode reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 22:20:35 +00:00
Mikhail Glushenkov
c22675b542 Const-correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 19:51:39 +00:00
Mikhail Glushenkov
40e9b8e670 Since Program is basically a PID, it should be copyable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 19:51:12 +00:00
Mikhail Glushenkov
edf8e48c21 Get rid of the Pid_ member in the Program class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 19:50:55 +00:00
Mikhail Glushenkov
a607202a68 Add a Kill() function to the Program class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 19:50:27 +00:00
Dan Gohman
5c89b5240c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 15:45:00 +00:00
Chris Lattner
c8dee3f7ad fix pasto
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 03:39:55 +00:00
Chris Lattner
9715912978 add getVectorOperand/getIndexOperand accessors to ExtractElementInst.
Fix some const correctness problems in SelectInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 03:32:53 +00:00
Chris Lattner
45336a6f22 fix PR4915, a crash in -debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81177 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 01:22:54 +00:00
Chris Lattner
cf5128ec01 add some comments to describe the invariants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81173 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 00:06:16 +00:00
Dan Gohman
f8dbee7cea Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 23:54:19 +00:00
Duncan Sands
05866f7963 Change "const static" to "static const", as warned about
by icc (#82).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 13:10:36 +00:00
Duncan Sands
18f13c66bf Mark more constants unsigned, as warned about by icc (#68).
Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81116 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 12:56:52 +00:00
Duncan Sands
8ecbe8d974 Mark constants as unsigned, as pointed out by icc
warnings (#174).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81111 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 11:45:14 +00:00
Duncan Sands
740eb5323e Tweak code into an equivalent form for which icc
doesn't warn about unreachable instructions.  Patch
by Erick Tryzelaar (#111).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81110 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 10:53:22 +00:00
Duncan Sands
59bf4fcc06 Public and private corrections, warned about by icc (#304).
Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81107 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 08:55:57 +00:00
Duncan Sands
34d0194583 Remove unneeded declaration, as warned about by
icc (#1170).  Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81104 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 07:23:28 +00:00
Evan Cheng
8f78a58e14 Revert r80926. It causes loop unswitch assertion and slow down some JIT tests significantly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81101 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 02:26:10 +00:00
Daniel Dunbar
92a97a9166 Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 00:11:24 +00:00
Benjamin Kramer
ee3d6fd219 Delete unused #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81076 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05 08:50:14 +00:00
Bob Wilson
da4ae4be5b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-05 01:19:16 +00:00
Benjamin Kramer
be5cded586 Prune #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81052 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 22:45:23 +00:00
Benjamin Kramer
5026274ba8 Remove an unneeded call to c_str().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81051 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 22:44:03 +00:00
Kevin Enderby
fb0f0dedd7 Added AsmToken enum constants to MCAsmLexer.h for '[', ']', '{', and '}' in
preparation of supporting other targets. Then changed the lexer to parse these
as tokens.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 22:40:31 +00:00
Kevin Enderby
9823ca971d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81046 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 21:45:34 +00:00
Lang Hames
4d44081c8c Removed yet another std::ostream reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 21:03:07 +00:00
Lang Hames
a85d2bb86b Removed some junk and a std::ostream operator that was hanging around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 20:54:51 +00:00
Lang Hames
8651125d28 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81040 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 20:41:11 +00:00
Dan Gohman
859fff476d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 12:08:11 +00:00
Dan Gohman
6e7ad95868 Revert 80959. It isn't sufficient to solve the full problem. And it
introduced regressions in the Ocaml bindings tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 23:34:49 +00:00
Dan Gohman
3d45a853db LLVM currently represents floating-point negation as -0.0 - x. Fix
FastISel to recognize this pattern and emit a floating-point
negation using xor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:53:57 +00:00
Dan Gohman
e56a94ef91 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:17:40 +00:00
Ted Kremenek
8b8a7fcf68 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80955 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 22:07:30 +00:00
Dan Gohman
8d44b28bc6 Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 20:34:31 +00:00
Kevin Enderby
7b4608dfa0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 17:15:07 +00:00
Dan Gohman
8fc5ad3369 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80926 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 16:31:42 +00:00
Dan Gohman
f0608d829a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 16:10:48 +00:00
Dan Gohman
bccfc24c4e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:34:35 +00:00
Dan Gohman
e7125f4bab Remove references to expression "handles", which are no longer used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80918 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 15:00:26 +00:00
Chris Lattner
36bf49c6b7 improve comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 06:00:00 +00:00
Chris Lattner
684c593d05 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80890 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 05:46:51 +00:00
Ted Kremenek
9bd2acb3b2 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 04:21:34 +00:00
Lang Hames
3f2f3f5341 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. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 02:52:02 +00:00
Gabor Greif
03a5f139fb back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 02:02:59 +00:00
Devang Patel
5f4ac848d9 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80868 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 01:39:20 +00:00
Gabor Greif
190390b8d3 re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-03 00:18:58 +00:00
Devang Patel
8fc5576413 Revert 80839 for now. It causes test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80841 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 21:49:26 +00:00
Devang Patel
d9489cbb0c 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 21:22:09 +00:00
Dan Gohman
5c4e17c5ec Add a comment noting the memory ownership rules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 19:21:56 +00:00
Dan Gohman
87750fcfc8 Add convenience functions for reading in LLVM IR that autodetect
and LLVM Assembly and LLVM Bitcode and automatically call the
corresponding reader.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:54:06 +00:00
Dan Gohman
c2ac2d5347 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80804 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:21:29 +00:00
Dan Gohman
2ec5fe524c Refactor common code from ParseAssemblyString and ParseAssemblyFile,
to expose a low-level interface for parsing from an existing MemoryBuffer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:18:19 +00:00
Dan Gohman
3445d9a72a Add const qualifiers to dominates' arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80801 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 17:05:05 +00:00
Sandeep Patel
65c3c8f323 Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80773 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 08:44:58 +00:00
Dan Gohman
dc404a23ca Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-02 01:14:16 +00:00
Daniel Dunbar
31e2c7b4c1 Remove Offset from ExternalSybmol MachineOperands, this is unused (and at least partly unsupported, in X86 encoding at least).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 22:06:46 +00:00
Andreas Neustifter
da5ea94554 OptimalEdgeProfiling: Reading in Profiles.
This enables LLVM to read the OptimalEdgeProfiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:08:51 +00:00
Andreas Neustifter
ad09d42e04 Addedum to r80712, forgot to add files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80713 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:05:58 +00:00
Andreas Neustifter
f771dae69a OptimalEdgeProfiling: Creation of profiles.
This adds the instrumentation and runtime part of OptimalEdgeProfiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80712 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 19:03:44 +00:00
Chris Lattner
da230cb876 remove CallGraphNode::replaceCallSite, it is redundant with other APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:52:39 +00:00
Dan Gohman
7ab42aec42 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 18:29:01 +00:00
Andreas Neustifter
e885af9fb7 Preparation for Optimal Edge Profiling:
Optimal edge profiling is only possible when blocks with no predecessors get an
virtual edge (BB,0) that counts the execution frequencies of this
function-exiting blocks.
This patch makes the necessary changes before actually enabling optimal edge profiling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 10:06:05 +00:00
Andreas Neustifter
e7ddcfdebe Preparation for Optimal Edge Profiling:
This adds a pass to verify the current profile against the flow conditions.
This is very helpful when later on trying to perserve the profiling information
during all passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-01 08:48:42 +00:00