Commit Graph

32366 Commits

Author SHA1 Message Date
Evan Cheng b2abe07457 Fix a obvious logic error.
llvm-svn: 82610
2009-09-23 05:23:19 +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
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 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 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 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 1a0a423b38 Use Compiler.h macro instead of __attribute__.
llvm-svn: 82532
2009-09-22 07:38:23 +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 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 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
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 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
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
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