Commit Graph

10236 Commits

Author SHA1 Message Date
Jim Grosbach 7dbc2652b9 remove trailing whitespace
llvm-svn: 83213
2009-10-01 20:45:06 +00:00
Dan Gohman 8cf7907ba4 Don't use identifiers that start with an underscore followed
by a capital letter, which invokes undefined behavior.

llvm-svn: 83206
2009-10-01 17:39:52 +00:00
Douglas Gregor f99626ed11 Teach CMake to look for bidirectional_iterator, iterator, forward_iterator, uint64_t, and u_int64_t, from Yonggang Luo
llvm-svn: 83203
2009-10-01 17:25:36 +00:00
Evan Cheng 46668e09be Add instruction flags: hasExtraSrcRegAllocReq and hasExtraDefRegAllocReq. When
set, these flags indicate the instructions source / def operands have special
register allocation requirement that are not captured in their register classes.
Post-allocation passes (e.g. post-alloc scheduler) should not change their
allocations. e.g. ARM::LDRD require the two definitions to be allocated
even / odd register pair.

llvm-svn: 83196
2009-10-01 08:21:18 +00:00
Chris Lattner 5f3cc06cd2 remove the GVNPRE pass. It has been subsumed by the GVN pass.
Ok'd by Owen.

llvm-svn: 83193
2009-10-01 02:18:36 +00:00
Devang Patel 34986f12e6 Add another MDNode into DebugLocTuple. This will be used to keep track of inlined functions.
llvm-svn: 83190
2009-10-01 01:15:28 +00:00
Devang Patel 4dbca6dfd4 If location info is attached with an instruction then keep track of alloca slots used by a variable. This info will be used by AsmPrinter to emit debug info for variables.
llvm-svn: 83189
2009-10-01 01:03:26 +00:00
Devang Patel e0709cfc92 Use MachineInstr as an processDebugLoc() argument.
This will allow processDebugLoc() to handle scopes for DWARF debug info. 

llvm-svn: 83183
2009-09-30 23:12:50 +00:00
Devang Patel 3256c751f5 Use MDNode * directly as an RecordSourceLine() argument.
llvm-svn: 83182
2009-09-30 22:51:28 +00:00
Devang Patel 5c13c2d392 Remove dead code.
llvm-svn: 83181
2009-09-30 22:43:52 +00:00
Devang Patel a49be76f43 Add isFOO() helpers. Fix getDirectory() and getFilename() for DIScope.
llvm-svn: 83180
2009-09-30 22:34:41 +00:00
Bob Wilson b2120755a2 Use OutStreamer.SwitchSection instead of writing out textual section directives.
Add a new TargetLoweringObjectFileMachO::getConstTextCoalSection method to
get access to that section.

llvm-svn: 83178
2009-09-30 22:25:37 +00:00
Bob Wilson b633d7a665 Add a new virtual EmitStartOfAsmFile method to the AsmPrinter and use this
to emit target-specific things at the beginning of the asm output.  This
fixes a problem for PPC, where the text sections are not being kept together
as expected.  The base class doInitialization code calls DW->BeginModule()
which emits a bunch of DWARF section directives.  The PPC doInitialization
code then emits all the TEXT section directives, with the intention that they
will be kept together. But as I understand it, the Darwin assembler treats
the default TEXT section as a special case and moves it to the beginning of
the file, which means that all those DWARF sections are in the middle of
the text.  With this change, the EmitStartOfAsmFile hook is called before
the DWARF section directives are emitted, so that all the PPC text section
directives come out right at the beginning of the file.

llvm-svn: 83176
2009-09-30 22:06:26 +00:00
Reid Kleckner 8ff5c19ebd Fix integer overflow in instruction scheduling. This can happen if we have
basic blocks that are so long that their size overflows a short.

Also assert that overflow does not happen in the future, as requested by Evan.

This fixes PR4401.

llvm-svn: 83159
2009-09-30 20:15:38 +00:00
Devang Patel 7ba3c0906b Silence unused variable warning.
llvm-svn: 83151
2009-09-30 17:13:41 +00:00
Evan Cheng f305ead1cc Add a target hook to add pre- post-regalloc scheduling passes.
llvm-svn: 83144
2009-09-30 08:49:50 +00:00
Devang Patel c2105298cc Simplify.
llvm-svn: 83123
2009-09-30 00:14:40 +00:00
David Goodwin 17199b56b0 Remove -post-RA-schedule flag and add a TargetSubtarget method to enable post-register-allocation scheduling. By default it is off. For ARM, enable/disable with -mattr=+/-postrasched. Enable by default for cortex-a8.
llvm-svn: 83122
2009-09-30 00:10:16 +00:00
Douglas Gregor aa0beea9a1 Forward-declare ValueSymbolTable so that SymbolTableListTraits.h can be parsed by itself
llvm-svn: 83121
2009-09-30 00:08:25 +00:00
Mike Stump 14cf8ecf0b Add a way for a frontend to generate more complex dwarf location
information.  This allows arbitrary code involving DW_OP_plus_uconst
and DW_OP_deref.  The scheme allows for easy extention to include,
any, or all of the DW_OP_ opcodes.  I thought about just exposing all
of them, but, wasn't sure if people wanted the dwarf opcodes exposed
in the api.  Is that a layering violation?

With this scheme, the entire existing block scheme used by llvm-gcc
can be switched over to the new scheme.  I think that would be
cleaner, as then the compiler specific bits are not present in llvm
proper.  Before the old code can be yanked however, similar code in
clang would have to be removed.

Next up, more testing.

llvm-svn: 83120
2009-09-30 00:08:22 +00:00
Devang Patel b4034364d6 Add removeMD().
llvm-svn: 83107
2009-09-29 20:42:25 +00:00
Devang Patel 5bf7a49fd7 Only one custom meadata of each kind can be attached with an instruction.
llvm-svn: 83105
2009-09-29 20:30:57 +00:00
Devang Patel b296942f6d Remove std::string uses from DebugInfo interface.
llvm-svn: 83083
2009-09-29 18:40:58 +00:00
Devang Patel 73e8d43588 Create empty StringRef is incoming cstring is NULL.
llvm-svn: 83082
2009-09-29 18:39:56 +00:00
Devang Patel ba4a6fdd17 Parse custom metadata attached with an instruction.
llvm-svn: 83033
2009-09-29 00:01:14 +00:00
Dan Gohman f919bd6651 Add C API calls for building FNeg operations. Patch by KS Sreeram!
llvm-svn: 83021
2009-09-28 21:51:41 +00:00
Devang Patel 2d85eef974 s/class Metadata/class MetadataContext/g
llvm-svn: 83019
2009-09-28 21:41:20 +00:00
Devang Patel b1a4477f1f Do not use global typedef for MDKindID.
llvm-svn: 83016
2009-09-28 21:14:55 +00:00
Devang Patel 1709e8c084 Remove unnecessary include.
llvm-svn: 83013
2009-09-28 21:06:38 +00:00
Jakob Stoklund Olesen dc9efe8078 Introduce the TargetInstrInfo::KILL machine instruction and get rid of the
unused DECLARE instruction.

KILL is not yet used anywhere, it will replace TargetInstrInfo::IMPLICIT_DEF
in the places where IMPLICIT_DEF is just used to alter liveness of physical
registers.

llvm-svn: 83006
2009-09-28 20:32:26 +00:00
Dan Gohman 9a7320c711 Convert LoopSimplify and LoopExtractor from FunctionPass to LoopPass.
llvm-svn: 82990
2009-09-28 14:37:51 +00:00
Mikhail Glushenkov efc9763468 Add a way to query the number of input files.
llvm-svn: 82957
2009-09-28 01:16:42 +00:00
Dan Gohman 4dbb301f17 Move the dominator verification code out of special code embedded within
the PassManager code into a regular verifyAnalysis method.

Also, reorganize loop verification. Make the LoopPass infrastructure
call verifyLoop as needed instead of having LoopInfo::verifyAnalysis
check every loop in the function after each looop pass. Add a new
command-line argument, -verify-loop-info, to enable the expensive
full checking.

llvm-svn: 82952
2009-09-28 00:27:48 +00:00
Dan Gohman 277e767578 Extend the StartPassTimer and StopPassTimer functions so that the
code that stops the timer doesn't have to search to find the timer
object before it stops the timer. This avoids a lock acquisition
and a few other things done with the timer running.

llvm-svn: 82949
2009-09-28 00:07:05 +00:00
Dan Gohman adde5dfde2 Extract the code for inserting a loop into the loop queue into
a separate function.

llvm-svn: 82946
2009-09-27 23:49:43 +00:00
Dan Gohman 5e8ba5d514 Extract the code for releasing a pass into a separate function, and
tidy it up a little.

llvm-svn: 82944
2009-09-27 23:38:27 +00:00
Nick Lewycky 28a5f25d87 Round out the API for the new optimization flags.
llvm-svn: 82930
2009-09-27 21:33:04 +00:00
Tilmann Scheller 336e2bd91b Use explicit structs instead of std::pair to map callee saved regs to spill slots.
llvm-svn: 82909
2009-09-27 17:58:47 +00:00
Dan Gohman 2115154d44 Remove a redundant assert.
llvm-svn: 82907
2009-09-27 17:48:37 +00:00
Dan Gohman bb85dd6f33 Add dominates and releaseMemory member functions to PostDominatorTree.
llvm-svn: 82904
2009-09-27 17:39:12 +00:00
Dan Gohman e28bd65aed Clarify a comment.
llvm-svn: 82902
2009-09-27 15:41:19 +00:00
Dan Gohman f39a3a9288 Add a properlyDominates member function to ScalarEvolution.
llvm-svn: 82898
2009-09-27 15:26:03 +00:00
Nick Lewycky 42fb7452df Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.

llvm-svn: 82889
2009-09-27 07:38:41 +00:00
Chris Lattner 37d8015dc1 remove support for "NoSub" from regex. It seems like a minor optimization
and makes the API more annoying.  Add a Regex::getNumMatches() method.

llvm-svn: 82877
2009-09-26 21:27:04 +00:00
Duncan Sands 129de48982 For the NSWSub support in the builder to actually be useable,
there need to be corresponding changes to the constant folders,
done in this patch.

llvm-svn: 82862
2009-09-26 15:35:35 +00:00
Duncan Sands 8c0fb28992 Add methods for creating NSW subtraction, as already exists
for addition.

llvm-svn: 82860
2009-09-26 15:21:48 +00:00
Dan Gohman 534ad04302 Add a comment describing natural loops.
llvm-svn: 82859
2009-09-26 15:09:53 +00:00
Dan Gohman 394468dc8e Rename ConstantFP's getInf to getInfinity.
llvm-svn: 82823
2009-09-25 23:40:21 +00:00
Dan Gohman 5a6b11cb71 Move MachineMemOperand::getAlignment out of line, to avoid needing
MathExtras.h in MachineMemOperand.h.

llvm-svn: 82822
2009-09-25 23:33:20 +00:00
Dan Gohman feb5021134 Add a ConstantFP::getInf utility function for creating infinity ConstantFPs.
llvm-svn: 82818
2009-09-25 23:00:48 +00:00
Jeffrey Yasskin 14a5cc54e5 Fix a compile failure introduced by r82675 on MinGW which doesn't have
setenv().  This patch just disables the test rather than getting putenv() to
work.  Thanks to Sandeep Patel for reporting the problem.

llvm-svn: 82797
2009-09-25 21:07:20 +00:00
Dan Gohman 48b185d6f7 Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.

llvm-svn: 82794
2009-09-25 20:36:54 +00:00
Dan Gohman 32f71d714b Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.

llvm-svn: 82790
2009-09-25 18:54:59 +00:00
Victor Hernandez e6ff7662b6 Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it causes regressions in the nightly tests.
llvm-svn: 82784
2009-09-25 18:11:52 +00:00
Bob Wilson d60367c198 pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public
interface" it must be 8-byte aligned.  For the older ARM APCS ABI, the stack
alignment is just always 4 bytes.  For X86, we currently align SP at
entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment
is needed at other times, such as for a leaf function.

After discussing this with Dan, I decided to go with the approach of adding
a new "TransientStackAlignment" field to TargetFrameInfo.  This value
specifies the stack alignment that must be maintained even in between calls.
It defaults to 1 except for ARM, where it is 4.  (Some other targets may
also want to set this if they have similar stack requirements. It's not
currently required for PPC because it sets targetHandlesStackFrameRounding
and handles the alignment in target-specific code.) The existing StackAlignment
value specifies the alignment upon entry to a function, which is how we've
been using it anyway.

llvm-svn: 82767
2009-09-25 14:41:49 +00:00
Bob Wilson 0bb2a929a2 Update the description of MachineFrameInfo's OffsetAdjustment. The value of
this adjustment does not change the direction or the signs of the object
offsets, and the details of the offset calculations can be target-specific.
Also mention that for most targets this value is only used to generate debug
info.

llvm-svn: 82750
2009-09-25 05:30:55 +00:00
Dan Gohman ebdfe4af62 Add a version of dumpr() that has a SelectionDAG* argument.
llvm-svn: 82742
2009-09-25 00:34:34 +00:00
Chris Lattner f08d2db928 add and document regex support for FileCheck. You can now do stuff like:
; CHECK: movl {{%e[a-z][xi]}}, %eax

or whatever.

llvm-svn: 82717
2009-09-24 21:47:32 +00:00
David Goodwin bf97147a7e Make the end-of-itinerary mark explicit. Some cleanup.
llvm-svn: 82709
2009-09-24 20:22:50 +00:00
Chris Lattner 1ce83629df tidy up, fix a memory leak in Regex::isValid
llvm-svn: 82707
2009-09-24 20:15:51 +00:00
Victor Hernandez 46cd467310 Auto-upgrade malloc instructions to malloc calls.
Reviewed by Devang Patel.

llvm-svn: 82694
2009-09-24 17:47:49 +00:00
Evan Cheng a21aac3811 Clean up LiveVariables and change how it deals with partial updates and kills. This also eliminate the horrible check which scan forward to the end of the basic block. It should be faster and more accurate.
llvm-svn: 82676
2009-09-24 02:15:22 +00:00
Dan Gohman 99bdae2992 Spruce up some comments.
llvm-svn: 82655
2009-09-23 21:06:36 +00:00
Dan Gohman 08c0a95ac6 Rename several variables from EVT to more descriptive names, now that EVT
is also the name of their type, as declarations like "EVT EVT" look
really odd.

llvm-svn: 82654
2009-09-23 21:02:20 +00:00
Dan Gohman 2366ffd2cb Add an EVT::getStoreSize function, like getStoreSizeInBits but in bytes.
llvm-svn: 82653
2009-09-23 20:59:10 +00:00
Dan Gohman 49f271afb3 Correct a comment.
llvm-svn: 82648
2009-09-23 20:40:16 +00:00
Devang Patel add586526e Do not leave behind metadata while cloning an instruction.
llvm-svn: 82638
2009-09-23 18:32:25 +00:00
Devang Patel e4e8181111 s/*Location/*DebugLocation/g
llvm-svn: 82635
2009-09-23 17:20:43 +00:00
John McCall 0110327ae3 Make the type traits for a const pointer defer to those for a unqualified
pointer, instead of providing independent values modelled on the default
implementation.

llvm-svn: 82620
2009-09-23 06:53:51 +00:00
Evan Cheng 262f86ed90 Fix PR5024. LiveVariables physical register defs should *commit* only after all
of the defs are processed.
Also fix a implicit_def propagation bug: a implicit_def of a physical register
should be applied to uses of the sub-registers.

llvm-svn: 82616
2009-09-23 06:28:31 +00:00
Dan Gohman c0353bfff5 Give MachineMemOperand an operator<<, factoring out code from
two different places for printing MachineMemOperands.

Drop the virtual from Value::dump and instead give Value a
protected virtual hook that can be overridden by subclasses
to implement custom printing. This lets printing be more
consistent, and simplifies printing of PseudoSourceValue
values.

llvm-svn: 82599
2009-09-23 01:33:16 +00:00
Devang Patel 320a1c4083 Add SetLocation() to allow IRBuilder user to set location info for an instruction already created.
llvm-svn: 82570
2009-09-22 20:56:31 +00:00
Devang Patel 276b02b325 Check exisiting dbg MDKind first.
llvm-svn: 82568
2009-09-22 20:54:13 +00:00
Daniel Dunbar 7e3aa3f68c Revert "Don't allow formatted_ostream to be unbuffered, even if its underlying
buffer", while we work out a solution.

Dan convinced me that making debugging annoying for him is worse than 10x being
slower for me. :)

llvm-svn: 82553
2009-09-22 16:33:42 +00:00
Evan Cheng 0570bbbd0f Forgot this.
llvm-svn: 82536
2009-09-22 08:47:59 +00:00
Daniel Dunbar 7b446a001d Revert "Get rid of GetProcessId in Win32/Program.inc.", this breaks
ExecuteAndWait.

llvm-svn: 82522
2009-09-22 04:44:56 +00:00
Daniel Dunbar 78faee0664 Switch FoldingSet::AddString to StringRef based API.
- This also fixes a dereference of std::string::end, which makes MSVC unhappy and was causing all the static analyzer clang tests to fail.

llvm-svn: 82517
2009-09-22 03:34:53 +00:00
Daniel Dunbar 0356483539 Switch DIDescriptor to use a TrackingVH. - This makes it much safer to work with debug info, since it was extraordinarily easy to have dangling pointers thanks to MDNode uniquing.
llvm-svn: 82507
2009-09-22 02:03:18 +00:00
Daniel Dunbar 70d4fb0d97 Add a TrackingVH value handle.
This is designed for tracking a value even when it might move (like WeakVH), but it is an error to delete the referenced value (unlike WeakVH0. TrackingVH is templated like AssertingVH on the tracked Value subclass, it is an error to RAUW a tracked value to an incompatible type.

For implementation reasons the latter error is only diagnosed on accesses to a mis-RAUWed TrackingVH, because we don't want a virtual interface in a templated class.

The former error is also only diagnosed on access, so that clients are allowed to delete a tracked value, as long as they don't use it. This makes it easier for the client to reason about destruction.

llvm-svn: 82506
2009-09-22 02:02:33 +00:00
Chris Lattner 22151ce5e9 move DominatorTree::dominates for instructions out of line,
no functionality change.

llvm-svn: 82490
2009-09-21 22:30:50 +00:00
Dan Gohman e7c8242baa Change MachineMemOperand's alignment value to be the alignment of
the base pointer, without the offset. This matches MemSDNode's
new alignment behavior, and holds more interesting information.

llvm-svn: 82473
2009-09-21 19:47:04 +00:00
Chris Lattner 450fd6ffbb add a helper method.
llvm-svn: 82438
2009-09-21 05:52:45 +00:00
Daniel Dunbar 7814fa1d5d Don't allow formatted_ostream to be unbuffered, even if its underlying buffer
is.
 - The problem is that formatted_ostream forces its underlying buffer to be
   unbuffered, so if some client happens to wrap a formatted_ostream around
   something, but still use the underlying stream, then we can end up writing on
   a fully unbuffered output (which was never intended to be unbuffered).

 - This makes clang (and presumably llvm-gcc) -emit-llvm -S a mere 10x faster.

llvm-svn: 82434
2009-09-21 03:56:00 +00:00
Reid Kleckner 9a10db8c46 Implement the JIT side of the GDB JIT debugging interface. To enable this
feature, either build the JIT in debug mode to enable it by default or pass
-jit-emit-debug to lli.

Right now, the only debug information that this communicates to GDB is call
frame information, since it's already being generated to support exceptions in
the JIT.  Eventually, when DWARF generation isn't tied so tightly to AsmPrinter,
it will be easy to push that information to GDB through this interface.

Here's a step-by-step breakdown of how the feature works:

- The JIT generates the machine code and DWARF call frame info
  (.eh_frame/.debug_frame) for a function into memory.
- The JIT copies that info into an in-memory ELF file with a symbol for the
  function.
- The JIT creates a code entry pointing to the ELF buffer and adds it to a
  linked list hanging off of a global descriptor at a special symbol that GDB
  knows about.
- The JIT calls a function marked noinline that GDB knows about and has put an
  internal breakpoint in.
- GDB catches the breakpoint and reads the global descriptor to look for new
  code.
- When sees there is new code, it reads the ELF from the inferior's memory and
  adds it to itself as an object file.
- The JIT continues, and the next time we stop the program, we are able to
  produce a proper backtrace.

Consider running the following program through the JIT:

#include <stdio.h>
void baz(short z) {
  long w = z + 1;
  printf("%d, %x\n", w, *((int*)NULL));  // SEGFAULT here
}
void bar(short y) {
  int z = y + 1;
  baz(z);
}
void foo(char x) {
  short y = x + 1;
  bar(y);
}
int main(int argc, char** argv) {
  char x = 1;
  foo(x);
}

Here is a backtrace before this patch:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2aaaabdfbd10 (LWP 25476)]
0x00002aaaabe7d1a8 in ?? ()
(gdb) bt
#0  0x00002aaaabe7d1a8 in ?? ()
#1  0x0000000000000003 in ?? ()
#2  0x0000000000000004 in ?? ()
#3  0x00032aaaabe7cfd0 in ?? ()
#4  0x00002aaaabe7d12c in ?? ()
#5  0x00022aaa00000003 in ?? ()
#6  0x00002aaaabe7d0aa in ?? ()
#7  0x01000002abe7cff0 in ?? ()
#8  0x00002aaaabe7d02c in ?? ()
#9  0x0100000000000001 in ?? ()
#10 0x00000000014388e0 in ?? ()
#11 0x00007fff00000001 in ?? ()
#12 0x0000000000b870a2 in llvm::JIT::runFunction (this=0x1405b70,
F=0x14024e0, ArgValues=@0x7fffffffe050)
   at /home/rnk/llvm-gdb/lib/ExecutionEngine/JIT/JIT.cpp:395
#13 0x0000000000baa4c5 in llvm::ExecutionEngine::runFunctionAsMain
(this=0x1405b70, Fn=0x14024e0, argv=@0x13f06f8, envp=0x7fffffffe3b0)
   at /home/rnk/llvm-gdb/lib/ExecutionEngine/ExecutionEngine.cpp:377
#14 0x00000000007ebd52 in main (argc=2, argv=0x7fffffffe398,
envp=0x7fffffffe3b0) at /home/rnk/llvm-gdb/tools/lli/lli.cpp:208

And a backtrace after this patch:
Program received signal SIGSEGV, Segmentation fault.
0x00002aaaabe7d1a8 in baz ()
(gdb) bt
#0  0x00002aaaabe7d1a8 in baz ()
#1  0x00002aaaabe7d12c in bar ()
#2  0x00002aaaabe7d0aa in foo ()
#3  0x00002aaaabe7d02c in main ()
#4  0x0000000000b870a2 in llvm::JIT::runFunction (this=0x1405b70,
F=0x14024e0, ArgValues=...)
   at /home/rnk/llvm-gdb/lib/ExecutionEngine/JIT/JIT.cpp:395
#5  0x0000000000baa4c5 in llvm::ExecutionEngine::runFunctionAsMain
(this=0x1405b70, Fn=0x14024e0, argv=..., envp=0x7fffffffe3c0)
   at /home/rnk/llvm-gdb/lib/ExecutionEngine/ExecutionEngine.cpp:377
#6  0x00000000007ebd52 in main (argc=2, argv=0x7fffffffe3a8,
envp=0x7fffffffe3c0) at /home/rnk/llvm-gdb/tools/lli/lli.cpp:208

llvm-svn: 82418
2009-09-20 23:52:43 +00:00
Chris Lattner 50f387c5f0 write rfind in terms of npos as daniel requested
llvm-svn: 82414
2009-09-20 22:54:26 +00:00
Chris Lattner 3b0dbeb96d remove a dead method.
llvm-svn: 82413
2009-09-20 22:46:42 +00:00
Chris Lattner 56efff07f5 smallvectorize getExtraOptionNames
llvm-svn: 82377
2009-09-20 06:21:43 +00:00
Chris Lattner 5c63f7b6b8 add a helper method.
llvm-svn: 82376
2009-09-20 06:21:20 +00:00
Daniel Dunbar 97f0970671 A few more tabs -> spaces.
llvm-svn: 82358
2009-09-20 04:03:25 +00:00
Chris Lattner 372a8ae403 move a couple non-trivial methods out of line, add new
find_first_of/find_first_of methods.

llvm-svn: 82347
2009-09-20 01:22:16 +00:00
Chris Lattner 3b8adaf488 convert a bunch more stuff to use StringRef. The ArgName arguments are now
stringref because they may not be nul terminated.  For options like -Lfoo
this now avoids a O(n)  temporary std::strings where N is the length of 
the string after -L.

llvm-svn: 82345
2009-09-20 00:40:49 +00:00
Chris Lattner 2b807cb364 add size_t and a version of rfind that allows specification of where
to scan from.

llvm-svn: 82343
2009-09-20 00:38:28 +00:00
Chris Lattner 84c1527b6b add some more overloads of StringRef::getAsInteger for
common and useful integer types.

llvm-svn: 82338
2009-09-19 23:58:48 +00:00
Chris Lattner 11b64b34d9 add a simple c_str() method to SmallString.
llvm-svn: 82337
2009-09-19 23:57:31 +00:00
Daniel Dunbar fe4f5c5c8f Prefer super class constructor to explicit initialization.
llvm-svn: 82335
2009-09-19 20:40:28 +00:00
Daniel Dunbar bce047da64 Tabs -> spaces (really?)
llvm-svn: 82334
2009-09-19 20:40:21 +00:00
Daniel Dunbar c418d6b106 Strip trailing whitespace.
llvm-svn: 82332
2009-09-19 20:40:05 +00:00
Daniel Dunbar 86f158ccb6 RHS of assignment should be const reference.
llvm-svn: 82331
2009-09-19 20:39:50 +00:00
Nick Lewycky 1303c0ab86 Remove the default value for ConstantStruct::get's isPacked parameter and
update the code which was broken by this.

llvm-svn: 82327
2009-09-19 20:30:26 +00:00
Chris Lattner 68ee70035e provide a "strtoull" operation that works on StringRef's.
llvm-svn: 82322
2009-09-19 19:47:14 +00:00
Chris Lattner aecd74d895 convert a bunch of std::strings to use StringRef. This should eliminate
a massive number of temporary strings created when parsing a command line.
More still left to eliminate.

llvm-svn: 82318
2009-09-19 18:55:05 +00:00
Nick Lewycky 7e6deb1cb4 Lett users of sparse propagation do their own thing with phi nodes if they want
to. This can be combined with LCSSA or SSI form to store more information on a
PHINode than can be computed by looking at its incoming values.

llvm-svn: 82317
2009-09-19 18:33:36 +00:00
Evan Cheng 1c69c47b23 Update comments.
llvm-svn: 82313
2009-09-19 10:08:51 +00:00
Chris Lattner 1457d067fa remove an extraneous mem2reg pass early in the pipe. Since
this is run after the 'standard function passes', SRoA was
recently run.  This saves a domfrontier construction. Thanks
to Eli for noticing this.

llvm-svn: 82291
2009-09-18 22:03:29 +00:00
Chris Lattner b069ec63a4 reduce indentation by using an early exit, and add a comment,
no functionality change.

llvm-svn: 82290
2009-09-18 22:01:30 +00:00
Evan Cheng 270d0f986f Enhance EmitInstrWithCustomInserter() so target can specify CFG changes that sdisel will use to properly complete phi nodes.
Not functionality change yet.

llvm-svn: 82273
2009-09-18 21:02:19 +00:00
Chris Lattner 71a15b1316 add a new hook to allow targets to splat stuff at the end of the file.
Overriding doFinalization is pretty lame.

llvm-svn: 82268
2009-09-18 20:17:03 +00:00
Devang Patel af206b8c88 Write and read metadata attachments.
llvm-svn: 82259
2009-09-18 19:26:43 +00:00
Victor Hernandez 788eaabd18 Update malloc call creation code (AllocType is now the element type of the malloc, not the resulting type).
In getMallocArraySize(), fix bug in the case that array size is the product of 2 constants.

Extend isArrayMalloc() and getMallocArraySize() to handle case where malloc is used as char array.

Ensure that ArraySize in LowerAllocations::runOnBasicBlock() is correct type.

Extend Instruction::isSafeToSpeculativelyExecute() to handle malloc calls.

Add verification for malloc calls.

Reviewed by Dan Gohman.

llvm-svn: 82257
2009-09-18 19:20:02 +00:00
Anton Korobeynikov 592638ae05 Allow symbols to start from the digit if target requests it. This allows, e.g. pinning
variables to specified absolute address. Make use of this feature for MSP430.
This unbreaks PR4776.

llvm-svn: 82227
2009-09-18 16:57:42 +00:00
Xerxes Ranby cd92d24a4f Revert r82214 completely to fix build.
llvm-svn: 82218
2009-09-18 09:50:00 +00:00
Evan Cheng 6ba1931d60 Fix a bug in sdisel switch lowering code. When it updates the phi nodes in switch successor blocks, it can introduce multiple phi operands of the same value from different blocks (and may not be on the predecessor list).
This can be seen on CodeGen/Generic/2006-09-06-SwitchLowering.ll. But it's not known to cause any real regression (but I have added an assertion for it now).

llvm-svn: 82214
2009-09-18 08:16:04 +00:00
Julien Lerouge f2a0d7364b Use __attribute__((__used__)) if GCC >= 3.1 (seems to be the oldest GCC
supporting this attribute).

llvm-svn: 82177
2009-09-17 23:27:10 +00:00
John McCall 26a96b0369 Fix a few places where PointerIntPair was using PointerLikeTypeTraits<PointerTy>
instead of the PtrTraits provided.  Allows PointerIntPair to contain a
PointerUnion safely, as long as the bits add up.

llvm-svn: 82163
2009-09-17 20:35:18 +00:00
Chris Lattner a6ebba270d pass machinemoduleinfo down into getSymbolForDwarfGlobalReference,
currently unused.

llvm-svn: 82157
2009-09-17 18:49:52 +00:00
Dan Gohman 36bad00bef Teach ScalarEvolution how to reason about no-wrap flags on loops
where the induction variable has a non-unit stride, such as {0,+,2}, and
there are expressions such as {1,+,2} inside the loop formed with
or or add nsw operators.

llvm-svn: 82151
2009-09-17 18:05:20 +00:00
Jim Grosbach d0928e8cb5 grammar
llvm-svn: 82149
2009-09-17 17:55:55 +00:00
Evan Cheng 4ba30d9913 Remove simple regalloc. It has bit rotted.
llvm-svn: 82127
2009-09-17 05:48:07 +00:00
Chris Lattner ac6271e3f4 add a version of the APFloat constructor that initializes to 0.0
llvm-svn: 82110
2009-09-17 01:08:43 +00:00
Daniel Dunbar 4498168753 Add StringRef::{rfind, rsplit}
llvm-svn: 82087
2009-09-16 22:38:48 +00:00
Dan Gohman 0f64d71d99 Add a new pass for doing late hoisting of floating-point and vector
constants out of loops. These aren't covered by the regular LICM
pass, because in LLVM IR constants don't require separate
instructions. They're not always covered by the MachineLICM pass
either, because it doesn't know how to unfold folded constant-pool
loads. This is somewhat experimental at this point, and off by
default.

llvm-svn: 82076
2009-09-16 20:25:11 +00:00
Devang Patel dec23fd825 Print debug info attached with an instruction.
llvm-svn: 82075
2009-09-16 20:21:17 +00:00
Devang Patel 820640d39f Provide a way to extract location info from DILocation.
llvm-svn: 82064
2009-09-16 18:20:05 +00:00
Devang Patel 13fb91e900 Add an interface to attach debugging information with an instruction.
llvm-svn: 82062
2009-09-16 18:16:11 +00:00
Devang Patel d5497a4bf8 Add llvm::Metadata to manage metadata used in a context.
This interface will be used to attach metadata with an instruction.

llvm-svn: 82060
2009-09-16 18:09:00 +00:00
Andreas Neustifter 41c1103273 Reapplied r81355 with the problems fixed.
(See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090907/086737.html and
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090907/086746.html)

llvm-svn: 82039
2009-09-16 11:35:50 +00:00
Andreas Neustifter f8cb758ba8 Preserve ProfileInfo during CodeGenPrepare.
llvm-svn: 82034
2009-09-16 09:26:52 +00:00
Chris Lattner 05f4039763 move FnStubs/GVSTubs/HiddenGVStub handling out of the X86 asmprinter
and use MachineModuleInfoMachO instead.

llvm-svn: 82022
2009-09-16 06:25:03 +00:00
Chris Lattner f3f54ffc89 add a new MachineModuleInfoMachO class, which is the per-module
stuff common across all macho targets.

llvm-svn: 82018
2009-09-16 06:03:48 +00:00
Chris Lattner 07fc26d63c the pointer MMI keeps will start out with object-file format specific stuff
llvm-svn: 82012
2009-09-16 05:26:00 +00:00
Chris Lattner 8df79f2681 remove the AsmPrinter::printMCInst hook hack now that
we have MCInstPrinter.

llvm-svn: 82006
2009-09-16 04:57:15 +00:00
Chris Lattner b866602f06 Big change #1 for personality function references:
Eliminate the PersonalityPrefix/Suffix & NeedsIndirectEncoding
fields from MAI: they aren't part of the asm syntax, they are
related to the structure of the object file.

To replace their functionality, add a new 
TLOF::getSymbolForDwarfGlobalReference method which asks targets
to decide how to reference a global from EH in a pc-relative way.

The default implementation just returns the symbol.  The default
darwin implementation references the symbol through an indirect
$non_lazy_ptr stub.  The bizarro x86-64 darwin specialization
handles the weird "foo@GOTPCREL+4" hack.

DwarfException.cpp now uses this to emit the reference to the
symbol in the right way, and this also eliminates another 
horrible hack from DwarfException.cpp:

-    if (strcmp(MAI->getPersonalitySuffix(), "+4@GOTPCREL"))
-      O << "-" << MAI->getPCSymbol();

llvm-svn: 81991
2009-09-16 01:46:41 +00:00
Chris Lattner 6a833f6806 add a helper method for creating MCSymbol and MCSymbolRefExpr at
the same time.

llvm-svn: 81984
2009-09-16 01:26:31 +00:00
Chris Lattner 6b99ae882b inline AsmPrinter::getCurrentFunctionEHName into its only caller.
llvm-svn: 81970
2009-09-16 00:35:39 +00:00
Chris Lattner 727ad714e2 remove a dead bool.
llvm-svn: 81968
2009-09-16 00:24:31 +00:00
Chris Lattner d106abfce7 Eliminate AsmPrinter::EmitExternalGlobal, inlining its (now)
one implementation into its one caller.  This eliminates a totally
awesome and gratuitous hack where we casted a Function* to 
GlobalVariable*.

llvm-svn: 81967
2009-09-16 00:17:39 +00:00
Chris Lattner dd5a989034 eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining
it into all of its call sites and simplifying them.

llvm-svn: 81962
2009-09-16 00:08:41 +00:00
Chris Lattner 2251293788 remove some horrible MAI hooks which fortunately turn out to be always empty.
llvm-svn: 81946
2009-09-15 23:11:32 +00:00
Chris Lattner f2471ec967 add hooks to hang target-specific goop off MachineModuleInfo,
move MachineFunctionInfo virtual method out of line to give it
a home.

llvm-svn: 81940
2009-09-15 22:44:26 +00:00
Daniel Dunbar 316b4a0206 Drop the raw_ostream required buffer size to 1.
- As best I can tell, we have eliminated all the code which used to require a
   larger buffer size.

llvm-svn: 81912
2009-09-15 20:31:46 +00:00
Nate Begeman 178135c88b Better solution for tracking both the original alignment of the access, and the current alignment based
on the source value offset.  This avoids increasing the size of mem nodes. 

llvm-svn: 81897
2009-09-15 19:05:41 +00:00
Jim Grosbach 7801e75e5e Correct comment pasto
llvm-svn: 81896
2009-09-15 18:56:13 +00:00
Dan Gohman e4532f30b1 When a constant's type is refined, update the constant in place
instead of cloning and RAUWing it.

 - Make AbstractTypeUser a friend of Value so that it can offer
   its subclasses a way to update a Value's type in place. This
   is better than a universally visible setType method on Value,
   and it's sufficient for the immediate need.

 - Eliminate the constant "convert" functions. This eliminates a
   lot of logic duplication, and fixes a complicated bug where a
   constant can't actually be cloned during the type refinement
   process because some of the types that its folder needs are
   half-destroyed, being in the middle of refinement themselves.

 - Move the getValType functions from being static overloaded
   functions in Constants.cpp to be members of class template
   specializations in ConstantsContext.h. This means that the
   code ends up getting instantiated twice, however it also
   makes it possible to eliminate all "convert" functions, so
   it's not a big net code size increase. And if desired, the
   duplicate instantiations could be eliminated with some
   reorganization.

llvm-svn: 81861
2009-09-15 15:58:07 +00:00
Dan Gohman 1f58f0e187 Fix apostrophos.
llvm-svn: 81856
2009-09-15 15:08:33 +00:00
Evan Cheng edb2287722 Forgot this.
llvm-svn: 81850
2009-09-15 07:05:12 +00:00
Chris Lattner e0987215f0 add a new CallGraphNode::replaceCallEdge method and use it from
argpromote to avoid invalidating an iterator.  This fixes PR4977.
All clang tests now pass with expensive checking (on my system 
at least).

llvm-svn: 81843
2009-09-15 05:40:35 +00:00
Chris Lattner d4d966f500 make -debug-pass=Executions show information about what call graph nodes
are in the SCC for each execution of a CGSCC pass.

llvm-svn: 81838
2009-09-15 05:03:04 +00:00
Chris Lattner 2b979ef128 switch scciterator to use DenseMap instead of std::map
llvm-svn: 81834
2009-09-15 04:37:49 +00:00
Mikhail Glushenkov 0adf07eb9e Get rid of GetProcessId in Win32/Program.inc.
GetProcessId was introduced only in XP. As a bonus, this change makes Program
objects copyable, since Program is now basically a PID.

llvm-svn: 81826
2009-09-15 03:39:45 +00:00
Nate Begeman 02a685a914 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.  

llvm-svn: 81813
2009-09-15 00:13:12 +00:00
Evan Cheng 7f789596f3 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.

llvm-svn: 81796
2009-09-14 21:33:42 +00:00
Dan Gohman 1113741a03 Update a comment to match the source. PseudoSourceValues are now
obtained via accessor functions.

llvm-svn: 81782
2009-09-14 20:40:10 +00:00
Chris Lattner 4dc75de733 PIC16 does allow colon after MBB labels, simplify EmitBasicBlockStart.
llvm-svn: 81755
2009-09-14 03:15:54 +00:00
Chris Lattner 11b2fc9ea4 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.

llvm-svn: 81754
2009-09-14 03:02:37 +00:00
Chris Lattner 6d31b43592 Give MCInstPrinter a MCAsmInfo member, make X86ATTInstPrinter
be a MCInstPrinter.

llvm-svn: 81746
2009-09-14 01:49:26 +00:00
Chris Lattner de57d8e72b add a new MCInstPrinter class, move the (trivial) MCDisassmbler ctor inline.
llvm-svn: 81745
2009-09-14 01:43:38 +00:00
Chris Lattner d0a3f194a6 eliminate the TargetRegisterDesc::AsmName field, the asmprinters now have this table.
llvm-svn: 81728
2009-09-13 22:45:04 +00:00
Chris Lattner eb2cc68254 remove all but one reference to TargetRegisterDesc::AsmName.
llvm-svn: 81714
2009-09-13 20:31:40 +00:00
Chris Lattner 5156a00989 second part to r81695, I missed a directory.
llvm-svn: 81696
2009-09-13 19:03:08 +00:00
Chris Lattner 1d04aa78f3 replace printBasicBlockLabel with EmitBasicBlockStart,
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

llvm-svn: 81684
2009-09-13 18:25:37 +00:00
Chris Lattner a602bebb61 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.

llvm-svn: 81652
2009-09-12 23:02:08 +00:00
Chris Lattner 5090e6c4a7 eliminate the "MBBLabel" MCOperand type, and just use a MCSymbol for
MBB labels like everything else.

llvm-svn: 81628
2009-09-12 20:45:03 +00:00
Lang Hames d0fe246dc2 Whoops. Committed the headers for r81605 - 'Moved some more index operations over to LiveIntervals.'
llvm-svn: 81609
2009-09-12 04:54:18 +00:00
Dan Gohman e592923603 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.

llvm-svn: 81568
2009-09-11 20:46:33 +00:00
Chris Lattner 233bfc2890 give densemap iterators real iterator traits.
llvm-svn: 81538
2009-09-11 18:15:46 +00:00
Chris Lattner 3e1f5e93cb default construct MCInst's ctor to 0, which is "PHI" which is invalid for MCInsts.
llvm-svn: 81525
2009-09-11 16:33:58 +00:00
Chris Lattner 840c8d72d0 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.

llvm-svn: 81505
2009-09-11 05:40:42 +00:00
Dan Gohman 7190d48075 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.

llvm-svn: 81478
2009-09-10 23:37:55 +00:00
Dan Gohman 91d598de5c Give these files top-level comments that describe the current code.
llvm-svn: 81473
2009-09-10 23:07:18 +00:00
Kevin Enderby ce4bec8e0c 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.

llvm-svn: 81461
2009-09-10 20:51:44 +00:00
Mikhail Glushenkov c1e23592ec Distinguish between 'empty' and empty DAG marker.
llvm-svn: 81448
2009-09-10 16:22:02 +00:00
Mikhail Glushenkov 7b047b9c81 Add a logical 'not' operator to llvmc's TableGen dialect.
llvm-svn: 81447
2009-09-10 16:21:38 +00:00
Nick Lewycky dddf5dcdaf Correctly handle the case where a comparison is created in one BasicBlock and
used by a terminator in another.

llvm-svn: 81437
2009-09-10 07:02:09 +00:00
Evan Cheng 1d9d4bdc99 Add malloc call utility functions. Patch by Victor Hernandez.
llvm-svn: 81426
2009-09-10 04:36:43 +00:00
Daniel Dunbar a944234a1e MC: Give target specific parsers access to the MCStreamer.
llvm-svn: 81416
2009-09-10 00:59:15 +00:00
Chris Lattner 321bc99a74 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.

llvm-svn: 81396
2009-09-09 23:14:36 +00:00
Sean Callanan 1358fb7feb 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.

llvm-svn: 81392
2009-09-09 22:49:13 +00:00
Chris Lattner d9e12345af add a gross hack to get "SrcLine" comments to show up with the
new asmprinter.  Differently gross hack coming next.

llvm-svn: 81379
2009-09-09 20:45:42 +00:00
Lang Hames 6b81770040 Removed static qualifier from a few index related methods. These methods may require a LiveIntervals instance in future.
llvm-svn: 81374
2009-09-09 20:14:17 +00:00
Andreas Neustifter 93bc18f80a Add the first functions for updating ProfileInfo.
llvm-svn: 81359
2009-09-09 17:52:57 +00:00
Chris Lattner 9ded9ac8af revert r81335, which breaks the build.
llvm-svn: 81347
2009-09-09 16:00:57 +00:00
Andreas Neustifter 0bd472dc33 Updated ProfileInfo to have clean seperation between different sentinels.
llvm-svn: 81335
2009-09-09 12:48:26 +00:00
Mikhail Glushenkov 5cf21a9668 Copy-pasto.
llvm-svn: 81331
2009-09-09 10:14:55 +00:00
Mikhail Glushenkov 48893a691e Revert 81248 for now.
Program objects have ownership semantics on Windows.

llvm-svn: 81329
2009-09-09 09:52:04 +00:00
Jeffrey Yasskin ccbeaf5f94 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.

llvm-svn: 81316
2009-09-09 05:04:01 +00:00
Daniel Dunbar a8597a3749 Add Triple::getArchTypeForDarwinArchName, which converts a "Darwin" architecture
name (e.g. "ppc") to the appropriate constant.

Also, StringRefize additional Triple constructor.

llvm-svn: 81274
2009-09-08 23:32:51 +00:00
Dan Gohman e6a80ced1c 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.

llvm-svn: 81256
2009-09-08 22:20:35 +00:00
Mikhail Glushenkov 29b5d3012b Const-correctness.
llvm-svn: 81249
2009-09-08 19:51:39 +00:00
Mikhail Glushenkov 28471eee1d Since Program is basically a PID, it should be copyable.
llvm-svn: 81248
2009-09-08 19:51:12 +00:00
Mikhail Glushenkov f9e2f241df Get rid of the Pid_ member in the Program class.
llvm-svn: 81247
2009-09-08 19:50:55 +00:00
Mikhail Glushenkov 4a91b7605b Add a Kill() function to the Program class.
llvm-svn: 81246
2009-09-08 19:50:27 +00:00
Dan Gohman 3ddbc242fb 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 de6a44b790 fix pasto
llvm-svn: 81184
2009-09-08 03:39:55 +00:00
Chris Lattner 5c2126d67e 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 4ad0b4c544 fix PR4915, a crash in -debug mode.
llvm-svn: 81177
2009-09-08 01:22:54 +00:00
Chris Lattner 4bc2825d0b add some comments to describe the invariants.
llvm-svn: 81173
2009-09-08 00:06:16 +00:00
Dan Gohman 1b84908f92 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 6d46e7689c 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 d216b05e75 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 b986b8ffe7 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