Commit Graph

52319 Commits

Author SHA1 Message Date
Dan Gohman 203d53ed79 Use getStoreSize() instead of getStoreSizeInBits()/8.
llvm-svn: 82656
2009-09-23 21:07:02 +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
Jakob Stoklund Olesen 75b9c2741d Fix verification of explicit operands.
The machine code verifier did not check for explicit operands correctly. It
used MachineInstr::getNumExplicitOperands, but that method may cheat and use
the declared count in the TargetInstrDesc.

Now we check the explicit operands one at a time in visitMachineOperand.

llvm-svn: 82652
2009-09-23 20:57:55 +00:00
Bob Wilson abfdbbfd1a Remove BlackfinRegisterInfo::getFrameIndexOffset since it is the same as the
default implementation.  Update comment on the default version, which made it
sound like most targets override it.  Currently only X86 and SystemZ override
this method.

llvm-svn: 82651
2009-09-23 20:57:02 +00:00
Dan Gohman 49f271afb3 Correct a comment.
llvm-svn: 82648
2009-09-23 20:40:16 +00:00
Devang Patel 52e819c7cf Delete attached metadata when an instruction is deleted.
llvm-svn: 82647
2009-09-23 20:33:51 +00:00
Anton Korobeynikov 29a44df5f8 ARM does not support offset folding (yet). Disable it for now.
This fixes PR5031. Unfortunately, there is no small testcase :(

llvm-svn: 82643
2009-09-23 19:04:09 +00:00
Bob Wilson c2c86cede6 Edit a comment.
llvm-svn: 82641
2009-09-23 18:53:19 +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
Evan Cheng 3cf0ddf094 Add nounwind.
llvm-svn: 82637
2009-09-23 18:20:27 +00:00
Devang Patel e4e8181111 s/*Location/*DebugLocation/g
llvm-svn: 82635
2009-09-23 17:20:43 +00:00
Jeffrey Yasskin 42a49dfb02 PR4047: Permit configure --enable-targets=host,cpp for example. "host" has the
same effect that "host-only" used to have, but can be combined with other
targets.  host-only is still available as a synonym but no longer documented.

llvm-svn: 82634
2009-09-23 17:05:42 +00:00
David Goodwin a4c98a3e34 Fix bug in kill flag updating for post-register-allocation scheduling. When the kill flag of a superreg needs to be cleared because there are one or more subregs live, we instead add implicit-defs of those subregs and leave the kill flag on the superreg. This allows us to end the live-range of the superreg without ending the live-ranges of the subregs.
llvm-svn: 82629
2009-09-23 16:35:25 +00:00
Benjamin Kramer 43355aec61 Fix a struct/class mismatch.
llvm-svn: 82622
2009-09-23 11:48:57 +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
Evan Cheng b2abe07457 Fix a obvious logic error.
llvm-svn: 82610
2009-09-23 05:23:19 +00:00
Gabor Greif 98dd936bc9 pretty mechanical changes to match coding guidelines (blessed by sabre on IRC)
llvm-svn: 82603
2009-09-23 02:46:12 +00:00
Chris Lattner 8bcc6445c7 errorstr can be null, don't unconditionally set it. Only report that
"the jit has not been linked in" if the interpreter failed.

This fixes a unit test failure.

llvm-svn: 82601
2009-09-23 02:03:49 +00:00
Chris Lattner 41fa2bd112 Make EngineBuilder return more error codes, by KS Sreeram.
llvm-svn: 82600
2009-09-23 01:46:04 +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
Dan Gohman 1439957928 Fix X86's unfoldMemoryOperand to properly handle MachineMemOperands.
llvm-svn: 82597
2009-09-23 01:29:41 +00:00
Mike Stump 8808063181 This is overly constraining with respect to clang.
llvm-svn: 82591
2009-09-23 00:13:30 +00:00
Erick Tryzelaar 21e83eab3f Add examples for Kaleidoscope chapters 2 through 6.
Conflicts:

	examples/Makefile

llvm-svn: 82574
2009-09-22 21:15:19 +00:00
Erick Tryzelaar 2d8813cfb0 Rename Kaleidoscope to show that it's for Chapter 7 of the tutorial.
llvm-svn: 82573
2009-09-22 21:15:00 +00:00
Erick Tryzelaar 6e2b34bc14 Sync c++ kaleidoscope tutorial with test.
llvm-svn: 82572
2009-09-22 21:14:49 +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
Victor Hernandez ddc2ce4fe2 No need to verify that malloc's return type is i8*.
llvm-svn: 82561
2009-09-22 18:50:03 +00:00
David Goodwin 74b79566f6 Use early returns.
llvm-svn: 82554
2009-09-22 16:47:52 +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
Daniel Dunbar b2942cb5cb ... missed hiding a variable for MSVC only.
llvm-svn: 82552
2009-09-22 16:10:35 +00:00
Daniel Dunbar 1bdedd3876 Hide MSVC specific CRT interaction behind _MSC_VER.
llvm-svn: 82551
2009-09-22 15:58:35 +00:00
Mikhail Glushenkov 88e98fec70 Remove the GetProcessId() call from Win32/Program.inc, take 2.
GetProcessId() was introduced only in Windows XP, and we want to support earlier
versions.

llvm-svn: 82548
2009-09-22 15:40:32 +00:00
Daniel Dunbar 86707c9913 Fix commento.
llvm-svn: 82544
2009-09-22 10:30:34 +00:00
Daniel Dunbar 99e1174baf lit: When executing shell scripts internally, don't allow piped stderr on any
commands except the last one, instead redirect the stderr to a temporary
file. This sidesteps a potential deadlocking issue.

llvm-svn: 82538
2009-09-22 09:50:38 +00:00
Daniel Dunbar 4c7b0ca05b Add a magic LLVM_DISABLE_CRT_DEBUG environment variable which we check in RegisterHandler and use to disable the Win32 crash dialogs. These are a major blocker to any kind of automated testing.
Also, tweak the 'lit' test runner to set this variable unconditionally.

llvm-svn: 82537
2009-09-22 09:50:28 +00:00
Evan Cheng 0570bbbd0f Forgot this.
llvm-svn: 82536
2009-09-22 08:47:59 +00:00
Evan Cheng 08d1e41c10 Fix PR5024. LiveVariables::FindLastPartialDef should return a set of sub-registers that were defined by the last partial def, not just a single sub-register.
llvm-svn: 82535
2009-09-22 08:34:46 +00:00
Daniel Dunbar 28830b39b4 Initial support for running LLVM tests from cmake.
llvm-svn: 82534
2009-09-22 07:38:44 +00:00
Daniel Dunbar 26a6dfe0b6 Generate lit.site.cfg from a .in file, as clang does.
llvm-svn: 82533
2009-09-22 07:38:33 +00:00
Daniel Dunbar 1a0a423b38 Use Compiler.h macro instead of __attribute__.
llvm-svn: 82532
2009-09-22 07:38:23 +00:00
Daniel Dunbar 6ce1ab1c64 CMake: Fix definition of LTDL_SHLIB_EXT for Darwin.
llvm-svn: 82530
2009-09-22 06:09:37 +00:00
Daniel Dunbar a249c42e8c Fix llvm-config --src-root and --obj-root for CMake builds.
llvm-svn: 82529
2009-09-22 06:09:31 +00:00
Daniel Dunbar af890eb82f llvm-config: Remove unused variables.
llvm-svn: 82528
2009-09-22 06:09:22 +00:00
Daniel Dunbar b8895c078f Actually use the arguments with the resolved executable path.
llvm-svn: 82527
2009-09-22 06:09:13 +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 24a0813fc4 lit: Don't use close_fds=True on Windows.
llvm-svn: 82521
2009-09-22 04:44:37 +00:00
Daniel Dunbar 753f8be411 lit: When executing commands internally, perform PATH resolution ourselves.
llvm-svn: 82520
2009-09-22 04:44:26 +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 c827d9ee0e Workaround what I believe is an MSVC bug where it emits a definition for a
static const class member into each translation unit, with external linkage???
 - If someone understands this issue better, please clue me in, I haven't
   consulted the standard yet.

llvm-svn: 82516
2009-09-22 03:34:40 +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
Evan Cheng 0dfed43a5b Fix a pasto. Also simplify for Bill's benefit.
llvm-svn: 82505
2009-09-22 01:48:19 +00:00
Evan Cheng 8c500100f6 Minor bug fix. LowerSubregs should translate
%S0<def> = EXTRACT_SUBREG %Q0<kill>, 1
to
%S0<def> = IMPLICIT_DEF %Q0<imp-use,kill>

Implicit_def does not *read* any register so the operand should be marked "implicit". The missing "implicit" marker on the operand is wrong, but it doesn't actually break anything.

llvm-svn: 82503
2009-09-22 00:29:40 +00:00
Chris Lattner cf295039e4 Fix PR5023: The instruction form of DominatorTree::dominates did not
take into consideration that the result of an invoke is only valid in
the normal dest, not the unwind dest.  This caused 'PHINode::hasConstantValue'
to return true in an invalid situation, causing mem2reg to delete a phi that
was actually needed.  This caused a crash building 483.xalancbmk.

llvm-svn: 82491
2009-09-21 22:39:35 +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
Chris Lattner 7d08da6b2a tidy up
llvm-svn: 82489
2009-09-21 22:27:34 +00:00
Chris Lattner e3ce1e2a37 tidy up
llvm-svn: 82488
2009-09-21 22:26:02 +00:00
Evan Cheng 255f416470 Clean up spill weight computation. Also some changes to give loop induction
variable increment / decrement slighter high priority. 

This has major impact on some micro-benchmarks. On MultiSource/Applications
and spec tests, it's a minor win. It also reduce 256.bzip instruction count
by 8%, 55 on 164.gzip on i386 / Darwin.

llvm-svn: 82485
2009-09-21 21:12:25 +00:00
David Goodwin 5090273367 Add Cortex-A8 VFP model.
llvm-svn: 82483
2009-09-21 20:52:17 +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
Dan Gohman cf13782fab Add a comment mentioning the rdar number associated with this test.
llvm-svn: 82471
2009-09-21 18:32:20 +00:00
Dan Gohman 69499b13fd Add support for rematerializing FsFLD0SS and FsFLD0SD as constant-pool
loads in order to reduce register pressure.

llvm-svn: 82470
2009-09-21 18:30:38 +00:00
Dan Gohman 48ade83e60 Recognize SSE min and max opportunities in even more cases.
And fix a bug with the behavior of min/max instructions formed from
fcmp uge comparisons.

Also, use FiniteOnlyFPMath() for this code instead of UnsafeFPMath,
as it is more specific.

llvm-svn: 82466
2009-09-21 18:03:22 +00:00
Dan Gohman 757acfea63 Fix the offset values for these memoperands. For frame objects, the
PseudoSourceValue already effectively represents the offset from the
frame base, so the actual offset should not be added to it.

llvm-svn: 82465
2009-09-21 17:58:09 +00:00
Chris Lattner 247053867e big endian systems shift by bits too, hopefully this will fix the ppc
bootstrap problems.

llvm-svn: 82464
2009-09-21 17:55:47 +00:00
Dan Gohman 43d6830ea0 Nick pointed out that DominanceFrontier and DominanceTree are preserved
by setPreservesCFG().

llvm-svn: 82463
2009-09-21 17:54:42 +00:00
Dan Gohman af57ae3da4 Remove the special-case for constants in PHI nodes; it's not really
helpful, and it didn't correctly handle the case of constants input
to PHIs for backedges.

llvm-svn: 82462
2009-09-21 17:53:35 +00:00
Chris Lattner 9045f235d2 fix PR5016, a crash I introduced in GVN handing first class
arrays and structs, which cannot be bitcast to integers.

llvm-svn: 82460
2009-09-21 17:24:04 +00:00
Mikhail Glushenkov fdd0a2fb40 Use raw_ostream::indent instead of passing strings.
llvm-svn: 82456
2009-09-21 15:53:44 +00:00
Dan Gohman a3c45bda22 Fix this assertion string to mention subreg_to_reg.
llvm-svn: 82455
2009-09-21 15:18:33 +00:00
Nuno Lopes 2c7e72cf42 initialize SymbolsCanStartWithDigit to false by default
llvm-svn: 82454
2009-09-21 14:11:56 +00:00
Xerxes Ranby da99be6fae Update cmake.
llvm-svn: 82449
2009-09-21 08:08:29 +00:00
Jakob Stoklund Olesen f6eb7d83d1 Verify that phi instructions refer to MBBs in the CFG.
The machine code verifier no longer tolerates phi instructions with noop
operands. All MBBs on a phi instruction must be in the CFG.

llvm-svn: 82448
2009-09-21 07:19:08 +00:00
Chris Lattner 4d8af2f1ae enable non-local analysis and PRE of large store -> little load.
This doesn't kick in too much because of phi translation issues,
but this can be resolved in the future.

llvm-svn: 82447
2009-09-21 06:48:08 +00:00
Chris Lattner 0cdc17eb50 convert an std::pair to an explicit struct.
llvm-svn: 82446
2009-09-21 06:30:24 +00:00
Chris Lattner d28f90897a move some functions, add a comment.
llvm-svn: 82444
2009-09-21 06:24:16 +00:00
Chris Lattner 9d7fb29522 split HandleLoadFromClobberingStore in two pieces: one that does the
analysis, one that does the xform.

llvm-svn: 82443
2009-09-21 06:22:46 +00:00
Chris Lattner 61858787b1 add a note
llvm-svn: 82442
2009-09-21 06:04:07 +00:00
Daniel Dunbar bc528b16c2 Register the MachineModuleInfo for the ARM JIT, and update JITDwarfEmitter to
assert if the setModuleInfo hasn't been called.

llvm-svn: 82441
2009-09-21 05:58:35 +00:00
Chris Lattner e2b8a80487 add pr#
llvm-svn: 82440
2009-09-21 05:57:47 +00:00
Chris Lattner 0a9616d906 Improve GVN to be able to forward substitute a small load
from a piece of a large store when both are in the same block.

This allows clang to compile the testcase in PR4216 to this code:

_test_bitfield:
	movl	4(%esp), %eax
	movl	%eax, %ecx
	andl	$-65536, %ecx
	orl	$32962, %eax
	andl	$40186, %eax
	orl	%ecx, %eax
	ret

This is not ideal, but is a whole lot better than the code produced
by llvm-gcc:

_test_bitfield:
	movw	$-32574, %ax
	orw	4(%esp), %ax
	andw	$-25350, %ax
	movw	%ax, 4(%esp)
	movw	7(%esp), %cx
	shlw	$8, %cx
	movzbl	6(%esp), %edx
	orw	%cx, %dx
	movzwl	%dx, %ecx
	shll	$16, %ecx
	movzwl	%ax, %eax
	orl	%ecx, %eax
	ret

and dramatically better than that produced by gcc 4.2:

_test_bitfield:
	pushl	%ebx
	call	L3
"L00000000001$pb":
L3:
	popl	%ebx
	movl	8(%esp), %eax
	leal	0(,%eax,4), %edx
	sarb	$7, %dl
	movl	%eax, %ecx
	andl	$7168, %ecx
	andl	$-7201, %ebx
	movzbl	%dl, %edx
	andl	$1, %edx
	sall	$5, %edx
	orl	%ecx, %ebx
	orl	%edx, %ebx
	andl	$24, %eax
	andl	$-58336, %ebx
	orl	%eax, %ebx
	orl	$32962, %ebx
	movl	%ebx, %eax
	popl	%ebx
	ret

llvm-svn: 82439
2009-09-21 05:57:11 +00:00
Chris Lattner 450fd6ffbb add a helper method.
llvm-svn: 82438
2009-09-21 05:52:45 +00:00
Evan Cheng fccbd0afc6 Fix PR4986. "r1024 = insert_subreg r1024, undef, 2" cannot be turned in an implicit_def. Instead, it's an identity copy so it should be eliminated. Also make sure to update livevariable kill information.
llvm-svn: 82436
2009-09-21 04:32:32 +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
Chris Lattner 9858859fd6 one case handled, expanded another testcase inline.
llvm-svn: 82427
2009-09-21 02:53:57 +00:00
Chris Lattner 1eefa9c427 formatting cleanups, no functionality change.
llvm-svn: 82426
2009-09-21 02:42:51 +00:00
Reid Kleckner 7dfb37e58a Add documentation on how to use enable debug information in the JIT and use it with GDB.
llvm-svn: 82425
2009-09-21 02:34:59 +00:00
Chris Lattner b9f2bf46f7 fix a FileCheck bug where:
; CHECK: foo
; CHECK-NOT: foo
; CHECK: bar

would always fail.

llvm-svn: 82424
2009-09-21 02:30:42 +00:00
Daniel Dunbar c05f9a60d9 Move ARM and X86 specific AsmParser tests into separate subdirectories, and only
run if appropriate target is supported.

llvm-svn: 82419
2009-09-21 00:05:30 +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
Daniel Dunbar ffb60d566f Work around a FileCheck bug, for now.
llvm-svn: 82416
2009-09-20 23:30:31 +00:00
Chris Lattner 5a3a854205 simplify as daniel suggests
llvm-svn: 82415
2009-09-20 22:56: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 05593db193 grammaro
llvm-svn: 82412
2009-09-20 22:45:18 +00:00
Chris Lattner 7e6d56ebc5 Revert r82404, it is causing a bootstrap miscompile. This is very very
scary, as it indicates a lurking bug. yay.

llvm-svn: 82411
2009-09-20 22:44:26 +00:00
Chris Lattner 3718358476 rewrite CountNumNewlinesBetween to be in terms of StringRef.
llvm-svn: 82410
2009-09-20 22:42:44 +00:00
Chris Lattner 973f14c8fa this was not supposed to be committed
llvm-svn: 82409
2009-09-20 22:36:11 +00:00
Chris Lattner 236d2d5e7b implement and document support for CHECK-NOT
llvm-svn: 82408
2009-09-20 22:35:26 +00:00
Chris Lattner caa5fc0c9d rewrite FileCheck in terms of StringRef instead of manual pointer pairs.
llvm-svn: 82407
2009-09-20 22:11:44 +00:00
Chris Lattner eea16a168a improve memdep to eliminate bitcasts (and aliases, and noop geps)
early for the stated reasons: this allows it to find more 
equivalences and depend less on code layout.

llvm-svn: 82404
2009-09-20 21:00:18 +00:00
Chris Lattner a0aa8fb6a6 Move CoerceAvailableValueToLoadType earlier in GVN.cpp. Hook it up
so that nonlocal and partially redundant loads can use it as well.
The testcase shows examples of craziness this can handle.  This triggers
*many* times in 176.gcc.

llvm-svn: 82403
2009-09-20 20:09:34 +00:00
Chris Lattner 7c62d8a1a8 change the interface to CoerceAvailableValueToLoadType to be
more generic.

llvm-svn: 82402
2009-09-20 19:31:14 +00:00
Daniel Dunbar 0b65298f7a Teach 'make check-all' to build the site configuration for clang, if it is in tree.
llvm-svn: 82400
2009-09-20 19:04:28 +00:00
Chris Lattner 1dd48c34e5 enhance GVN to forward substitute a stored value to a load
(and load -> load) when the base pointers must alias but when
they are different types.  This occurs very very frequently in
176.gcc and other code that uses bitfields a lot.

llvm-svn: 82399
2009-09-20 19:03:47 +00:00
Chris Lattner fc2d846dc8 update an entry, delete an entry which has been fixed.
llvm-svn: 82398
2009-09-20 17:37:38 +00:00
Chris Lattner bb1a1bd2bd tidy up
llvm-svn: 82397
2009-09-20 17:32:21 +00:00
Bill Wendling 692a3ea0b7 --- Reverse-merging r82282 into '.':
U    lib/CodeGen/AsmPrinter/DwarfException.cpp
U    lib/CodeGen/AsmPrinter/DwarfException.h

--- Reverse-merging r82274 into '.':
U    lib/Target/TargetLoweringObjectFile.cpp
G    lib/CodeGen/AsmPrinter/DwarfException.cpp

These revisions were breaking everything.

llvm-svn: 82396
2009-09-20 09:13:15 +00:00
Chris Lattner 13306a1fff remove a temporary hack.
llvm-svn: 82395
2009-09-20 07:47:59 +00:00
Chris Lattner 5159bbaf9e rename X86ATTAsmPrinter.cpp -> X86AsmPrinter.cpp likewise the .h file.
llvm-svn: 82394
2009-09-20 07:41:30 +00:00
Chris Lattner 40d9a5319a move target registry stuff to X86ATTAsmPrinter.cpp
llvm-svn: 82393
2009-09-20 07:39:06 +00:00
Chris Lattner b95a9cd6a7 simplify this now that createX86CodePrinterPass is trivial
llvm-svn: 82392
2009-09-20 07:37:51 +00:00
Chris Lattner 288a95da0c rename X86ATTAsmPrinter class -> X86AsmPrinter
llvm-svn: 82391
2009-09-20 07:35:34 +00:00
Chris Lattner 00b4508bb0 remove the asmstring, it is now dead. Improve comment.
llvm-svn: 82390
2009-09-20 07:32:00 +00:00
Nick Lewycky 9b3ed87506 Peer through zext and sext to eliminate them when it is safe to do so.
llvm-svn: 82389
2009-09-20 07:31:25 +00:00
Chris Lattner a93dcf1bc0 kill off printPICLabel now, it's specialness is handled by
the MachineInstr ->MCInst lowering process, not in the 
asmprinter.

llvm-svn: 82388
2009-09-20 07:28:26 +00:00
Chris Lattner 609fbed49f delete X86IntelAsmPrinter! Now -x86-asm-syntax just switches
the instruction syntax, not the entire asmprinter.

llvm-svn: 82387
2009-09-20 07:25:17 +00:00
Nick Lewycky b0225ba289 Fold 'icmp eq (icmp), true' into an xor(icmp).
llvm-svn: 82386
2009-09-20 07:21:39 +00:00
Chris Lattner 4479034537 Add an intel syntax MCInstPrinter implementation. You can now
transcode from AT&T to intel syntax with "llvm-mc foo.s -output-asm-variant=1"

llvm-svn: 82385
2009-09-20 07:17:49 +00:00
Chris Lattner 78f908c877 tidy up
llvm-svn: 82384
2009-09-20 07:16:54 +00:00
Nick Lewycky 22fc051bd7 Rewrite this check so that it checks what it's supposed to and doesn't use
CHECK-NOT.

llvm-svn: 82383
2009-09-20 07:00:24 +00:00
Chris Lattner a15f0044a0 eliminate a use of strtoul.
llvm-svn: 82382
2009-09-20 06:58:54 +00:00
Chris Lattner 17ec6b11d2 split random COFF asmprinter state out to X86COFFMachineModuleInfo.h.
Make dllexport directives come out in determinstic order.

llvm-svn: 82381
2009-09-20 06:45:52 +00:00
Nick Lewycky ff550aa36d Correct the comment; this applies to fcmp too.
llvm-svn: 82380
2009-09-20 06:27:35 +00:00
Nick Lewycky 0f8348e85b Remove tab, again.
llvm-svn: 82379
2009-09-20 06:26:34 +00:00
Nick Lewycky 28260409f2 Teach the constant folder how to not a cmpinst.
llvm-svn: 82378
2009-09-20 06:24:51 +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
Chris Lattner 131dca9c48 minor cleanups.
llvm-svn: 82375
2009-09-20 06:18:38 +00:00
Daniel Dunbar f2719e6c6a Add 'make check-all', which runs the LLVM tests along with the clang tests if
its in the standard location.

llvm-svn: 82374
2009-09-20 06:17:21 +00:00
Daniel Dunbar b18efec822 Follow googletest logic for suppressing warnings in unittests/UnitTestMain.
llvm-svn: 82373
2009-09-20 06:17:12 +00:00
Chris Lattner 00f53807c3 strength reduce further StringRef-> const char*, saving another 620 bytes.
llvm-svn: 82372
2009-09-20 05:53:47 +00:00
Nick Lewycky 4a03452077 Try turning icmp(bitcast(x), bitcast(y)) into icmp(bitcast(bitcast(x)), y) in
the hopes that the two bitcasts will merge.

llvm-svn: 82371
2009-09-20 05:48:50 +00:00
Chris Lattner b1f2e101db switch an std::string to StringRef, shaving 400 bytes off CommandLine.o
llvm-svn: 82370
2009-09-20 05:48:01 +00:00
Nick Lewycky 2b31b53d97 Remove tabs I added.
llvm-svn: 82369
2009-09-20 05:47:45 +00:00
Chris Lattner 6ec8caf003 the switch from std::map -> StringMap caused --help output to be in
non-sorted order, restore the sort.

llvm-svn: 82368
2009-09-20 05:37:24 +00:00
Chris Lattner 8d0309daa0 eliminate the duplicate detection loop, moving it into the loop that populates the Opts vector in the first place.
llvm-svn: 82367
2009-09-20 05:22:52 +00:00
Chris Lattner 64dbb5ca5a Eliminate a masochistic "algorithm" loop, shrinking CommandLine.o from 71524->70700 bytes.
llvm-svn: 82366
2009-09-20 05:18:28 +00:00
Chris Lattner 28610b9878 don't use count + insert, just do insert + failure. Also, instead of deleting from
the middle of a vector, swap the last element in and pop_back.  Also saves 330 bytes :)

llvm-svn: 82365
2009-09-20 05:15:12 +00:00
Chris Lattner 41f8b0b7a6 switch to SmallPtrSet instead of std::set, saving 1K from the
release-asserts .o file (72900->71856).

llvm-svn: 82364
2009-09-20 05:12:14 +00:00
Chris Lattner f74e28abfa change an std::sort to an array_pod_sort call, shrinking CommandLine.o by 9%.
llvm-svn: 82363
2009-09-20 05:06:23 +00:00
Chris Lattner e7c1e210c7 Several changes together in a murky mess:
1. Change some "\n" -> '\n'.
2. eliminte some std::string's by using raw_ostream::indent.
3. move a bunch of code out of the main arg parser routine into
   a new static HandlePrefixedOrGroupedOption function.
4. Greatly simplify the implementation of getOptionPred, and make
   it avoid splitting prefix options at = when that doesn't match
   a non-prefix option.

llvm-svn: 82362
2009-09-20 05:03:30 +00:00
Nick Lewycky 9e085545f8 Clean up the usage of evaluateICmpRelation's return value.
Add another line to the ConstantExprFold test to demonstrate the GEPs may not
wrap around in either the signed or unsigned senses.

llvm-svn: 82361
2009-09-20 04:27:06 +00:00
Daniel Dunbar ecbb126e34 Fix refacto, this code was expecting to stride past the argument prefix.
llvm-svn: 82360
2009-09-20 04:03:41 +00:00
Daniel Dunbar 6058b51f8c Strip trailing whitespace.
llvm-svn: 82359
2009-09-20 04:03:34 +00:00
Daniel Dunbar 97f0970671 A few more tabs -> spaces.
llvm-svn: 82358
2009-09-20 04:03:25 +00:00
Nick Lewycky 2949a2398c Remove dead store by taking a guess at what Chris meant. I wasn't able to
design a testcase that would tickle this behaviour.

llvm-svn: 82357
2009-09-20 03:48:46 +00:00
Bill Wendling f878d70720 Still one more thing wrong here...
llvm-svn: 82356
2009-09-20 02:27:06 +00:00
Daniel Dunbar 7d6781b0fe Tabs -> spaces, and remove trailing whitespace.
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Bill Wendling 0f899601f3 Here's fun! It turns out that these filter functions can be internal. If they're
internal, they shouldn't use the indirect pointer stuff. In the case of
throw_rethrow_test, it was marked as 'internal' and calculated its own offset to
its contents.

llvm-svn: 82354
2009-09-20 02:19:49 +00:00
Nick Lewycky 595b3dfcbe Delete dead code. sext and zext can not turn integers into pointers. Further,
the optimization described in the comment is only valid with target data.

llvm-svn: 82353
2009-09-20 02:11:47 +00:00
Chris Lattner 5a3fa4ef33 convert argname to StringRef, simplifying LookupOption.
llvm-svn: 82352
2009-09-20 02:02:24 +00:00
Chris Lattner 0a40a975dd convert 'Value' to StringRef which makes it easier to
maintain the "null is unspecified, empty is empty" semantics.

llvm-svn: 82351
2009-09-20 01:53:12 +00:00
Chris Lattner 40fef8032e Change CommaSeparated processing to do it with StringRef instead of temporary std::strings.
This requires StringRef'izing ProvideOption which I also did.

llvm-svn: 82350
2009-09-20 01:49:31 +00:00
Nick Lewycky e0332983fd Value* were never meant to be const. Removing constness from the constant
folder removes a lot of const_casting and requires no changes to clang or
llvm-gcc.

llvm-svn: 82349
2009-09-20 01:35:59 +00:00
Chris Lattner 77c2724360 rewrite ParseCStringVector in terms of stringref.
llvm-svn: 82348
2009-09-20 01:33:46 +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 1b88fbdaa3 coding style cleanup
llvm-svn: 82346
2009-09-20 01:11:23 +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
Dale Johannesen a894053a9b When computing live intervals for earlyclobber operands,
we pushed the beginning of the interval back 1, so the
interval would overlap with inputs that die.  We were
also pushing the end of the interval back 1, though,
which means the earlyclobber didn't overlap with other
output operands.  Don't do this.  PR 4964.

llvm-svn: 82342
2009-09-20 00:36:41 +00:00
Chris Lattner ca2552d9f9 avoid a bunch of malloc thrashing for PositinoalVals by eliminating
a std::vector and a bunch of std::string temporaries.

llvm-svn: 82341
2009-09-20 00:07:40 +00:00
Nick Lewycky 605109d151 Teach the constant folder how to handle a few simple i1 cases.
llvm-svn: 82340
2009-09-20 00:04:02 +00:00
Chris Lattner fa9c6f43a0 Avoid some temporary strings.
llvm-svn: 82339
2009-09-19 23:59:02 +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
Bill Wendling 85689b2065 Revert r82274. It's causing failures in the CINT2006 benchmarks.
llvm-svn: 82336
2009-09-19 22:02:37 +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 be22ec4cfc Fix indentation.
llvm-svn: 82333
2009-09-19 20:40:14 +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
Nick Lewycky 3b8bd05081 Add a comment explaining why you would ever want to do this.
llvm-svn: 82319
2009-09-19 19:00:06 +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
Duncan Sands 1636b7ef47 The flag "--dot-cfg-only" is at the moment equivalent to the flag "--dot-cfg".
It prints the content of all bbs, instead of printing empty bbs to make the
CFG more readable.  Fix this.  Patch by Tobias Grosser.

llvm-svn: 82315
2009-09-19 11:25:44 +00:00
Evan Cheng b82b5514fe Fix funky comments.
llvm-svn: 82314
2009-09-19 10:09:15 +00:00
Evan Cheng 1c69c47b23 Update comments.
llvm-svn: 82313
2009-09-19 10:08:51 +00:00
Benjamin Kramer 543d9b2fba Try to speed up the slowest parts of the CommandLine library
- Replace std::map<std::string with StringMap
- Eliminate unnecessary std::string copies
- ~10% speed-up for clang's testsuite on my machine (debug build)

llvm-svn: 82312
2009-09-19 10:01:45 +00:00
Evan Cheng 9827ad39a7 Fix PR4926. When target hook EmitInstrWithCustomInserter() insert new basic blocks and update CFG, it should also inform sdisel of the changes so the phi source operands will come from the right basic blocks.
llvm-svn: 82311
2009-09-19 09:51:03 +00:00
Victor Hernandez 5d034499ad Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
Reviewed by Dan Gohman.

llvm-svn: 82300
2009-09-18 22:35:49 +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
Bob Wilson 8c33d67fbf Fix a comment typo and some whitespace.
llvm-svn: 82285
2009-09-18 21:43:11 +00:00
Bob Wilson 3c21a35908 Fix a typo in an assertion message.
llvm-svn: 82284
2009-09-18 21:42:44 +00:00
Bill Wendling 053237109a Factor out label difference creation.
llvm-svn: 82282
2009-09-18 21:37:56 +00:00
Victor Hernandez 537d8d99be Enhance analysis passes so that they apply the same analysis to malloc calls as to MallocInst.
Reviewed by Eli Friedman.

llvm-svn: 82281
2009-09-18 21:34:51 +00:00
Dan Gohman 51f5442403 Delete the label names from this test to make it less fragile.
llvm-svn: 82276
2009-09-18 21:23:12 +00:00
Bill Wendling 43f2cd7757 It's inefficient to have place the exception tables (which contain the LSDA)
into the __DATA section. At launch time, dyld has to update most of the section
to fix up the type info pointers. It's better to place it into the __TEXT
section and use pc-rel indirect pointer encodings. Similar to the personality
routine.

llvm-svn: 82274
2009-09-18 21:14:36 +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
Shantonu Sen 7ba874bb5e Fix cmake build, which has a different -I that
causes the "../foo" to not find the file

llvm-svn: 82270
2009-09-18 20:35:59 +00:00
Chris Lattner 3a78ce3a56 Make a new X8632_MachoTargetObjectFile TLOF implementation whose
getSymbolForDwarfGlobalReference is smart enough to know that it 
needs to register the stub it references with MachineModuleInfoMachO,
so that it gets emitted at the end of the file.

Move stub emission from X86ATTAsmPrinter::doFinalization to the
new X86ATTAsmPrinter::EmitEndOfAsmFile asmprinter hook.  The important
thing here is that EmitEndOfAsmFile is called *after* the ehframes are
emitted, so we get all the stubs.

This allows us to remove a gross hack from the asmprinter where it would
"just know" that it needed to output stubs for personality functions.
Now this is all driven from a consistent interface.

The testcase change is just reordering the expected output now that the
stubs come out after the ehframe instead of before.

This also unblocks other changes that Bill wants to make.

llvm-svn: 82269
2009-09-18 20:22:52 +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
Dale Johannesen 5e9a5c3664 Model the carry bit on ppc32. Without this we could
move a SUBFC (etc.) below the SUBFE (etc.) that consumed
the carry bit.  Add missing ADDIC8, noticed along the way.

llvm-svn: 82266
2009-09-18 20:15:22 +00:00