Commit Graph

68438 Commits

Author SHA1 Message Date
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
Anders Carlsson d6020c321a Record layout builder cleanup.
llvm-svn: 82502
2009-09-22 00:04:45 +00:00
John McCall 9dd450bb78 Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely.  Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.

llvm-svn: 82501
2009-09-21 23:43:11 +00:00
Ted Kremenek fd68c7bdc0 Add test case for <rdar://problem/6829164>, which was implicitly fixed in r79694.
llvm-svn: 82495
2009-09-21 23:22:11 +00:00
Fariborz Jahanian 71848a3ff1 Removed -fobjc-newgc-api option. clang now conforms to
gcc-style write-barrier api only.

llvm-svn: 82493
2009-09-21 23:03:37 +00:00
Ted Kremenek 25c9c1427a Provide intermediate solution to handling assignments to structs via an
integer pointer.  For now just invalidate the fields of the struct.

This addresses: <rdar://problem/7185607> [RegionStore] support invalidation of bit fields using integer assignment

llvm-svn: 82492
2009-09-21 22:58:52 +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
Douglas Gregor ac9b61375d Another code-completion TODO
llvm-svn: 82482
2009-09-21 20:52:01 +00:00
Douglas Gregor 9d64c5e3a5 Code completion for ordinary names when we're starting a declaration, expression, or statement
llvm-svn: 82481
2009-09-21 20:51:25 +00:00
Fariborz Jahanian a74039426d -fobjc-newgc-api is now the default.
llvm-svn: 82478
2009-09-21 20:17:37 +00:00
Douglas Gregor 2af2f670d1 When providing a code-completion suggestion for a hidden name, include
a nested-name-specifier that describes how to refer to that name. For
example, given:

  struct Base { int member; };
  struct Derived : Base { int member; };

the code-completion result for a member access into "Derived" will
provide both "member" to refer to Derived::member (no qualification needed) and
"Base::member" to refer to Base::member (qualification included).

llvm-svn: 82476
2009-09-21 20:12:40 +00:00
Douglas Gregor f251067530 Enhance "case" code completion in C++ to suggest qualified names for
enumerators when either the user intentionally wrote a qualified name
(in which case we just use that nested-name-specifier to match
the user's code) or when this is the first "case" statement and we
need a qualified name to refer to an enumerator in a different scope.

llvm-svn: 82474
2009-09-21 19:57:38 +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
Fariborz Jahanian 38c3ae9bc4 Miscellanous fixes in generatation of objc gc's write-barriers.
llvm-svn: 82472
2009-09-21 18:54:29 +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
Douglas Gregor d328d57c39 Code completion for "case" statements within a switch on an expression
of enumeration type, providing the various unused enumerators as options.

llvm-svn: 82467
2009-09-21 18:10:23 +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
Douglas Gregor 3545ff43f4 Refactor and simplify the CodeCompleteConsumer, so that all of the
real work is performed within Sema. Addresses Chris's comments, but
still retains the heavyweight list-of-multimaps data structure.

llvm-svn: 82459
2009-09-21 16:56:56 +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
Daniel Dunbar 607a2a1ed1 Add an XFAIL test which compiles differently from a .ast.
llvm-svn: 82437
2009-09-21 05:16:43 +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 143021e0ca Add missing PCH support for -fstack-protector.
llvm-svn: 82435
2009-09-21 04:16:19 +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 bf20638966 Implement __builtin_unreachable(), a GCC 4.5 extension.
llvm-svn: 82433
2009-09-21 03:09:59 +00:00
Daniel Dunbar 26e37a77c6 Switch ProcessASTInputFile to still use ParseAST.
- Currently this requires us to fake an input file.

 - This allows Sema to be keep all the logic for how to pull decls out of the external AST source and how to handle things like tentative definitions.

llvm-svn: 82432
2009-09-21 03:03:56 +00:00
Daniel Dunbar b7bbfdd9e6 Change ASTUnit to only initialize the predefines buffer to the suggested predefines.
- It isn't really clear what to do with the preprocessor here, but this is more sensible.

llvm-svn: 82431
2009-09-21 03:03:47 +00:00