oota-llvm.git
13 years agoFix coding style issues.
Cameron Zwarich [Sat, 8 Jan 2011 17:07:11 +0000 (17:07 +0000)]
Fix coding style issues.

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

13 years agoMake more passes preserve dominators (or state that they preserve dominators if
Cameron Zwarich [Sat, 8 Jan 2011 17:01:52 +0000 (17:01 +0000)]
Make more passes preserve dominators (or state that they preserve dominators if
they all ready do). This removes two dominator recomputations prior to isel,
which is a 1% improvement in total llc time for 403.gcc.

The only potentially suspect thing is making GCStrategy recompute dominators if
it used a custom lowering strategy.

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

13 years agoFirst step in fixing PR8927:
Rafael Espindola [Sat, 8 Jan 2011 16:42:36 +0000 (16:42 +0000)]
First step in fixing PR8927:

Add a unnamed_addr bit to global variables and functions. This will be used
to indicate that the address is not significant and therefore the constant
or function can be merged with others.

If an optimization pass can show that an address is not used, it can set this.

Examples of things that can have this set by the FE are globals created to
hold string literals and C++ constructors.

Adding unnamed_addr to a non-const global should have no effect unless
an optimization can transform that global into a constant.

Aliases are not allowed to have unnamed_addr since I couldn't figure
out any use for it.

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

13 years agoContract subloop bodies. However, it is still important to visit the phis at the
Cameron Zwarich [Sat, 8 Jan 2011 15:52:22 +0000 (15:52 +0000)]
Contract subloop bodies. However, it is still important to visit the phis at the
top of subloop headers, as the phi uses logically occur outside of the subloop.

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

13 years agoFix a bug in r123034 (trying to sext/zext non-integers) and clean up a little.
Frits van Bommel [Sat, 8 Jan 2011 10:51:36 +0000 (10:51 +0000)]
Fix a bug in r123034 (trying to sext/zext non-integers) and clean up a little.

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

13 years agoHave loop-rotate simplify instructions (yay instsimplify!) as it clones
Chris Lattner [Sat, 8 Jan 2011 08:24:46 +0000 (08:24 +0000)]
Have loop-rotate simplify instructions (yay instsimplify!) as it clones
them into the loop preheader, eliminating silly instructions like
"icmp i32 0, 100" in fixed tripcount loops.  This also better exposes the
bigger problem with loop rotate that I'd like to fix: once this has been
folded, the duplicated conditional branch *often* turns into an uncond branch.

Not aggressively handling this is pessimizing later loop optimizations
somethin' fierce by making "dominates all exit blocks" checks fail.

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

13 years agomake this file properly self contained.
Chris Lattner [Sat, 8 Jan 2011 08:19:49 +0000 (08:19 +0000)]
make this file properly self contained.

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

13 years agoRevamp the ValueMapper interfaces in a couple ways:
Chris Lattner [Sat, 8 Jan 2011 08:15:20 +0000 (08:15 +0000)]
Revamp the ValueMapper interfaces in a couple ways:

1. Take a flags argument instead of a bool.  This makes
   it more clear to the reader what it is used for.
2. Add a flag that says that "remapping a value not in the
   map is ok".
3. Reimplement MapValue to share a bunch of code and be a lot
   more efficient.  For lookup failures, don't drop null values
   into the map.
4. Using the new flag a bunch of code can vaporize in LinkModules
   and LoopUnswitch, kill it.

No functionality change.

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

13 years agotwo minor changes: switch to the standard ValueToValueMapTy
Chris Lattner [Sat, 8 Jan 2011 07:21:31 +0000 (07:21 +0000)]
two minor changes: switch to the standard ValueToValueMapTy
map from ValueMapper.h (giving us access to its utilities)
and add a fastpath in the loop rotation code, avoiding expensive
ssa updator manipulation for values with nothing to update.

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

13 years agoI don't think I could find a 10.2.x box if I tried.
Eric Christopher [Sat, 8 Jan 2011 01:52:20 +0000 (01:52 +0000)]
I don't think I could find a 10.2.x box if I tried.

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

13 years agoRecognize inline asm 'rev /bin/bash, ' as a bswap intrinsic call.
Evan Cheng [Sat, 8 Jan 2011 01:24:27 +0000 (01:24 +0000)]
Recognize inline asm 'rev /bin/bash, ' as a bswap intrinsic call.

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

13 years agoDo not model all INLINEASM instructions as having unmodelled side effects.
Evan Cheng [Fri, 7 Jan 2011 23:50:32 +0000 (23:50 +0000)]
Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.

This allows memory instructions to be moved around INLINEASM instructions.

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

13 years agoUse __builtin_shufflevector to implement vget_low and vget_high intrinsics.
Bob Wilson [Fri, 7 Jan 2011 23:40:49 +0000 (23:40 +0000)]
Use __builtin_shufflevector to implement vget_low and vget_high intrinsics.
This was suggested by Edmund Grimley Evans in pr8411.

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

13 years agoAdd an explanatory message for an assertion.
Bob Wilson [Fri, 7 Jan 2011 23:40:46 +0000 (23:40 +0000)]
Add an explanatory message for an assertion.

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

13 years agoEliminate variable only used in debug builds.
Matt Beaumont-Gay [Fri, 7 Jan 2011 22:34:58 +0000 (22:34 +0000)]
Eliminate variable only used in debug builds.

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

13 years agoSpeculatively revert r123032.
Devang Patel [Fri, 7 Jan 2011 22:33:41 +0000 (22:33 +0000)]
Speculatively revert r123032.

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

13 years agoDo not include DataTypes.h in llvm-c/lto.h.
Devang Patel [Fri, 7 Jan 2011 22:26:25 +0000 (22:26 +0000)]
Do not include DataTypes.h in llvm-c/lto.h.
This means avoid using uint32_t. This patch reverts r112200 and fixes original  problem by fixing argument type in lto.cpp.

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

13 years agoFix comment. INLINEASM node operand #3 is IsAlignStack bit.
Evan Cheng [Fri, 7 Jan 2011 21:38:59 +0000 (21:38 +0000)]
Fix comment. INLINEASM node operand #3 is IsAlignStack bit.

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

13 years agoLower some BUILD_VECTORS using VEXT+shuffle.
Bob Wilson [Fri, 7 Jan 2011 21:37:30 +0000 (21:37 +0000)]
Lower some BUILD_VECTORS using VEXT+shuffle.
Patch by Tim Northover.

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

13 years agoInstCombine: Match min/max hidden by sext/zext
Tobias Grosser [Fri, 7 Jan 2011 21:33:14 +0000 (21:33 +0000)]
InstCombine: Match min/max hidden by sext/zext

X = sext x; x >s c ? X : C+1 --> X = sext x; X <s C+1 ? C+1 : X
X = sext x; x <s c ? X : C-1 --> X = sext x; X >s C-1 ? C-1 : X
X = zext x; x >u c ? X : C+1 --> X = zext x; X <u C+1 ? C+1 : X
X = zext x; x <u c ? X : C-1 --> X = zext x; X >u C-1 ? C-1 : X
X = sext x; x >u c ? X : C+1 --> X = sext x; X <u C+1 ? C+1 : X
X = sext x; x <u c ? X : C-1 --> X = sext x; X >u C-1 ? C-1 : X

Instead of calculating this with mixed types promote all to the
larger type. This enables scalar evolution to analyze this
expression. PR8866

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

13 years agoSome whitespace fixes
Tobias Grosser [Fri, 7 Jan 2011 21:33:13 +0000 (21:33 +0000)]
Some whitespace fixes

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

13 years agoAppropriately truncate debug info range in dwarf output.
Devang Patel [Fri, 7 Jan 2011 21:30:41 +0000 (21:30 +0000)]
Appropriately truncate debug info range in dwarf output.
Enable live debug variables pass.

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

13 years agoDBG_VALUE does not have any side effects; it also makes no sense to mark it cheap...
Evan Cheng [Fri, 7 Jan 2011 21:08:26 +0000 (21:08 +0000)]
DBG_VALUE does not have any side effects; it also makes no sense to mark it cheap as a copy.

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

13 years agoRevert 122959, it needs more thought. Add it back to README.txt with additional notes.
Benjamin Kramer [Fri, 7 Jan 2011 20:42:20 +0000 (20:42 +0000)]
Revert 122959, it needs more thought. Add it back to README.txt with additional notes.

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

13 years agoDon't use -O3 on Mingw, as people report it as unreliable. Use -O2
Oscar Fuentes [Fri, 7 Jan 2011 20:31:03 +0000 (20:31 +0000)]
Don't use -O3 on Mingw, as people report it as unreliable. Use -O2
instead.

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

13 years agoSimplify the allocation and freeing of Users' operand lists, now that
Jay Foad [Fri, 7 Jan 2011 20:29:02 +0000 (20:29 +0000)]
Simplify the allocation and freeing of Users' operand lists, now that
every BranchInst has a fixed number of operands.

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

13 years agoRemove the "ugly" method BranchInst::setUnconditionalDest().
Jay Foad [Fri, 7 Jan 2011 20:26:51 +0000 (20:26 +0000)]
Remove the "ugly" method BranchInst::setUnconditionalDest().

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

13 years agoRemove all uses of the "ugly" method BranchInst::setUnconditionalDest().
Jay Foad [Fri, 7 Jan 2011 20:25:56 +0000 (20:25 +0000)]
Remove all uses of the "ugly" method BranchInst::setUnconditionalDest().

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

13 years agoRevert r122955. It seems using movups to lower memcpy can cause massive regression...
Evan Cheng [Fri, 7 Jan 2011 19:35:30 +0000 (19:35 +0000)]
Revert r122955. It seems using movups to lower memcpy can cause massive regression (even on Nehalem) in edge cases. I also didn't see any real performance benefit.

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

13 years agoRename lisp-like functions as suggested by Gabor Greif as loooong time
David Greene [Fri, 7 Jan 2011 17:05:37 +0000 (17:05 +0000)]
Rename lisp-like functions as suggested by Gabor Greif as loooong time
ago.  This is both easier to learn and easier to read.

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

13 years agoTry to unbreak the arm buildbot.
Benjamin Kramer [Fri, 7 Jan 2011 11:35:21 +0000 (11:35 +0000)]
Try to unbreak the arm buildbot.

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

13 years agoAdd testcases for PR8411 (vget_low and vget_high implemented as shuffles).
Bob Wilson [Fri, 7 Jan 2011 06:44:14 +0000 (06:44 +0000)]
Add testcases for PR8411 (vget_low and vget_high implemented as shuffles).

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

13 years agoAdd ARM patterns to match EXTRACT_SUBVECTOR nodes.
Bob Wilson [Fri, 7 Jan 2011 04:59:04 +0000 (04:59 +0000)]
Add ARM patterns to match EXTRACT_SUBVECTOR nodes.
Also fix an off-by-one in SelectionDAGBuilder that was preventing shuffle
vectors from being translated to EXTRACT_SUBVECTOR.
Patch by Tim Northover.

The test changes are needed to keep those spill-q tests from testing aligned
spills and restores.  If the only aligned stack objects are spill slots, we
no longer realign the stack frame.  Prior to this patch, an EXTRACT_SUBVECTOR
was legalized by loading from the stack, which created an aligned frame index.
Now, however, there is nothing except the spill slot in the stack frame, so
I added an aligned alloca.

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

13 years agoFix a comment typo.
Bob Wilson [Fri, 7 Jan 2011 04:58:58 +0000 (04:58 +0000)]
Fix a comment typo.

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

13 years agoChange EXTRACT_SUBVECTOR to require a constant index.
Bob Wilson [Fri, 7 Jan 2011 04:58:56 +0000 (04:58 +0000)]
Change EXTRACT_SUBVECTOR to require a constant index.
We were never generating any of these nodes with variable indices, and there
was one legalizer function asserting on a non-constant index.  If we ever have
a need to support variable indices, we can add this back again.

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

13 years agoEarly exit if we don't have invokes. The 'Unwinds' vector isn't modified unless
Bill Wendling [Fri, 7 Jan 2011 02:54:45 +0000 (02:54 +0000)]
Early exit if we don't have invokes. The 'Unwinds' vector isn't modified unless
we have invokes, so there is no functionality change here.

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

13 years agoFix the other problem reported in PR8582. Testcase and patch by
Duncan Sands [Thu, 6 Jan 2011 23:45:22 +0000 (23:45 +0000)]
Fix the other problem reported in PR8582.  Testcase and patch by
Nadav Rotem.

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

13 years agoAdd a testcase for PR8582, which mysteriously fixed itself, in case the problem
Duncan Sands [Thu, 6 Jan 2011 23:04:29 +0000 (23:04 +0000)]
Add a testcase for PR8582, which mysteriously fixed itself, in case the problem
comes back some day.

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

13 years agoAdd some fairly duplicated code to let type legalization split illegal
Eric Christopher [Thu, 6 Jan 2011 22:28:56 +0000 (22:28 +0000)]
Add some fairly duplicated code to let type legalization split illegal
typed atomics. This will lower exclusively to libcalls at the moment.

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

13 years agoWith Benjamin's recent amazing patches, we should be able to do even better things :)
Chris Lattner [Thu, 6 Jan 2011 22:25:00 +0000 (22:25 +0000)]
With Benjamin's recent amazing patches, we should be able to do even better things :)

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

13 years agouse isNullValue() to simplify code, add an assert.
Chris Lattner [Thu, 6 Jan 2011 22:24:29 +0000 (22:24 +0000)]
use isNullValue() to simplify code, add an assert.

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

13 years agoEmit 128 bit constant.
Devang Patel [Thu, 6 Jan 2011 21:39:25 +0000 (21:39 +0000)]
Emit 128 bit constant.
This fixes PR 8913 crash.

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

13 years agoPR8921: LDM/POP do not support interworking prior to v5t.
Bob Wilson [Thu, 6 Jan 2011 19:24:41 +0000 (19:24 +0000)]
PR8921: LDM/POP do not support interworking prior to v5t.

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

13 years agoRemove extra whitespace.
Bob Wilson [Thu, 6 Jan 2011 19:24:36 +0000 (19:24 +0000)]
Remove extra whitespace.

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

13 years agoFix comment typo.
Bob Wilson [Thu, 6 Jan 2011 19:24:32 +0000 (19:24 +0000)]
Fix comment typo.

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

13 years agoAdd a note from llvmdev, this time with more info.
Benjamin Kramer [Thu, 6 Jan 2011 17:35:50 +0000 (17:35 +0000)]
Add a note from llvmdev, this time with more info.

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

13 years agoFixed parsing of hex floats.
Abramo Bagnara [Thu, 6 Jan 2011 16:55:14 +0000 (16:55 +0000)]
Fixed parsing of hex floats.

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

13 years agoCorrectly disassemble truncated asm.
Rafael Espindola [Thu, 6 Jan 2011 16:48:42 +0000 (16:48 +0000)]
Correctly disassemble truncated asm.

Patch by Richard Simth.

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

13 years agoInstCombine: Turn _chk functions into the "unsafe" variant if length and max langth...
Benjamin Kramer [Thu, 6 Jan 2011 14:22:52 +0000 (14:22 +0000)]
InstCombine: Turn _chk functions into the "unsafe" variant if length and max langth are equal.

This happens when we take the (non-constant) length from a malloc.

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

13 years agoEarlyCSE does this now (and GVN always did it).
Benjamin Kramer [Thu, 6 Jan 2011 13:19:46 +0000 (13:19 +0000)]
EarlyCSE does this now (and GVN always did it).

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

13 years agoInstCombine: If we call llvm.objectsize on a malloc call we can replace it with the...
Benjamin Kramer [Thu, 6 Jan 2011 13:11:05 +0000 (13:11 +0000)]
InstCombine: If we call llvm.objectsize on a malloc call we can replace it with the size passed to malloc.

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

13 years agoInstCombine: Teach llvm.objectsize folding to look through GEPs.
Benjamin Kramer [Thu, 6 Jan 2011 13:07:49 +0000 (13:07 +0000)]
InstCombine: Teach llvm.objectsize folding to look through GEPs.

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

13 years agoRemove dead code and silence warnings.
Benjamin Kramer [Thu, 6 Jan 2011 13:01:02 +0000 (13:01 +0000)]
Remove dead code and silence warnings.

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

13 years agoUse movups to lower memcpy and memset even if it's not fast (like corei7).
Evan Cheng [Thu, 6 Jan 2011 07:58:36 +0000 (07:58 +0000)]
Use movups to lower memcpy and memset even if it's not fast (like corei7).
The theory is it's still faster than a pair of movq / a quad of movl. This
will probably hurt older chips like P4 but should run faster on current
and future Intel processors. rdar://8817010

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

13 years agoadd a note about object size from drystone, add a poorly optimized loop from 179...
Chris Lattner [Thu, 6 Jan 2011 07:41:22 +0000 (07:41 +0000)]
add a note about object size from drystone, add a poorly optimized loop from 179.art.

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

13 years agoadd a trivial instcombine missed in Dhrystone
Chris Lattner [Thu, 6 Jan 2011 07:09:23 +0000 (07:09 +0000)]
add a trivial instcombine missed in Dhrystone

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

13 years agoRe-implement r122936 with proper target hooks. Now getMaxStoresPerMemcpy
Evan Cheng [Thu, 6 Jan 2011 06:52:41 +0000 (06:52 +0000)]
Re-implement r122936 with proper target hooks. Now getMaxStoresPerMemcpy
etc. takes an option OptSize. If OptSize is true, it would return
the inline limit for functions with attribute OptSize.

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

13 years agoimplement constant folding support for an exotic constant expr:
Chris Lattner [Thu, 6 Jan 2011 06:19:46 +0000 (06:19 +0000)]
implement constant folding support for an exotic constant expr:
  ret i64 ptrtoint (i8* getelementptr ([1000 x i8]* @X, i64 1, i64 sub (i64 0, i64 ptrtoint ([1000 x i8]* @X to i64))) to i64)

to "ret i64 1000".  This allows us to correctly compute the trip count
on a loop in PR8883, which occurs with std::fill on a char array.  This
allows us to transform it into a memset with a constant size.

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

13 years agoRevert r122936. I'll re-implement the change.
Evan Cheng [Thu, 6 Jan 2011 06:17:53 +0000 (06:17 +0000)]
Revert r122936. I'll re-implement the change.

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

13 years agoUnitTests/Path: Add magical tests. This will also test identify_magic.
Michael J. Spencer [Thu, 6 Jan 2011 05:58:02 +0000 (05:58 +0000)]
UnitTests/Path: Add magical tests. This will also test identify_magic.

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

13 years agoUnitTests/Path: More ASSERT_NO_ERROR cleanup.
Michael J. Spencer [Thu, 6 Jan 2011 05:57:54 +0000 (05:57 +0000)]
UnitTests/Path: More ASSERT_NO_ERROR cleanup.

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

13 years agoAdd the CallInst optimizations that don't involve expanding inline assembly to
Cameron Zwarich [Thu, 6 Jan 2011 02:56:42 +0000 (02:56 +0000)]
Add the CallInst optimizations that don't involve expanding inline assembly to
OptimizeInst() so that they can be used on a worklist instruction.

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

13 years agoMove the GEP handling in CodeGenPrepare to OptimizeInst().
Cameron Zwarich [Thu, 6 Jan 2011 02:44:52 +0000 (02:44 +0000)]
Move the GEP handling in CodeGenPrepare to OptimizeInst().

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

13 years agoSplit the optimizations in CodeGenPrepare that don't manipulate the iterators
Cameron Zwarich [Thu, 6 Jan 2011 02:37:26 +0000 (02:37 +0000)]
Split the optimizations in CodeGenPrepare that don't manipulate the iterators
into a separate function, so that it can be called from a loop using a worklist
rather than a loop traversing a whole basic block.

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

13 years agoZap the last two -Wself-assign warnings in llvm.
Jakob Stoklund Olesen [Thu, 6 Jan 2011 01:33:22 +0000 (01:33 +0000)]
Zap the last two -Wself-assign warnings in llvm.

Simplify RALinScan::DowngradeRegister with TRI::getOverlaps while we are there.

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

13 years agoAdd the SpillPlacement analysis pass.
Jakob Stoklund Olesen [Thu, 6 Jan 2011 01:21:53 +0000 (01:21 +0000)]
Add the SpillPlacement analysis pass.

This pass precomputes CFG block frequency information that can be used by the
register allocator to find optimal spill code placement.

Given an interference pattern, placeSpills() will compute which basic blocks
should have the current variable enter or exit in a register, and which blocks
prefer the stack.

The algorithm is ready to consume block frequencies from profiling data, but for
now it gets by with the static estimates used for spill weights.

This is a work in progress and still not hooked up to RegAllocGreedy.

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

13 years agoFix test to coincide with r122934 change from PR8919.
Bill Wendling [Thu, 6 Jan 2011 01:09:35 +0000 (01:09 +0000)]
Fix test to coincide with r122934 change from PR8919.

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

13 years agor105228 reduced the memcpy / memset inline limit to 4 with -Os to avoid blowing
Evan Cheng [Thu, 6 Jan 2011 01:04:47 +0000 (01:04 +0000)]
r105228 reduced the memcpy / memset inline limit to 4 with -Os to avoid blowing
up freebsd bootloader. However, this doesn't make much sense for Darwin, whose
-Os is meant to optimize for size only if it doesn't hurt performance.
rdar://8821501

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

13 years agoAvoid zero extend bit test operands to pointer type if all the masks fit in
Evan Cheng [Thu, 6 Jan 2011 01:02:44 +0000 (01:02 +0000)]
Avoid zero extend bit test operands to pointer type if all the masks fit in
the original type of the switch statement key.
rdar://8781238

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

13 years agoPR8919 - LLVM incorrectly generates "_alloca" as the stack probing call. That
Bill Wendling [Thu, 6 Jan 2011 00:50:34 +0000 (00:50 +0000)]
PR8919 - LLVM incorrectly generates "_alloca" as the stack probing call. That
works only on MinGW32. On 64-bit, the function to call is "__chkstk".
Patch by KS Sreeram!

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

13 years agoPR8918 - When used with MinGW64, LLVM generates a "calll __main" at the
Bill Wendling [Thu, 6 Jan 2011 00:47:10 +0000 (00:47 +0000)]
PR8918 - When used with MinGW64, LLVM generates a "calll __main" at the
beginning of the "main" function. The assembler complains about the invalid
suffix for the 'call' instruction. The right instruction is "callq __main".
Patch by KS Sreeram!

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

13 years agoStop reallocating SunkAddrs for each basic block. When we move to an instruction
Cameron Zwarich [Thu, 6 Jan 2011 00:42:50 +0000 (00:42 +0000)]
Stop reallocating SunkAddrs for each basic block. When we move to an instruction
worklist, the key will need to become std::pair<BasicBlock*, Value*>.

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

13 years agoReorder, rename, and document some members to make this easier to follow.
Owen Anderson [Wed, 5 Jan 2011 23:26:22 +0000 (23:26 +0000)]
Reorder, rename, and document some members to make this easier to follow.

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

13 years agoOptimize:
Evan Cheng [Wed, 5 Jan 2011 23:06:49 +0000 (23:06 +0000)]
Optimize:
  r1025 = s/zext r1024, 4
  r1026 = extract_subreg r1025, 4
to:
  r1026 = copy r1024

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

13 years agofix PR8900, a shuffle miscompilation. Patch by Nadav Rotem!
Chris Lattner [Wed, 5 Jan 2011 22:28:46 +0000 (22:28 +0000)]
fix PR8900, a shuffle miscompilation.  Patch by Nadav Rotem!

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

13 years agosilence more self assignment warnings.
Chris Lattner [Wed, 5 Jan 2011 22:26:52 +0000 (22:26 +0000)]
silence more self assignment warnings.

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

13 years agoAdd a hidden command line option to display edge bundle graphs as they are
Jakob Stoklund Olesen [Wed, 5 Jan 2011 21:50:24 +0000 (21:50 +0000)]
Add a hidden command line option to display edge bundle graphs as they are
calculated.

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

13 years agoSilence a warning from non-standard warning avoidance code.
Jakob Stoklund Olesen [Wed, 5 Jan 2011 21:50:21 +0000 (21:50 +0000)]
Silence a warning from non-standard warning avoidance code.

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

13 years ago80-cols.
Eric Christopher [Wed, 5 Jan 2011 21:45:56 +0000 (21:45 +0000)]
80-cols.

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

13 years agoWhen computing the value on an edge, in certain cases LVI would fail to compute the...
Owen Anderson [Wed, 5 Jan 2011 21:37:18 +0000 (21:37 +0000)]
When computing the value on an edge, in certain cases LVI would fail to compute the value range
in the predecessor block, leading to an incorrect conclusion for the edge value.  Found by inspection.

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

13 years agoRevert svn 122743, removing the instcombine pass that was replaced by earlycse.
Bob Wilson [Wed, 5 Jan 2011 21:16:50 +0000 (21:16 +0000)]
Revert svn 122743, removing the instcombine pass that was replaced by earlycse.
My i386 llvm-gcc nightly tester found a regression for
SingleSource/Benchmarks/McGill/chomp that a bisect blamed on 122743.
That seems strange but apparently the combination of earlycse and instcombine
did something bad.  Chris says he intended to remove the instcombine pass, so
let's go ahead and try that.  We'll see if there are any performance losses.

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

13 years agoRe-convert several of LazyValueInfo's internal maps to Dense{Map|Set}, and fix the...
Owen Anderson [Wed, 5 Jan 2011 21:15:29 +0000 (21:15 +0000)]
Re-convert several of LazyValueInfo's internal maps to Dense{Map|Set}, and fix the issue in
hasBlockValue() that was causing iterator invalidations.  Many thanks to Dimitry Andric for
tracking down those invalidations!

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

13 years agofix some -Wself-assign warnings.
Chris Lattner [Wed, 5 Jan 2011 18:41:05 +0000 (18:41 +0000)]
fix some -Wself-assign warnings.

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

13 years agoAdd some more statistics to CodeGenPrepare.
Cameron Zwarich [Wed, 5 Jan 2011 17:47:38 +0000 (17:47 +0000)]
Add some more statistics to CodeGenPrepare.

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

13 years agoCommit 122778 broke DWARF debug output when using the MBlaze backend. Fixed by overri...
Wesley Peck [Wed, 5 Jan 2011 17:34:20 +0000 (17:34 +0000)]
Commit 122778 broke DWARF debug output when using the MBlaze backend. Fixed by overriding TargetFrameInfo::getFrameIndexOffset to take into account the new frame index information.

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

13 years agoAdd some stats to CodeGenPrepare to make it easier to speed it up without
Cameron Zwarich [Wed, 5 Jan 2011 17:27:27 +0000 (17:27 +0000)]
Add some stats to CodeGenPrepare to make it easier to speed it up without
regressing code quality.

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

13 years agoFix small bug in setDebugInfoAvailability.
Wesley Peck [Wed, 5 Jan 2011 17:01:57 +0000 (17:01 +0000)]
Fix small bug in setDebugInfoAvailability.

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

13 years agoUnitTests/Path: Fix typo, add error number, and enable the directory cleanup code.
Michael J. Spencer [Wed, 5 Jan 2011 16:39:46 +0000 (16:39 +0000)]
UnitTests/Path: Fix typo, add error number, and enable the directory cleanup code.

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

13 years agoSupport/PathV2: Implement remove_all.
Michael J. Spencer [Wed, 5 Jan 2011 16:39:38 +0000 (16:39 +0000)]
Support/PathV2: Implement remove_all.

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

13 years agoSupport/Windows/PathV2: Make directory iteration ignore . and ..
Michael J. Spencer [Wed, 5 Jan 2011 16:39:30 +0000 (16:39 +0000)]
Support/Windows/PathV2: Make directory iteration ignore . and ..

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

13 years agoSupport/Windows/PathV2: Fix remove to handle both files and directories.
Michael J. Spencer [Wed, 5 Jan 2011 16:39:22 +0000 (16:39 +0000)]
Support/Windows/PathV2: Fix remove to handle both files and directories.

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

13 years agoSupport/PathV2: Implement directory_entry::status.
Michael J. Spencer [Wed, 5 Jan 2011 16:39:13 +0000 (16:39 +0000)]
Support/PathV2: Implement directory_entry::status.

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

13 years agoUnitTests/PathV2: Setup a test fixture to make tracking created file system
Michael J. Spencer [Wed, 5 Jan 2011 16:39:05 +0000 (16:39 +0000)]
UnitTests/PathV2: Setup a test fixture to make tracking created file system
entities easier.

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

13 years agoSupport/PathV2: Implement directory iteration on POSIX.
Michael J. Spencer [Wed, 5 Jan 2011 16:38:57 +0000 (16:38 +0000)]
Support/PathV2: Implement directory iteration on POSIX.

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

13 years agoUse pop_back_val instead of back followed by pop_back.
Cameron Zwarich [Wed, 5 Jan 2011 16:08:47 +0000 (16:08 +0000)]
Use pop_back_val instead of back followed by pop_back.

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

13 years agoFix lit for people whose LLVM path contains 'opt', which is a common directory name...
Frits van Bommel [Wed, 5 Jan 2011 15:10:24 +0000 (15:10 +0000)]
Fix lit for people whose LLVM path contains 'opt', which is a common directory name on Unix-like systems.

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

13 years agoUse a worklist for later iterations just like ordinary instsimplify. The next
Cameron Zwarich [Wed, 5 Jan 2011 05:47:47 +0000 (05:47 +0000)]
Use a worklist for later iterations just like ordinary instsimplify. The next
step is to only process instructions in subloops if they have been modified by
an earlier simplification.

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

13 years agoChange LoopInstSimplify back to a LoopPass. It revisits subloops rather than
Cameron Zwarich [Wed, 5 Jan 2011 05:15:53 +0000 (05:15 +0000)]
Change LoopInstSimplify back to a LoopPass. It revisits subloops rather than
skipping them, but it should probably use a worklist and only revisit those
instructions in subloops that have actually changed. It should probably also
use a worklist after the first iteration like instsimplify now does. Regardless,
it's only 0.3% of opt -O2 time on 403.gcc if it replaces the instcombine placed
in the middle of the loop passes.

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

13 years agoFix PR8906: -fno-builtin should disable loop-idiom recognition.
Chris Lattner [Wed, 5 Jan 2011 01:03:32 +0000 (01:03 +0000)]
Fix PR8906: -fno-builtin should disable loop-idiom recognition.
It forms memset and memcpy's, and will someday form popcount and
other stuff.  All of this is bad when compiling the implementation
of memset, memcpy, popcount, etc.

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

13 years agoRemove TODO, these appear to be implemented.
Eric Christopher [Tue, 4 Jan 2011 22:31:50 +0000 (22:31 +0000)]
Remove TODO, these appear to be implemented.

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