Commit Graph

44076 Commits

Author SHA1 Message Date
Dan Gohman e62632e0bb When LSR is replacing an instruction, call
ScalarEvolution::deleteValueFromRecords on it before doing the
replaceAllUsesWith, because ScalarEvolution looks at the instruction's
users to find SCEV references to the instruction's SCEV object in its
internal maps.

Move all of LSR's loop-related state clearing after processing the loop
and before cleaning up dead PHI nodes. This eliminates all of LSR's SCEV
references just before the calls to ScalarEvolution::deleteValueFromRecords
so that when ScalarEvolution drops its own SCEV references, the reference
counts will reach zero and the SCEVs will be deleted immediately.

These changes fix some compiler aborts involving ScalarEvolution holding
onto and reusing SCEV objects for instructions that have been deleted.
No regression test unfortunately; because the symptoms were due to
dangling pointers, reduced testcases ended up being fairly arbitrary.

llvm-svn: 51359
2008-05-21 00:54:12 +00:00
Bill Wendling ff077b003b Reverting r51218 because of breakage on PPC32.
llvm-svn: 51358
2008-05-20 23:54:27 +00:00
Gabor Greif d01c562e48 Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.
llvm-svn: 51357
2008-05-20 22:07:21 +00:00
Chris Lattner b76ad168dc Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
hoist them.

llvm-svn: 51356
2008-05-20 22:05:28 +00:00
Dan Gohman 0843435b36 Oops, commit the version of this test that actually works.
llvm-svn: 51351
2008-05-20 21:19:36 +00:00
Dan Gohman 81ab753b14 Port SelectionDAG's ComputeNumSignBits-using code to instcombine,
now that instcombine also has ComputeNumSignBits.

llvm-svn: 51350
2008-05-20 21:01:12 +00:00
Gabor Greif 1e427c3264 sabre brings to my attention that the 'tr' suffix is also obsolete
llvm-svn: 51349
2008-05-20 21:00:03 +00:00
Dan Gohman fe13618682 Port the fix for the select operator from instcombine's
ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.

llvm-svn: 51348
2008-05-20 20:59:51 +00:00
Dan Gohman c1a4e212a3 Code simplification.
llvm-svn: 51345
2008-05-20 20:56:33 +00:00
Chris Lattner b54c30fab3 Clarify that and/or/xor/sdiv etc all allow vectors.
llvm-svn: 51335
2008-05-20 20:48:21 +00:00
Steve Naroff 52ef6f5231 Add SemaInit.cpp to VC++ proj.
llvm-svn: 51330
2008-05-20 20:39:37 +00:00
Chris Lattner e1d4c2eceb Clarify copyright transfer when you don't own the copyright of
the contributed code.

llvm-svn: 51329
2008-05-20 20:06:53 +00:00
Gabor Greif f45ff35bfe Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.
llvm-svn: 51328
2008-05-20 19:52:04 +00:00
Evan Cheng f945f94397 movsd and movq do not require 16-byte alignment. This fixes vec_set-5.ll on Linux.
llvm-svn: 51327
2008-05-20 18:24:47 +00:00
Nuno Lopes 27f8407406 initialize variable and fix a bunch of test failures
llvm-svn: 51326
2008-05-20 18:03:51 +00:00
Nuno Lopes 652eaab03c fix warning with gcc 4.1 (ptr to bool convertion)
llvm-svn: 51324
2008-05-20 17:33:56 +00:00
Chris Lattner b8b9805cc2 "The two generated files in the AsmParser.vcproj are pointing to the
wrong directory, this is the patch to fix it (also attached)."

Patch by 'OvermindDL1'

llvm-svn: 51323
2008-05-20 17:27:57 +00:00
Eli Friedman cc6b071c1e Remove hacks from ASTContext now that alignment gets reported correctly.
llvm-svn: 51322
2008-05-20 15:17:39 +00:00
Eli Friedman 7cef49e2d8 Missed an include.
llvm-svn: 51321
2008-05-20 14:27:34 +00:00
Eli Friedman 1ca6476ac5 Minor correction for PPC targets.
llvm-svn: 51320
2008-05-20 14:25:01 +00:00
Eli Friedman b53660698a Some small changes to make the target info a bit more accurate.
llvm-svn: 51319
2008-05-20 14:21:01 +00:00
Eli Friedman d5a55bd466 Perform stricter/more accurate checking for C99 constant expressions
in Sema, per discussion on mailing list.  This doesn't cause any changes 
in the test results.  I'll probably add some more tests at some point, 
but it's an open question what we need to accept to be compatible with 
real code.

This doesn't touch the existing isConstantExpr method on Expr; that 
should be addressed somehow eventually (either removed or refined to 
whatever is appropriate).

llvm-svn: 51318
2008-05-20 13:48:25 +00:00
Eli Friedman 9e9b046ac9 Add a couple more headers. stddef was discussed on cfe-dev, and
consensus was that it was fine; iso646 is trivial.

We actually don't need that many headers overall... on Ubuntu, at least, 
all we need are stdint.h, stdarg.h, limits.h, and float.h to stop 
depending on having gcc's headers around for normal code.

On a side note, the path searching needs some improvement; I had to 
hardcode the path to my header directory into clang.cpp to get the 
driver to use it consistently.

llvm-svn: 51317
2008-05-20 13:34:26 +00:00
Eli Friedman 4b44e2ee8c Test from PR2332; bug already fixed by r51311.
llvm-svn: 51316
2008-05-20 12:55:29 +00:00
Matthijs Kooijman 3f95ba0498 Clarify the testing documentation a bit and solve two HTML validator warnings.
llvm-svn: 51313
2008-05-20 10:28:55 +00:00
Eli Friedman 3ed1d5f496 Disable the function address cache; this doesn't have any ill effects,
as far as I can tell, and it fixes code like test/CodeGen/functions.c.

(Whatever performance effect it might have, crashing on a 
construct like this isn't really acceptable; I've run into this 
multiple times.)

llvm-svn: 51312
2008-05-20 09:21:07 +00:00
Eli Friedman 2460b0c941 Fix the scope of K&R-style argument declarations so that they don't
extend beyond the end of the function.

I'm not completely sure this is the right way to fix this bug, so 
someone familiar with the parser should double-check.

llvm-svn: 51311
2008-05-20 09:10:20 +00:00
Eli Friedman f77daf5e58 Fix test (it was incorrectly succeeding).
llvm-svn: 51310
2008-05-20 09:04:19 +00:00
Eli Friedman 53e38bd6b6 Add codegen support for stack address intrinsics.
llvm-svn: 51309
2008-05-20 08:59:34 +00:00
Eli Friedman 503731aa22 Fix typo in test.
llvm-svn: 51308
2008-05-20 08:27:04 +00:00
Eli Friedman f8353034eb Add __builtin_frame_address and __builtin_return_address gcc builtins to
Sema. No codegen yet.

llvm-svn: 51307
2008-05-20 08:23:37 +00:00
Evan Cheng 0609ab646b More local spiller complexity!
If local spiller optimization turns some instruction into an identity copy, it will be removed. If the output register happens to be dead (and source is obviously killed), transfer the kill / dead information to last use / def in the same MBB.

llvm-svn: 51306
2008-05-20 08:13:21 +00:00
Evan Cheng c8b028daa4 Don't spill dead def.
llvm-svn: 51305
2008-05-20 08:10:37 +00:00
Eli Friedman 4b0e2a30e0 Implement codegen for comma operator for structs.
llvm-svn: 51304
2008-05-20 07:56:31 +00:00
Matthijs Kooijman 5148a4ba66 Fix typo.
llvm-svn: 51303
2008-05-20 07:26:45 +00:00
Chris Lattner 7ac943fffd Teach instcombine 4 new xforms:
(add (sext x), cst) --> (sext (add x, cst'))
  (add (sext x), (sext y)) --> (sext (add int x, y))
  (add double (sitofp x), fpcst) --> (sitofp (add int x, intcst))
  (add double (sitofp x), (sitofp y)) --> (sitofp (add int x, y))

This generally reduces conversions.  For example MiBench/telecomm-gsm
gets these simplifications:

HACK2: 	%tmp67.i142.i.i = sext i16 %tmp6.i141.i.i to i32		; <i32> [#uses=1]
	%tmp23.i139.i.i = sext i16 %tmp2.i138.i.i to i32		; <i32> [#uses=1]
	%tmp8.i143.i.i = add i32 %tmp67.i142.i.i, %tmp23.i139.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i121.i.i = sext i16 %tmp6.i120.i.i to i32		; <i32> [#uses=1]
	%tmp23.i118.i.i = sext i16 %tmp2.i117.i.i to i32		; <i32> [#uses=1]
	%tmp8.i122.i.i = add i32 %tmp67.i121.i.i, %tmp23.i118.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i.i190.i = sext i16 %tmp6.i.i189.i to i32		; <i32> [#uses=1]
	%tmp23.i.i187.i = sext i16 %tmp2.i.i186.i to i32		; <i32> [#uses=1]
	%tmp8.i.i191.i = add i32 %tmp67.i.i190.i, %tmp23.i.i187.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i173.i.i.i = sext i16 %tmp6.i172.i.i.i to i32		; <i32> [#uses=1]
	%tmp23.i170.i.i.i = sext i16 %tmp2.i169.i.i.i to i32		; <i32> [#uses=1]
	%tmp8.i174.i.i.i = add i32 %tmp67.i173.i.i.i, %tmp23.i170.i.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i152.i.i.i = sext i16 %tmp6.i151.i.i.i to i32		; <i32> [#uses=1]
	%tmp23.i149.i.i.i = sext i16 %tmp2.i148.i.i.i to i32		; <i32> [#uses=1]
	%tmp8.i153.i.i.i = add i32 %tmp67.i152.i.i.i, %tmp23.i149.i.i.i		; <i32> [#uses=3]
HACK2: 	%tmp67.i.i.i.i = sext i16 %tmp6.i.i.i.i to i32		; <i32> [#uses=1]
	%tmp23.i.i5.i.i = sext i16 %tmp2.i.i.i.i to i32		; <i32> [#uses=1]
	%tmp8.i.i7.i.i = add i32 %tmp67.i.i.i.i, %tmp23.i.i5.i.i		; <i32> [#uses=3]


This also fixes a bug in ComputeNumSignBits handling select and
makes it more aggressive with and/or.

llvm-svn: 51302
2008-05-20 05:46:13 +00:00
Eli Friedman d0e48ea682 Be a bit more defensive in SemaInit.
llvm-svn: 51301
2008-05-20 05:25:56 +00:00
Eli Friedman 37a186d765 Add some more checking for compound literals.
llvm-svn: 51300
2008-05-20 05:22:08 +00:00
Ted Kremenek 78aa98f7b8 Reclaim memory from chains of ScopedDecls, and reclaim memory for the initializers of EnumConstantDecls.
llvm-svn: 51299
2008-05-20 04:49:55 +00:00
Ted Kremenek 40e489dfd8 Delete AST nodes, not just Decls.
llvm-svn: 51298
2008-05-20 04:10:52 +00:00
Ted Kremenek fa8a09e0bc Reclaim memory allocated for ParmVarDecl's in FunctionDecl::Destroy.
Fixed a bug in ParmVarDecl::param_end(): Handle the case where there are no
ParmVarDecls for a FunctionDecl, but its function prototype has formal arguments
(can happen with typedefs).

llvm-svn: 51297
2008-05-20 03:56:00 +00:00
Chris Lattner 9c27f96d04 fix two issues Neil noticed, thanks!
llvm-svn: 51296
2008-05-20 03:50:52 +00:00
Chris Lattner f479856957 Add a bool to isEdgeFeasible that tells it whether to treat unknown
value as undef or untracked.

llvm-svn: 51295
2008-05-20 03:39:39 +00:00
Ted Kremenek 878ff6c04d When serializing FunctionDecl, serialize out a reference to the previous declaration.
llvm-svn: 51294
2008-05-20 03:33:58 +00:00
Dan Gohman 69ddfbfe9e Fix ExecutionEngine's constant code to work properly when structs and arrays
will become first-class types.

llvm-svn: 51293
2008-05-20 03:20:09 +00:00
Dan Gohman e5572706e8 Refine the fix in r51169 to only apply when the operand val being
replaced is a PHI. This prevents it from inserting uses before defs
in the case that it isn't a PHI and it depends on other instructions
later in the block. This fixes the 447.dealII regression on x86-64.

llvm-svn: 51292
2008-05-20 03:01:48 +00:00
Evan Cheng 974722b16f runOnMachineFunction should set IsPIC because relocation model may have been changed.
llvm-svn: 51291
2008-05-20 01:56:59 +00:00
Dan Gohman d717761a2b Make AssociativeOpt static.
llvm-svn: 51290
2008-05-20 01:14:05 +00:00
Dan Gohman cd2e772d08 Run vortex-bug as x86-64, which is what the original bug was triggered on.
llvm-svn: 51289
2008-05-20 00:54:39 +00:00
Ted Kremenek b865b38eda Remove unnecessary #include (introduced by a recent patch of mine).
llvm-svn: 51288
2008-05-20 00:47:23 +00:00