oota-llvm.git
14 years agofor instructions with void type we have no choice but print the instruction as
Torok Edwin [Fri, 29 May 2009 10:28:44 +0000 (10:28 +0000)]
for instructions with void type we have no choice but print the instruction as
is, otherwise we get a <badref>.

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

14 years agoAdd a DEBUG() output to GVN that prints the instruction clobbering a load.
Torok Edwin [Fri, 29 May 2009 09:46:03 +0000 (09:46 +0000)]
Add a DEBUG() output to GVN that prints the instruction clobbering a load.
This is useful when trying to figure out why GVN didn't eliminate redundant
loads.

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

14 years agoFix an issue where phiMap was not being updated properly when doing load PRE.
Owen Anderson [Fri, 29 May 2009 05:37:54 +0000 (05:37 +0000)]
Fix an issue where phiMap was not being updated properly when doing load PRE.

Diagnosis and patch thanks to Jakub Staszak.

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

14 years agoDefault isNarrowingProfitable to false.
Evan Cheng [Fri, 29 May 2009 05:31:40 +0000 (05:31 +0000)]
Default isNarrowingProfitable to false.

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

14 years agoRemove an accidental commit.
Evan Cheng [Fri, 29 May 2009 05:28:52 +0000 (05:28 +0000)]
Remove an accidental commit.

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

14 years agoMore h-registers tricks: folding zext nodes.
Evan Cheng [Fri, 29 May 2009 01:44:43 +0000 (01:44 +0000)]
More h-registers tricks: folding zext nodes.

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

14 years agoDo not try to create a MVT type of width 0.
Evan Cheng [Thu, 28 May 2009 23:52:18 +0000 (23:52 +0000)]
Do not try to create a MVT type of width 0.

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

14 years agoThe MONITOR and MWAIT instructions have insufficient information for
Bill Wendling [Thu, 28 May 2009 23:40:46 +0000 (23:40 +0000)]
The MONITOR and MWAIT instructions have insufficient information for
decoding. Essentially, they both map to the same column in the "opcode
extensions for one- and two-byte opcodes" table in the x86 manual. The RawFrm
complicates decoding this.

Instead, use opcode 0x01, prefix 0x01, and form MRM1r. Then have the code
emitter special case these, a la [SML]FENCE.

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

14 years agoNewNightlyTest.pl: Add a -parallel-jobs argument (set # of jobs for make with
Daniel Dunbar [Thu, 28 May 2009 22:45:24 +0000 (22:45 +0000)]
NewNightlyTest.pl: Add a -parallel-jobs argument (set # of jobs for make with
-parallel, instead of always using 2).

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

14 years agoAdd explicit test for PR4280.
Eli Friedman [Thu, 28 May 2009 21:04:35 +0000 (21:04 +0000)]
Add explicit test for PR4280.

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

14 years agoRe-commit r72514 and r72516 with a fixed version of BR_CC lowering.
Eli Friedman [Thu, 28 May 2009 20:40:34 +0000 (20:40 +0000)]
Re-commit r72514 and r72516 with a fixed version of BR_CC lowering.
This patch removes some special cases for opcodes and does a bit of
cleanup.

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

14 years agoFix MOVMSKPDrr encoding.
Evan Cheng [Thu, 28 May 2009 18:55:28 +0000 (18:55 +0000)]
Fix MOVMSKPDrr encoding.

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

14 years agoFix PSIGND encoding bug. Patch by Sean Callanan.
Evan Cheng [Thu, 28 May 2009 18:48:53 +0000 (18:48 +0000)]
Fix PSIGND encoding bug. Patch by Sean Callanan.

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

14 years agoIncorporate patch feedbacks.
Evan Cheng [Thu, 28 May 2009 18:41:02 +0000 (18:41 +0000)]
Incorporate patch feedbacks.

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

14 years agoNightlyTest: Write "sentdata.txt" files and run the -submit-aux script before
Daniel Dunbar [Thu, 28 May 2009 18:31:40 +0000 (18:31 +0000)]
NightlyTest: Write "sentdata.txt" files and run the -submit-aux script before
sending data to the server.
 - Otherwise if the server connection fails the external script never runs.

Also, create content before initiating connection to try and decrease time we
are connected to llvm.org.

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

14 years agoEmit debug info for locals with proper scope.
Sanjiv Gupta [Thu, 28 May 2009 18:24:11 +0000 (18:24 +0000)]
Emit debug info for locals with proper scope.

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

14 years agoTemporarily revert r72514 (and dependent patch r72516). It was causing this
Bill Wendling [Thu, 28 May 2009 18:18:59 +0000 (18:18 +0000)]
Temporarily revert r72514 (and dependent patch r72516). It was causing this
failure during llvm-gcc bootstrap:

Assertion failed: (!Tmp2.getNode() && "Can't legalize BR_CC with legal condition!"), function ExpandNode, file /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp, line 2923.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:1727: internal compiler error: Abort trap
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

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

14 years agoMark the branch insns correctly.
Sanjiv Gupta [Thu, 28 May 2009 17:32:56 +0000 (17:32 +0000)]
Mark the branch insns correctly.

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

14 years agoFixing problems that got exposed after the refactoring of LegalizeDAG done in 72447.
Sanjiv Gupta [Thu, 28 May 2009 06:59:57 +0000 (06:59 +0000)]
Fixing problems that got exposed after the refactoring of LegalizeDAG done in 72447.

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

14 years agoAdd a testcase which got fixed by recent legalization work.
Eli Friedman [Thu, 28 May 2009 05:10:20 +0000 (05:10 +0000)]
Add a testcase which got fixed by recent legalization work.

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

14 years agoRemove a couple of useless functions.
Eli Friedman [Thu, 28 May 2009 04:49:34 +0000 (04:49 +0000)]
Remove a couple of useless functions.

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

14 years agoRemove special cases for more opcodes.
Eli Friedman [Thu, 28 May 2009 04:39:57 +0000 (04:39 +0000)]
Remove special cases for more opcodes.

This is basically the end of this series of patches for LegalizeDAG; the
remaining special cases can't be removed without more infrastructure
work.  There's a FIXME for each relevant opcode near the beginning of
SelectionDAGLegalize::LegalizeOp.

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

14 years agoReturn the operand rather than a null SDValue when the given SELECT_CC
Eli Friedman [Thu, 28 May 2009 04:31:08 +0000 (04:31 +0000)]
Return the operand rather than a null SDValue when the given SELECT_CC
is actually legal.  Part of LegalizeDAG cleanups.

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

14 years agoUse Operands.data() instead of &Operands[0] where Operands is a potentially
Nick Lewycky [Thu, 28 May 2009 04:08:10 +0000 (04:08 +0000)]
Use Operands.data() instead of &Operands[0] where Operands is a potentially
empty SmallVector.

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

14 years agoRemove special case for SETCC opcode; add some comments explaining why
Eli Friedman [Thu, 28 May 2009 03:56:57 +0000 (03:56 +0000)]
Remove special case for SETCC opcode; add some comments explaining why
some special cases are necessary.

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

14 years agoThis patch brings the list of attributes in CPPBackend.cpp up to date with the
Jeffrey Yasskin [Thu, 28 May 2009 03:16:17 +0000 (03:16 +0000)]
This patch brings the list of attributes in CPPBackend.cpp up to date with the
list in Attributes.h. It also reorders the CPPBackend list to match so that
it's easier to see that it's complete.

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

14 years agoSome minor cleanups.
Eli Friedman [Thu, 28 May 2009 03:06:16 +0000 (03:06 +0000)]
Some minor cleanups.

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

14 years ago"The instructions MMX_PSADBWrm and MMX_PSADBWrr have opcode 0b11100000 (e0), but
Bill Wendling [Thu, 28 May 2009 02:04:00 +0000 (02:04 +0000)]
"The instructions MMX_PSADBWrm and MMX_PSADBWrr have opcode 0b11100000 (e0), but
the Intel manual (screenshot) says it should be 0b11110110 (f6).  The existing
encoding causes a disassembly conflict with MMX_PAVGBrm, which really should be
0f e0."

Patch by Sean Callanan!

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

14 years agoAdded optimization that narrow load / op / store and the 'op' is a bit twiddling...
Evan Cheng [Thu, 28 May 2009 00:35:15 +0000 (00:35 +0000)]
Added optimization that narrow load / op / store and the 'op' is a bit twiddling instruction and its second operand is an immediate. If bits that are touched by 'op' can be done with a narrower instruction, reduce the width of the load and store as well. This happens a lot with bitfield manipulation code.
e.g.
orl     $65536, 8(%rax)
=>
orb     $1, 10(%rax)

Since narrowing is not always a win, e.g. i32 -> i16 is a loss on x86, dag combiner consults with the target before performing the optimization.

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

14 years agoRevert 72493 and replace it with a more conservative fix, for now: don't
Dan Gohman [Wed, 27 May 2009 21:10:47 +0000 (21:10 +0000)]
Revert 72493 and replace it with a more conservative fix, for now: don't
rewrite the comparison if there is any implicit extension or truncation
on the induction variable. I'm planning for IVUsers to eventually take
over some of the work of this code, and for it to be generalized.

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

14 years agoGer rid of some dead code.
Eli Friedman [Wed, 27 May 2009 20:39:00 +0000 (20:39 +0000)]
Ger rid of some dead code.

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

14 years agoIn ChangeCompareStride, when the stride to be reused is truncated to
Dan Gohman [Wed, 27 May 2009 20:00:18 +0000 (20:00 +0000)]
In ChangeCompareStride, when the stride to be reused is truncated to
a smaller type, promoted its offset back up to the type of the new
comparison. This fixes PR4222.

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

14 years agoFix sfence jit encoding. Patch by Sean Callanan.
Evan Cheng [Wed, 27 May 2009 18:38:01 +0000 (18:38 +0000)]
Fix sfence jit encoding. Patch by Sean Callanan.

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

14 years agoThis looks like it passes now.
Bill Wendling [Wed, 27 May 2009 17:43:21 +0000 (17:43 +0000)]
This looks like it passes now.

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

14 years agoAdded support for fround, fextend and FP_TO_SINT
Bruno Cardoso Lopes [Wed, 27 May 2009 17:23:44 +0000 (17:23 +0000)]
Added support for fround, fextend and FP_TO_SINT

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

14 years agoMinor fix for CMake build system
Douglas Gregor [Wed, 27 May 2009 16:52:17 +0000 (16:52 +0000)]
Minor fix for CMake build system

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

14 years agoCMake: Set LIBS on llvm-config so we can query the system libraries
Oscar Fuentes [Wed, 27 May 2009 15:49:33 +0000 (15:49 +0000)]
CMake: Set LIBS on llvm-config so we can query the system libraries
used by CMake with --ldflags.

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

14 years agoMinor cleanups; add a better explanation for the issue with
Eli Friedman [Wed, 27 May 2009 12:42:55 +0000 (12:42 +0000)]
Minor cleanups; add a better explanation for the issue with
BUILD_VECTOR.

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

14 years agoRemove more special cases for opcodes.
Eli Friedman [Wed, 27 May 2009 12:20:41 +0000 (12:20 +0000)]
Remove more special cases for opcodes.

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

14 years agoRemove special cases for more opcodes.
Eli Friedman [Wed, 27 May 2009 07:58:35 +0000 (07:58 +0000)]
Remove special cases for more opcodes.

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

14 years agoRemoving more special cases from LegalizeDAG.
Eli Friedman [Wed, 27 May 2009 07:32:27 +0000 (07:32 +0000)]
Removing more special cases from LegalizeDAG.

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

14 years agoEliminate more special cases for opcodes.
Eli Friedman [Wed, 27 May 2009 07:05:37 +0000 (07:05 +0000)]
Eliminate more special cases for opcodes.

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

14 years agoRemove more special cases from LegalizeDAG.
Eli Friedman [Wed, 27 May 2009 03:33:44 +0000 (03:33 +0000)]
Remove more special cases from LegalizeDAG.

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

14 years agoRemove unused argument.
Eli Friedman [Wed, 27 May 2009 02:21:29 +0000 (02:21 +0000)]
Remove unused argument.

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

14 years agoRemove more opcode special cases.
Eli Friedman [Wed, 27 May 2009 02:16:40 +0000 (02:16 +0000)]
Remove more opcode special cases.

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

14 years agoAdd braces around an array initializer.
Dan Gohman [Wed, 27 May 2009 02:07:15 +0000 (02:07 +0000)]
Add braces around an array initializer.

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

14 years agoTeach SCEVExpander to avoid creating over-indexed GEP indices when
Dan Gohman [Wed, 27 May 2009 02:00:53 +0000 (02:00 +0000)]
Teach SCEVExpander to avoid creating over-indexed GEP indices when
possible. For example, it now emits

  %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 2, i64 %tmp, i64 1

instead of the equivalent but less obvious

  %p.2.ip.1 = getelementptr [3 x [3 x double]]* %p, i64 0, i64 %tmp, i64 19

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

14 years agoTeach BasicAliasAnalysis to understand constant gep indices that fall
Dan Gohman [Wed, 27 May 2009 01:48:27 +0000 (01:48 +0000)]
Teach BasicAliasAnalysis to understand constant gep indices that fall
beyond their associated static array type.

I believe that this fixes a legitimate bug, because BasicAliasAnalysis
already has code to check for this condition that works for non-constant
indices, however it was missing the case of constant indices. With this
change, it checks for both.

This fixes PR4267, and miscompiles of SPEC 188.ammp and 464.h264.href.

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

14 years agoStart of refactoring LegalizeDAG so that we don't need specialized
Eli Friedman [Wed, 27 May 2009 01:25:56 +0000 (01:25 +0000)]
Start of refactoring LegalizeDAG so that we don't need specialized
handling for every single opcode.

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

14 years agoDon't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
Eli Friedman [Wed, 27 May 2009 00:47:34 +0000 (00:47 +0000)]
Don't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
FP_TO_XINT.  Necessary for some cleanups I'm working on.  Updated
from the previous version (r72431) to fix a bug and make some things a
bit clearer.

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

14 years agoTestcase for (llvm-gcc-4.2) 72442 (PR 4242).
Dale Johannesen [Tue, 26 May 2009 23:19:19 +0000 (23:19 +0000)]
Testcase for (llvm-gcc-4.2) 72442 (PR 4242).

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

14 years agoBack out r72431, it is causing a number of compilation crashes with clang.
Daniel Dunbar [Tue, 26 May 2009 21:27:02 +0000 (21:27 +0000)]
Back out r72431, it is causing a number of compilation crashes with clang.

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

14 years agoUpdate CPU capabilities for AMD machines
Stefanus Du Toit [Tue, 26 May 2009 21:04:35 +0000 (21:04 +0000)]
Update CPU capabilities for AMD machines

- added processors k8-sse3, opteron-sse3, athlon64-sse3, amdfam10, and
barcelona with appropriate sse3/4a levels
- added FeatureSSE4A for amdfam10 processors
in X86Subtarget:
- added hasSSE4A
- updated AutoDetectSubtargetFeatures to detect SSE4A
- updated GetCurrentX86CPU to detect family 15 with sse3 as k8-sse3 and
family 10h as amdfam10

New processor names match those used by gcc.

Patch by Paul Redmond!

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

14 years agoDon't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
Eli Friedman [Tue, 26 May 2009 19:18:56 +0000 (19:18 +0000)]
Don't abuse the quirky behavior of LegalizeDAG for XINT_TO_FP and
FP_TO_XINT.  Necessary for some cleanups I'm working on.

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

14 years agoFor the new ar --plugin libLLVMgold.so to work we need libLTO linked with
Torok Edwin [Tue, 26 May 2009 19:11:47 +0000 (19:11 +0000)]
For the new ar --plugin libLLVMgold.so to work we need libLTO linked with
pthreads, otherwise ar complains of unresolved references to pthread_mutex_*.
LTO doesn't actually use pthreads, but ManagedStatic does.

Fix this by linking in LIBS (that contains pthreads) for LTO and gold.
For now this links in more libs than needed (libffi for example), we can figure
out later how to link in those libs per-tool later.

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

14 years agoLiveVariables::VarInfo contains an AliveBlocks BitVector, which has as many
Jeffrey Yasskin [Tue, 26 May 2009 18:27:15 +0000 (18:27 +0000)]
LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as many
entries as there are basic blocks in the function.  LiveVariables::getVarInfo
creates a VarInfo struct for every register in the function, leading to
quadratic space use.  This patch changes the BitVector to a SparseBitVector,
which doesn't help the worst-case memory use but does reduce the actual use in
very long functions with short-lived variables.

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

14 years agoFor the return type of SCEVUDivExpr, use the RHS' type instead of
Dan Gohman [Tue, 26 May 2009 17:44:05 +0000 (17:44 +0000)]
For the return type of SCEVUDivExpr, use the RHS' type instead of
that of the LHS. It doesn't matter for correctness, but the LHS
is more likely than the RHS to be a pointer type in exotic cases,
and it's more tidy to have it return the integer type.

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

14 years agoGive SCEVNaryExpr a doxygen comment.
Dan Gohman [Tue, 26 May 2009 17:42:32 +0000 (17:42 +0000)]
Give SCEVNaryExpr a doxygen comment.

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

14 years agoIn cases where a pointer value is an operand of a multiplication or
Dan Gohman [Tue, 26 May 2009 17:41:16 +0000 (17:41 +0000)]
In cases where a pointer value is an operand of a multiplication or
division operation, don't attempt to use the operation's value as
the base of a getelementptr. This fixes PR4271.

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

14 years agoDelete a bunch of dead code from LegalizeDAG.
Eli Friedman [Tue, 26 May 2009 08:55:52 +0000 (08:55 +0000)]
Delete a bunch of dead code from LegalizeDAG.

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

14 years agoEliminate VarInfo::UsedBlocks.
Evan Cheng [Tue, 26 May 2009 06:25:46 +0000 (06:25 +0000)]
Eliminate VarInfo::UsedBlocks.

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

14 years agomake memdep use the getModRefInfo method for stores instead of the
Chris Lattner [Mon, 25 May 2009 21:28:56 +0000 (21:28 +0000)]
make memdep use the getModRefInfo method for stores instead of the
low-level alias() method, allowing it to reason more aggressively
about pointers into constant memory.  PR4189

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

14 years agoAudit the type constructors. Previously it was possible to create [0 x void]
Nick Lewycky [Mon, 25 May 2009 21:28:11 +0000 (21:28 +0000)]
Audit the type constructors. Previously it was possible to create [0 x void]
or use labels as members of structures for example. Also included a couple of
whitespace fixes.

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

14 years agoadd some late optimizations that GCC does. It thinks these are a win
Chris Lattner [Mon, 25 May 2009 20:28:19 +0000 (20:28 +0000)]
add some late optimizations that GCC does.  It thinks these are a win
even on Core2, not just AMD processors which was a surprise to me.

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

14 years agofix typo
Chris Lattner [Mon, 25 May 2009 19:51:07 +0000 (19:51 +0000)]
fix typo

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

14 years agowe should eventually add -march=atom and the new atom movbe instruction.
Chris Lattner [Mon, 25 May 2009 16:34:44 +0000 (16:34 +0000)]
we should eventually add -march=atom and the new atom movbe instruction.

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

14 years agoFix the crash debugger to actually bisect globals once it's determined that it
Nick Lewycky [Mon, 25 May 2009 06:29:56 +0000 (06:29 +0000)]
Fix the crash debugger to actually bisect globals once it's determined that it
can't just eliminate all global initializers.

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

14 years agoAdd a bisection step on the list of instructions before doing the linear
Nick Lewycky [Mon, 25 May 2009 05:30:00 +0000 (05:30 +0000)]
Add a bisection step on the list of instructions before doing the linear
simplification. It's not clear to me whether this can replace the first of the
linear instruction simplification stages or not, so I left it in.

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

14 years agoVarious comment fixes.
Dan Gohman [Sun, 24 May 2009 23:45:28 +0000 (23:45 +0000)]
Various comment fixes.

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

14 years agoChange ScalarEvolution::getSCEVAtScope to always return the original value
Dan Gohman [Sun, 24 May 2009 23:25:42 +0000 (23:25 +0000)]
Change ScalarEvolution::getSCEVAtScope to always return the original value
in the case where a loop exit value cannot be computed, instead of only in
some cases while using SCEVCouldNotCompute in others. This simplifies
getSCEVAtScope's callers.

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

14 years agoAdd a comment which should hopefully make the purpose of this method a
Eli Friedman [Sun, 24 May 2009 20:32:10 +0000 (20:32 +0000)]
Add a comment which should hopefully make the purpose of this method a
bit clearer.

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

14 years agoMinor improvement to FCOPYSIGN to use BIT_CONVERT in cases where the
Eli Friedman [Sun, 24 May 2009 20:29:11 +0000 (20:29 +0000)]
Minor improvement to FCOPYSIGN to use BIT_CONVERT in cases where the
corresponding integer type is legal.

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

14 years agoMove Rewriter.clear() earlier, to avoid triggerring the AssertingVH by
Torok Edwin [Sun, 24 May 2009 20:08:21 +0000 (20:08 +0000)]
Move Rewriter.clear() earlier, to avoid triggerring the AssertingVH by
one of the RecursivelyDeleteTriviallyDeadInstructions.
Add a comment explaining why the cache needs to be cleared.

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

14 years agoInstead of clearing the rewriter, don't attempt to rewrite dead phi nodes.
Torok Edwin [Sun, 24 May 2009 19:36:09 +0000 (19:36 +0000)]
Instead of clearing the rewriter, don't attempt to rewrite dead phi nodes.
Also fix 80 column violation.

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

14 years agoWhen rewriting the loop exit test with the canonical induction variable,
Dan Gohman [Sun, 24 May 2009 19:11:38 +0000 (19:11 +0000)]
When rewriting the loop exit test with the canonical induction variable,
leave the original comparison in place if it has other uses, since the
other uses won't be dominated by the new comparison instruction.

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

14 years agoFix this code for hosts where std::vector doesn't have .data().
Dan Gohman [Sun, 24 May 2009 19:02:45 +0000 (19:02 +0000)]
Fix this code for hosts where std::vector doesn't have .data().
Use &Ops[0] instead, which is safe since Ops will never be empty here.

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

14 years agoWhen replacing a floating-point comparison with an integer
Dan Gohman [Sun, 24 May 2009 18:09:01 +0000 (18:09 +0000)]
When replacing a floating-point comparison with an integer
comparison, use takeName to give the integer comparison a name.

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

14 years agoGeneralize SCEVExpander::visitAddRecExpr's GEP persuit, and avoid
Dan Gohman [Sun, 24 May 2009 18:06:31 +0000 (18:06 +0000)]
Generalize SCEVExpander::visitAddRecExpr's GEP persuit, and avoid
sending SCEVUnknowns to expandAddToGEP. This avoids the need for
expandAddToGEP to bend the rules and peek into SCEVUnknown
expressions.

Factor out the code for testing whether a SCEV can be factored by
a constant for use in a GEP index. This allows it to handle
SCEVAddRecExprs, by recursing.

As a result, SCEVExpander can now put more things in GEP indices,
so it emits fewer explicit mul instructions.

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

14 years agoWhen the low bits of one operand of an add are zero, that number
Dan Gohman [Sun, 24 May 2009 18:02:35 +0000 (18:02 +0000)]
When the low bits of one operand of an add are zero, that number
of low bits of the other operand are preserved in the output.

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

14 years agoThe rewriter may hold references to instructions that are deleted because they are...
Torok Edwin [Sun, 24 May 2009 14:23:16 +0000 (14:23 +0000)]
The rewriter may hold references to instructions that are deleted because they are trivially dead.
Fix by clearing the rewriter cache before deleting the trivially dead
instructions.
Also make InsertedExpressions use an AssertingVH to catch these
bugs easier.

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

14 years agoRewrite ISD::FCOPYSIGN lowering to never use i64. Not really ideal, but
Eli Friedman [Sun, 24 May 2009 10:21:20 +0000 (10:21 +0000)]
Rewrite ISD::FCOPYSIGN lowering to never use i64. Not really ideal, but
it's late, and I don't have any better ideas at the moment.  Fixes PR4257.

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

14 years agoMake bugpoint emit a bugpoint-reduced-blocks.bc, because bugpoint itself
Torok Edwin [Sun, 24 May 2009 09:40:47 +0000 (09:40 +0000)]
Make bugpoint emit a bugpoint-reduced-blocks.bc, because bugpoint itself
can crash during instruction simplification (for example if it creates a
broken module).

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

14 years agoAdd -disable-global-remove option to bugpoint.
Torok Edwin [Sun, 24 May 2009 09:31:04 +0000 (09:31 +0000)]
Add -disable-global-remove option to bugpoint.
Sometimes when bugpointing a crash the bugpoint-reduced-simplified.bc reproduces
a totally different bug than the original one ("GV doesn't have initializer").
Although its useful to report that bug too, I need a way to reduce the original
bug, hence I introduced -disable-global-remove.

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

14 years agoUpdate for CMakeLists; untested, so tell me if there are issues.
Eli Friedman [Sun, 24 May 2009 09:13:13 +0000 (09:13 +0000)]
Update for CMakeLists; untested, so tell me if there are issues.

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

14 years agoRemove checks of getTypeAction from LegalizeOp; we already assert that
Eli Friedman [Sun, 24 May 2009 08:42:01 +0000 (08:42 +0000)]
Remove checks of getTypeAction from LegalizeOp; we already assert that
all results and all operands are legal, so this change shouldn't affect
behavior at all.

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

14 years agoDisable type legalization in LegalizeDAG.
Eli Friedman [Sun, 24 May 2009 02:46:31 +0000 (02:46 +0000)]
Disable type legalization in LegalizeDAG.

This leaves around 4000 lines of dead code; I'll clean that up
in subsequent commits.

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

14 years agoRemove border around table used for layout.
Nick Lewycky [Sun, 24 May 2009 02:46:06 +0000 (02:46 +0000)]
Remove border around table used for layout.

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

14 years agoMake the PPC backend use a legal type for the operands to the BUILD_VECTOR
Eli Friedman [Sun, 24 May 2009 02:03:36 +0000 (02:03 +0000)]
Make the PPC backend use a legal type for the operands to the BUILD_VECTOR
nodes it generates.

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

14 years agoFix a bug in the expansion of EXTRACT_SUBVECTOR in
Eli Friedman [Sat, 23 May 2009 23:03:28 +0000 (23:03 +0000)]
Fix a bug in the expansion of EXTRACT_SUBVECTOR in
ExpandExtractFromVectorThroughStack.

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

14 years agoMake the X86 backend mark EXTRACT_SUBVECTOR as Expand, at least for the
Eli Friedman [Sat, 23 May 2009 22:44:52 +0000 (22:44 +0000)]
Make the X86 backend mark EXTRACT_SUBVECTOR as Expand, at least for the
moment.

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

14 years agoAdd a proper implementation of EXTRACT_SUBVECTOR legalization that
Eli Friedman [Sat, 23 May 2009 22:37:25 +0000 (22:37 +0000)]
Add a proper implementation of EXTRACT_SUBVECTOR legalization that
doesn't split legal vector operands.  This is necessary because the
type legalization (and therefore, vector splitting) code will be going
away soon.

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

14 years agoUse latin symbols. I was told not everybody has a UTF-8 capable editor.
Torok Edwin [Sat, 23 May 2009 20:40:47 +0000 (20:40 +0000)]
Use latin symbols. I was told not everybody has a UTF-8 capable editor.

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

14 years agoWrite family name last, as other entries in this file.
Torok Edwin [Sat, 23 May 2009 20:21:09 +0000 (20:21 +0000)]
Write family name last, as other entries in this file.

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

14 years agoAdd myself.
Torok Edwin [Sat, 23 May 2009 20:19:52 +0000 (20:19 +0000)]
Add myself.

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

14 years agoAdd ARMv7 architecture, Cortex processors and different FPU modes handling.
Anton Korobeynikov [Sat, 23 May 2009 19:51:43 +0000 (19:51 +0000)]
Add ARMv7 architecture, Cortex processors and different FPU modes handling.

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

14 years agoEmit ARM Build Attributes
Anton Korobeynikov [Sat, 23 May 2009 19:51:20 +0000 (19:51 +0000)]
Emit ARM Build Attributes

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

14 years agoPropagate CPU string out of SubtargetFeatures
Anton Korobeynikov [Sat, 23 May 2009 19:50:50 +0000 (19:50 +0000)]
Propagate CPU string out of SubtargetFeatures

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

14 years agoWork around a page size issue on Cygwin.
Jay Foad [Sat, 23 May 2009 17:57:59 +0000 (17:57 +0000)]
Work around a page size issue on Cygwin.

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

14 years agoFix PR4254.
Torok Edwin [Sat, 23 May 2009 17:29:48 +0000 (17:29 +0000)]
Fix PR4254.
The DAGCombiner created a negative shiftamount, stored in an
unsigned variable. Later the optimizer eliminated the shift entirely as being
undefined.
Example: (srl (shl X, 56) 48). ShiftAmt is 4294967288.
Fix it by checking that the shiftamount is positive, and storing in a signed
variable.

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

14 years agostat64/open64/lseek64 for the interpreter
Torok Edwin [Sat, 23 May 2009 16:23:59 +0000 (16:23 +0000)]
stat64/open64/lseek64 for the interpreter

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