oota-llvm.git
16 years agoUse isSingleValueType instead of isFirstClassType to
Dan Gohman [Thu, 22 May 2008 23:43:22 +0000 (23:43 +0000)]
Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51452 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a polygen grammar definition for LLVM assembly language.
Dan Gohman [Thu, 22 May 2008 22:45:03 +0000 (22:45 +0000)]
Add a polygen grammar definition for LLVM assembly language.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51449 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRecognize the "default" keyword, which is documented in LangRef.html
Dan Gohman [Thu, 22 May 2008 22:30:09 +0000 (22:30 +0000)]
Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51448 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a couple of test cases.
Evan Cheng [Thu, 22 May 2008 21:19:19 +0000 (21:19 +0000)]
Add a couple of test cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51441 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen rewriting defs and uses after spilling, don't set the weight of a
David Greene [Thu, 22 May 2008 21:16:33 +0000 (21:16 +0000)]
When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction.  We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51440 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't attempt to update SpillSlotToUsesMap for stack slots that aren't
David Greene [Thu, 22 May 2008 21:12:21 +0000 (21:12 +0000)]
Don't attempt to update SpillSlotToUsesMap for stack slots that aren't
generated by the spiller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51439 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agotransform more loops to iterator form, detabify
Gabor Greif [Thu, 22 May 2008 19:24:54 +0000 (19:24 +0000)]
transform more loops to iterator form, detabify

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51436 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd missing patterns.
Evan Cheng [Thu, 22 May 2008 18:56:56 +0000 (18:56 +0000)]
Add missing patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51435 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSuppress warnings about missing placement delete. This should now be std-conformant...
Gabor Greif [Thu, 22 May 2008 13:16:42 +0000 (13:16 +0000)]
Suppress warnings about missing placement delete. This should now be std-conformant even if compiled with exceptions on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51429 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86...
Gabor Greif [Thu, 22 May 2008 06:43:33 +0000 (06:43 +0000)]
Rewrite operand loops to use iterators. This shrinks .o file (at gcc4.0.1 -O3 x86) substantially (>500 bytes). Reason still unknown.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51423 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix an off-by-one error in my previous patch, don't treat the callee as a incoming...
Chris Lattner [Thu, 22 May 2008 06:29:38 +0000 (06:29 +0000)]
fix an off-by-one error in my previous patch, don't treat the callee as a incoming arg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51422 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd support for multiple-return values in inline asm. This should
Chris Lattner [Thu, 22 May 2008 06:19:37 +0000 (06:19 +0000)]
Add support for multiple-return values in inline asm.  This should
get inline asm working as well as it did previously with the CBE
with the new MRV support for inline asm.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51420 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2267, by allowing indirect outputs to be intermixed
Chris Lattner [Thu, 22 May 2008 04:46:38 +0000 (04:46 +0000)]
Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here:
test/CodeGen/X86/asm-indirect-mem.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51409 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agotestcase for PR2267
Chris Lattner [Thu, 22 May 2008 04:45:22 +0000 (04:45 +0000)]
testcase for PR2267

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51408 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFree and vaarg are not really volatile.
Chris Lattner [Thu, 22 May 2008 03:23:06 +0000 (03:23 +0000)]
Free and vaarg are not really volatile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51407 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorewrite the validity checking for memory promotion to be simpler,
Chris Lattner [Thu, 22 May 2008 03:22:42 +0000 (03:22 +0000)]
rewrite the validity checking for memory promotion to be simpler,
more aggressive, and more correct.  Verify that we only attempt to
promote loads and stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51406 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agominor edits
Chris Lattner [Thu, 22 May 2008 03:06:14 +0000 (03:06 +0000)]
minor edits

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51405 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse 'continue' to reduce nesting in this loop. No functionality change.
Chris Lattner [Thu, 22 May 2008 00:53:38 +0000 (00:53 +0000)]
Use 'continue' to reduce nesting in this loop.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51399 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a Type::isSingleValueType method. This will be used by code
Dan Gohman [Wed, 21 May 2008 23:35:53 +0000 (23:35 +0000)]
Add a Type::isSingleValueType method. This will be used by code
that currently uses Type::isFirstClassType and depends on it
returning false for struct or array types.

This commit doesn't change the behavior of Type::isFirstClassType.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51396 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2343. An *interesting* coalescer bug.
Evan Cheng [Wed, 21 May 2008 22:34:12 +0000 (22:34 +0000)]
Fix PR2343. An *interesting* coalescer bug.

BB1:
  vr1025 = copy vr1024
  ..
BB2:
  vr1024 = op
         = op vr1025
  <loop eventually branch back to BB1>

Even though vr1025 is copied from vr1024, it's not safe to coalesced them since live range of vr1025 intersects the def of vr1024. This happens when vr1025 is assigned the value of the previous iteration of vr1024 in the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51394 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFollow-up to the reverting of r51218. This puts the checks out-of-line. Because
Bill Wendling [Wed, 21 May 2008 21:20:07 +0000 (21:20 +0000)]
Follow-up to the reverting of r51218. This puts the checks out-of-line. Because
they aren't in the header file, systems with a <string> header file that isn't
64-bit clean shouldn't warn if #including Path.h and specifying
-Wshorten-64-to-32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51393 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoupdate a comment
Gabor Greif [Wed, 21 May 2008 18:57:33 +0000 (18:57 +0000)]
update a comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51390 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadapt to new API
Gabor Greif [Wed, 21 May 2008 18:30:15 +0000 (18:30 +0000)]
adapt to new API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51387 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRename -no-lazy to -disable-lazy-compilation.
Evan Cheng [Wed, 21 May 2008 18:20:21 +0000 (18:20 +0000)]
Rename -no-lazy to -disable-lazy-compilation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51386 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a couple issues with the JIT and multiple modules:
Nate Begeman [Wed, 21 May 2008 16:34:48 +0000 (16:34 +0000)]
Fix a couple issues with the JIT and multiple modules:

1. The "JITState" object creates a PassManager with the ModuleProvider that the
   jit is created with.  If the ModuleProvider is removed and deleted, the
   PassManager is invalid.

2. The Global maps in the JIT were not invalidated with a ModuleProvider was
   removed.  This could lead to a case where the Module would be freed, and a
   new Module with Globals at the same addresses could return invalid results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51384 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoresurrect lost tests by renaming them to not end with .tr
Gabor Greif [Wed, 21 May 2008 14:48:24 +0000 (14:48 +0000)]
resurrect lost tests by renaming them to not end with .tr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51375 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosuppress gcc3.4.6's <no value returned> warnings
Gabor Greif [Wed, 21 May 2008 14:07:30 +0000 (14:07 +0000)]
suppress gcc3.4.6's <no value returned> warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51372 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWhen LSR is replacing an instruction, call
Dan Gohman [Wed, 21 May 2008 00:54:12 +0000 (00:54 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51359 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReverting r51218 because of breakage on PPC32.
Bill Wendling [Tue, 20 May 2008 23:54:27 +0000 (23:54 +0000)]
Reverting r51218 because of breakage on PPC32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51358 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoEliminate questionable syntax for stdin redirection. This probably also speeds things...
Gabor Greif [Tue, 20 May 2008 22:07:21 +0000 (22:07 +0000)]
Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51357 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2346 by marking vaarg as volatile so that licm doesn't try to
Chris Lattner [Tue, 20 May 2008 22:05:28 +0000 (22:05 +0000)]
Fix PR2346 by marking vaarg as volatile so that licm doesn't try to
hoist them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51356 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOops, commit the version of this test that actually works.
Dan Gohman [Tue, 20 May 2008 21:19:36 +0000 (21:19 +0000)]
Oops, commit the version of this test that actually works.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51351 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPort SelectionDAG's ComputeNumSignBits-using code to instcombine,
Dan Gohman [Tue, 20 May 2008 21:01:12 +0000 (21:01 +0000)]
Port SelectionDAG's ComputeNumSignBits-using code to instcombine,
now that instcombine also has ComputeNumSignBits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51350 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosabre brings to my attention that the 'tr' suffix is also obsolete
Gabor Greif [Tue, 20 May 2008 21:00:03 +0000 (21:00 +0000)]
sabre brings to my attention that the 'tr' suffix is also obsolete

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoPort the fix for the select operator from instcombine's
Dan Gohman [Tue, 20 May 2008 20:59:51 +0000 (20:59 +0000)]
Port the fix for the select operator from instcombine's
ComputeNumSignBits to SelectionDAG's ComputeNumSignBits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51348 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCode simplification.
Dan Gohman [Tue, 20 May 2008 20:56:33 +0000 (20:56 +0000)]
Code simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51345 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoClarify that and/or/xor/sdiv etc all allow vectors.
Chris Lattner [Tue, 20 May 2008 20:48:21 +0000 (20:48 +0000)]
Clarify that and/or/xor/sdiv etc all allow vectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51335 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoClarify copyright transfer when you don't own the copyright of
Chris Lattner [Tue, 20 May 2008 20:06:53 +0000 (20:06 +0000)]
Clarify copyright transfer when you don't own the copyright of
the contributed code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51329 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRename the last test with .llx extension to .ll, resolve duplicate test by renaming...
Gabor Greif [Tue, 20 May 2008 19:52:04 +0000 (19:52 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51328 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomovsd and movq do not require 16-byte alignment. This fixes vec_set-5.ll on Linux.
Evan Cheng [Tue, 20 May 2008 18:24:47 +0000 (18:24 +0000)]
movsd and movq do not require 16-byte alignment. This fixes vec_set-5.ll on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51327 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago"The two generated files in the AsmParser.vcproj are pointing to the
Chris Lattner [Tue, 20 May 2008 17:27:57 +0000 (17:27 +0000)]
"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'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51323 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoClarify the testing documentation a bit and solve two HTML validator warnings.
Matthijs Kooijman [Tue, 20 May 2008 10:28:55 +0000 (10:28 +0000)]
Clarify the testing documentation a bit and solve two HTML validator warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51313 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMore local spiller complexity!
Evan Cheng [Tue, 20 May 2008 08:13:21 +0000 (08:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51306 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't spill dead def.
Evan Cheng [Tue, 20 May 2008 08:10:37 +0000 (08:10 +0000)]
Don't spill dead def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51305 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix typo.
Matthijs Kooijman [Tue, 20 May 2008 07:26:45 +0000 (07:26 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51303 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTeach instcombine 4 new xforms:
Chris Lattner [Tue, 20 May 2008 05:46:13 +0000 (05:46 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51302 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix two issues Neil noticed, thanks!
Chris Lattner [Tue, 20 May 2008 03:50:52 +0000 (03:50 +0000)]
fix two issues Neil noticed, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51296 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a bool to isEdgeFeasible that tells it whether to treat unknown
Chris Lattner [Tue, 20 May 2008 03:39:39 +0000 (03:39 +0000)]
Add a bool to isEdgeFeasible that tells it whether to treat unknown
value as undef or untracked.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51295 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix ExecutionEngine's constant code to work properly when structs and arrays
Dan Gohman [Tue, 20 May 2008 03:20:09 +0000 (03:20 +0000)]
Fix ExecutionEngine's constant code to work properly when structs and arrays
will become first-class types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51293 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRefine the fix in r51169 to only apply when the operand val being
Dan Gohman [Tue, 20 May 2008 03:01:48 +0000 (03:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51292 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agorunOnMachineFunction should set IsPIC because relocation model may have been changed.
Evan Cheng [Tue, 20 May 2008 01:56:59 +0000 (01:56 +0000)]
runOnMachineFunction should set IsPIC because relocation model may have been changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51291 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake AssociativeOpt static.
Dan Gohman [Tue, 20 May 2008 01:14:05 +0000 (01:14 +0000)]
Make AssociativeOpt static.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51290 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRun vortex-bug as x86-64, which is what the original bug was triggered on.
Dan Gohman [Tue, 20 May 2008 00:54:39 +0000 (00:54 +0000)]
Run vortex-bug as x86-64, which is what the original bug was triggered on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51289 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSilence a warning about "*/" outside a comment.
Steve Naroff [Tue, 20 May 2008 00:46:15 +0000 (00:46 +0000)]
Silence a warning about "*/" outside a comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51287 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDo not erase induction variable increment if it is used outside the loop.
Devang Patel [Mon, 19 May 2008 22:23:55 +0000 (22:23 +0000)]
Do not erase induction variable increment if it is used outside the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51280 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a ComputeNumSignBits function for use by instcombine, based on the
Dan Gohman [Mon, 19 May 2008 22:14:15 +0000 (22:14 +0000)]
Add a ComputeNumSignBits function for use by instcombine, based on the
code in SelectionDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51279 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoHandle quoted names when constructing $stub's,
Dale Johannesen [Mon, 19 May 2008 21:38:18 +0000 (21:38 +0000)]
Handle quoted names when constructing $stub's,
$non_lazy_ptr's and $lazy_ptr's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51277 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoswitch to Type::getFPMantissaWidth instead of reinventing it.
Chris Lattner [Mon, 19 May 2008 21:17:23 +0000 (21:17 +0000)]
switch to Type::getFPMantissaWidth instead of reinventing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51275 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd a helper method.
Chris Lattner [Mon, 19 May 2008 21:17:01 +0000 (21:17 +0000)]
add a helper method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51274 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agominor cleanups, teach instcombine that sitofp/uitofp cannot
Chris Lattner [Mon, 19 May 2008 20:27:56 +0000 (20:27 +0000)]
minor cleanups, teach instcombine that sitofp/uitofp cannot
produce a negative zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51272 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoconvert fptosi(sitofp x) -> x if the fp value has enough bits in its mantissa
Chris Lattner [Mon, 19 May 2008 20:25:04 +0000 (20:25 +0000)]
convert fptosi(sitofp x) -> x  if the fp value has enough bits in its mantissa
to accurately represent the integer.  This triggers 9 times in 471.omnetpp,
though 8 of those seem to be inlined from the same place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51271 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFold FP comparisons where one operand is converted from an integer
Chris Lattner [Mon, 19 May 2008 20:18:56 +0000 (20:18 +0000)]
Fold FP comparisons where one operand is converted from an integer
type and the other operand is a constant into integer comparisons.
This happens surprisingly frequently (e.g. 10 times in 471.omnetpp),
which are things like this:

%tmp8283 = sitofp i32 %tmp82 to double
%tmp1013 = fcmp ult double %tmp8283, 0.0

Clearly comparing tmp82 against i32 0 is cheaper here.

this also triggers 8 times in gobmk, including this one:

%tmp375376 = sitofp i32 %tmp375 to double
%tmp377 = fcmp ogt double %tmp375376, 8.150000e+01

which is comparing an integer against 81.5 :).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51268 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove warnings about unused parameters and shadowed variables.
Bill Wendling [Mon, 19 May 2008 20:15:12 +0000 (20:15 +0000)]
Remove warnings about unused parameters and shadowed variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51266 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove debug output
Chris Lattner [Mon, 19 May 2008 20:03:53 +0000 (20:03 +0000)]
remove debug output

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51264 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agobe more aggressive about transforming add -> or when the operands have no
Chris Lattner [Mon, 19 May 2008 20:01:56 +0000 (20:01 +0000)]
be more aggressive about transforming add -> or when the operands have no
intersecting bits.  This triggers all over the place, for example in lencode,
with adds of stuff like:

%tmp580 = mul i32 %tmp579, 2
%tmp582 = and i32 %b8, 1
and

%tmp28 = shl i32 %abs.i, 1
%sign.0 = select i1 %tmp23, i32 1, i32 0
and
%tmp344 = shl i32 %tmp343, 2
%tmp346 = and i32 %tmp96, 3

etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51263 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCheck that always_inline functions are inlined
Duncan Sands [Mon, 19 May 2008 16:44:44 +0000 (16:44 +0000)]
Check that always_inline functions are inlined
whether or not -funit-at-a-time is used (C++ uses
it, C doesn't) - it was working before only when
not doing unit-at-a-time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51258 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2341 - when the length is 4 use an i32 not
Duncan Sands [Mon, 19 May 2008 09:27:24 +0000 (09:27 +0000)]
Fix PR2341 - when the length is 4 use an i32 not
an i16!  Cleaned up trailing whitespace while there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51240 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoReverting accidental commit of generated files.
Gordon Henriksen [Mon, 19 May 2008 05:57:12 +0000 (05:57 +0000)]
Reverting accidental commit of generated files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51239 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove a duplicative binding. Patch by Mahadevan R.
Gordon Henriksen [Mon, 19 May 2008 05:47:10 +0000 (05:47 +0000)]
Remove a duplicative binding. Patch by Mahadevan R.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51238 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate VS project files (VS 2005) so that VS builds with TOT LLVM/clang.
Ted Kremenek [Mon, 19 May 2008 02:49:39 +0000 (02:49 +0000)]
Update VS project files (VS 2005) so that VS builds with TOT LLVM/clang.

Patch by Dmitri Makarov!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51237 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoGrammar fix.
Bill Wendling [Mon, 19 May 2008 00:25:01 +0000 (00:25 +0000)]
Grammar fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51236 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDelete module.
Bill Wendling [Mon, 19 May 2008 00:20:45 +0000 (00:20 +0000)]
Delete module.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51235 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoConvert non-ASCII apostrophes into ASCII apostrophes.
Bill Wendling [Mon, 19 May 2008 00:19:02 +0000 (00:19 +0000)]
Convert non-ASCII apostrophes into ASCII apostrophes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51234 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDelete the Module object.
Bill Wendling [Mon, 19 May 2008 00:15:33 +0000 (00:15 +0000)]
Delete the Module object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51233 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agos/insure/ensure/
Bill Wendling [Mon, 19 May 2008 00:05:30 +0000 (00:05 +0000)]
s/insure/ensure/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51232 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoignore Output dir
Gabor Greif [Sun, 18 May 2008 22:33:28 +0000 (22:33 +0000)]
ignore Output dir

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51231 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTeach GVN to not assert on vector comparisons
Nate Begeman [Sun, 18 May 2008 19:49:05 +0000 (19:49 +0000)]
Teach GVN to not assert on vector comparisons

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51230 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a backwards check in the JIT symbol table code
Nate Begeman [Sun, 18 May 2008 19:09:10 +0000 (19:09 +0000)]
Fix a backwards check in the JIT symbol table code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51229 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd missing #include.
Chris Lattner [Sun, 18 May 2008 14:24:58 +0000 (14:24 +0000)]
add missing #include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51227 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR2339
Chris Lattner [Sun, 18 May 2008 04:11:26 +0000 (04:11 +0000)]
Fix PR2339

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51226 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove empty file?
Chris Lattner [Sun, 18 May 2008 04:10:18 +0000 (04:10 +0000)]
remove empty file?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51225 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRevert constant-folding change that will miscompile in some cases.
Nick Lewycky [Sat, 17 May 2008 19:00:05 +0000 (19:00 +0000)]
Revert constant-folding change that will miscompile in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51223 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agotrip count computation deficiency
Chris Lattner [Sat, 17 May 2008 15:37:38 +0000 (15:37 +0000)]
trip count computation deficiency

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51222 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOn Darwin, the string header file isn't 64-bit clean. The use of
Bill Wendling [Sat, 17 May 2008 09:10:40 +0000 (09:10 +0000)]
On Darwin, the string header file isn't 64-bit clean. The use of
"-Wshorten-64-to-32 -Werror" will cause a failure when compiling this complex
program:

#include <string>

class Path {
  mutable std::string path;
public:
  bool operator == (const Path &that) {
    return path == that.path;
  }
};

Using strcmp gets us past this annoying error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51218 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUnbreak the build.
Nick Lewycky [Sat, 17 May 2008 09:05:22 +0000 (09:05 +0000)]
Unbreak the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51217 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoConstant fold inttoptr and ptrtoint.
Nick Lewycky [Sat, 17 May 2008 09:03:26 +0000 (09:03 +0000)]
Constant fold inttoptr and ptrtoint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51216 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove isTrueWhenEqual to ICmpInst.
Nick Lewycky [Sat, 17 May 2008 07:33:39 +0000 (07:33 +0000)]
Move isTrueWhenEqual to ICmpInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51215 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoLess conservative verison of previous patch,
Dale Johannesen [Fri, 16 May 2008 23:18:52 +0000 (23:18 +0000)]
Less conservative verison of previous patch,
suggested by Duncan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51211 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd CommonLinkage, in a way that preserves the
Dale Johannesen [Fri, 16 May 2008 22:46:40 +0000 (22:46 +0000)]
Add CommonLinkage, in a way that preserves the
behavior on old .bc files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51210 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd CommonLinkage to lto (treated same as weak AFAICT)
Dale Johannesen [Fri, 16 May 2008 22:44:18 +0000 (22:44 +0000)]
Add CommonLinkage to lto (treated same as weak AFAICT)
and llvm-nm (prints as C).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51209 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd CommonLinkage.
Dale Johannesen [Fri, 16 May 2008 22:42:11 +0000 (22:42 +0000)]
Add CommonLinkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51208 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoWeak functions not declared non-throwing might be
Dale Johannesen [Fri, 16 May 2008 21:31:48 +0000 (21:31 +0000)]
Weak functions not declared non-throwing might be
replaced at linktime with a body that throws, even
if the body in this file does not.  Make PruneEH
be more conservative in this case.
g++.dg/eh/weak1.C

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51207 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd functions to enable adding a single attribute to a function and
Eric Christopher [Fri, 16 May 2008 20:39:43 +0000 (20:39 +0000)]
Add functions to enable adding a single attribute to a function and
its associated call site.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51204 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRecord weak external linkage in a case where we were
Dale Johannesen [Fri, 16 May 2008 20:09:25 +0000 (20:09 +0000)]
Record weak external linkage in a case where we were
missing it. gcc.dg/darwin-weakimport-2.c.
Handle common and weak differently for darwin ppc32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51201 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAPI change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interf...
Gabor Greif [Fri, 16 May 2008 19:29:10 +0000 (19:29 +0000)]
API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time.  (Merge from use-diet branch.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIf the result of a BIT_CONVERT is a v1* vector, it doesn't mean its source is a v1...
Evan Cheng [Fri, 16 May 2008 17:19:05 +0000 (17:19 +0000)]
If the result of a BIT_CONVERT is a v1* vector, it doesn't mean its source is a v1* vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51192 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix test.
Evan Cheng [Fri, 16 May 2008 17:08:51 +0000 (17:08 +0000)]
Fix test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51191 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBill pointed out that system headers should be
Duncan Sands [Fri, 16 May 2008 09:30:00 +0000 (09:30 +0000)]
Bill pointed out that system headers should be
included after local headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51187 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSilence the compiler warning differently. The
Duncan Sands [Fri, 16 May 2008 09:19:16 +0000 (09:19 +0000)]
Silence the compiler warning differently.  The
original method caused gcc-4.2 to complain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51186 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRe-enable tail duplication pass (now with default threshold down to 1 instruction).
Evan Cheng [Fri, 16 May 2008 07:57:10 +0000 (07:57 +0000)]
Re-enable tail duplication pass (now with default threshold down to 1 instruction).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51184 91177308-0d34-0410-b5e6-96231b3b80d8