Jim Grosbach [Fri, 19 Nov 2010 18:01:37 +0000 (18:01 +0000)]
Remove hard tabs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119810
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 19 Nov 2010 17:11:02 +0000 (17:11 +0000)]
Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119806
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 19 Nov 2010 16:36:02 +0000 (16:36 +0000)]
Avoid release build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119804
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 19 Nov 2010 13:11:50 +0000 (13:11 +0000)]
Fix decoding ambiguities of stdrex and ldrex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119801
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 19 Nov 2010 11:37:26 +0000 (11:37 +0000)]
Silence warning about an uninitialized variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119800
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 19 Nov 2010 09:20:39 +0000 (09:20 +0000)]
Remove threading of Xor over selects and phis, with an explanation
of why such threading is pointless.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119798
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Fri, 19 Nov 2010 08:33:20 +0000 (08:33 +0000)]
Simplify, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119797
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 19 Nov 2010 07:41:23 +0000 (07:41 +0000)]
Add a MCLineSectionOrder vector so that we produce the line tables in a
deterministic order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119795
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 19 Nov 2010 06:28:11 +0000 (06:28 +0000)]
These instructions are thumb2 only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119793
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 19 Nov 2010 06:15:10 +0000 (06:15 +0000)]
Fix an obvious oversight.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119792
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 19 Nov 2010 05:45:24 +0000 (05:45 +0000)]
Don't attempt trivial coalescing for sub-register copies.
Patch by Krister Wombell!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119791
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 19 Nov 2010 05:36:51 +0000 (05:36 +0000)]
Work around GCC 4.0 build error:
llvm/include/llvm/ADT/IntervalMap.h:334: error: '((llvm::IntervalMapImpl::DesiredNodeBytes / static_cast<unsigned int>(((2 * sizeof (KeyT)) + sizeof (ValT)))) >? 3u)' is not a valid template argument for type 'unsigned int' because it is a non-constant expression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119790
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 19 Nov 2010 04:55:36 +0000 (04:55 +0000)]
Add an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119788
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 19 Nov 2010 04:47:19 +0000 (04:47 +0000)]
Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.
Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.
The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.
The IntervalMap is initially intended to be used with SlotIndex intervals for:
- Backing store for LiveIntervalUnion that is smaller and faster than std::set.
- Backing store for LiveInterval with less overhead than std::vector for typical
intervals and O(N log N) merging of large intervals. 99% of virtual registers
need 4 entries or less and would benefit from the small object optimization.
- Backing store for LiveDebugVariable which doesn't exist yet, but will track
debug variables during register allocation.
This is a work in progress. Missing items are:
- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119787
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 19 Nov 2010 04:10:13 +0000 (04:10 +0000)]
Fix llvm-gcc boostrap on OS X by avoiding printing sleb and uleb when
possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119785
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 19 Nov 2010 03:19:42 +0000 (03:19 +0000)]
unittests/CMakeLists.txt: [PR8225] Tweak linking JITTests on MSVC to add JITTests.def.
CMake can pass *.def to link.exe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119783
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 19 Nov 2010 03:19:32 +0000 (03:19 +0000)]
unittests/CMakeLists.txt: Suppress building ValueMapTest on MSVC older than 10(VS2010).
MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug.
See issue#331418 in Visual Studio.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119782
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 19 Nov 2010 03:19:26 +0000 (03:19 +0000)]
lit.GoogleTest: On case-insensitive filesystem, matching should be case-insensitive when directory name is checked with test_sub_dir.
On MSVS8, ${CMAKE_CFG_INTDIR}, aka $(OutDir), has capitalized name(eg. Debug), although $(OutDir) is made with lower case(eg. debug).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119781
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 19 Nov 2010 03:19:18 +0000 (03:19 +0000)]
CMakeLists.txt: On MSVS10, touch LLVM.sln as workaround, w/e project files are changed, to avoid the Dialog Hell. Thanks to Oscar.
FIXME: This could be removed with future version of CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119780
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 19 Nov 2010 02:26:16 +0000 (02:26 +0000)]
Change some methods in MCDwarf.cpp to be able to handle an arbitrary
MCStreamer instead of just MCObjectStreamer. Address changes cannot
be as efficient as we have to use DW_LNE_set_addres, but at least
most of the logic is shared.
This will be used so that, with CodeGen still using EmitDwarfLocDirective,
llvm-gcc is able to produce debug_line sections without needing an
assembler that supports .loc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119777
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 19 Nov 2010 01:33:10 +0000 (01:33 +0000)]
Add MC encodings for some Thumb instructions. Test for a few of them. The "bx
lr" instruction cannot be tested just yet. It requires matching a "condition
code", but adding one of those makes things go south quickly...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119774
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 19 Nov 2010 01:21:03 +0000 (01:21 +0000)]
Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119773
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Fri, 19 Nov 2010 01:14:40 +0000 (01:14 +0000)]
Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.
Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.
The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.
The IntervalMap is initially intended to be used with SlotIndex intervals for:
- Backing store for LiveIntervalUnion that is smaller and faster than std::set.
- Backing store for LiveInterval with less overhead than std::vector for typical
intervals and O(N log N) merging of large intervals. 99% of virtual registers
need 4 entries or less and would benefit from the small object optimization.
- Backing store for LiveDebugVariable which doesn't exist yet, but will track
debug variables during register allocation.
This is a work in progress. Missing items are:
- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119772
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Fri, 19 Nov 2010 00:48:58 +0000 (00:48 +0000)]
Aligned and unaligned copies of the same string
were not hashing to the same value. Analysis
and patch by Frits van Bommel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119770
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 19 Nov 2010 00:38:19 +0000 (00:38 +0000)]
Use array_pod_sort because the list is contiguous.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119769
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Fri, 19 Nov 2010 00:28:38 +0000 (00:28 +0000)]
Provide Thumb2 encodings for strex and ldrex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119768
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Fri, 19 Nov 2010 00:27:09 +0000 (00:27 +0000)]
Minor cleanups to a few llvm_unreachable() calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119767
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 19 Nov 2010 00:05:15 +0000 (00:05 +0000)]
An 'unreachable' shouldn't have a '0 &&' prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119762
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 18 Nov 2010 23:43:05 +0000 (23:43 +0000)]
Add support for parsing the writeback ("!") token.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119761
91177308-0d34-0410-b5e6-
96231b3b80d8
Jason W Kim [Thu, 18 Nov 2010 23:37:15 +0000 (23:37 +0000)]
Fix .o emission of ARM movt/movw. MCSymbolRefExpr::VK_ARM_(HI||LO)16 for the .o path now works for ARM.
Note: lo16AllZero remains in ARMInstrInfo.td - It can be factored out when Thumb movt is repaired.
Existing tests cover this update.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119760
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 18 Nov 2010 23:36:54 +0000 (23:36 +0000)]
Give the exclamation point a name instead of a number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119759
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 23:30:10 +0000 (23:30 +0000)]
More tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119756
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 23:29:56 +0000 (23:29 +0000)]
Fix encodings for pkhbt, and fix some tests where I accidentally tested ARM mode instead of Thumb2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119755
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Thu, 18 Nov 2010 23:25:52 +0000 (23:25 +0000)]
Move getInitialFrameState() to TargetFrameInfo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119754
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 23:24:22 +0000 (23:24 +0000)]
ARM Encoding information for UXTAH and friends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119753
91177308-0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Thu, 18 Nov 2010 22:06:46 +0000 (22:06 +0000)]
Fix bug in DAGCombiner for ARM that was trying to do a ShiftCombine on illegal types (vector should be split first).
Added test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119749
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 18 Nov 2010 21:50:54 +0000 (21:50 +0000)]
Don't allocate the SmallVector of Registers. It gets messy figuring out who
should delete what when the object gets copied around. It's also making valgrind
upset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119747
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 21:46:31 +0000 (21:46 +0000)]
Provide Thumb2 encodings for mov's that come from MOVCC SDNodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119744
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 21:43:37 +0000 (21:43 +0000)]
Add ARM encoding information for LDRH post-increment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119743
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 18 Nov 2010 21:43:22 +0000 (21:43 +0000)]
Change the 'x' type modifier for Neon intrinsics to force a signed integer.
This makes it symmetric with the 'u' modifier that forces an unsigned type.
This is needed for unsigned vector shifts, where the shift amount still needs
to be signed. PR8482 (Radar
8603521).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119742
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Korobeynikov [Thu, 18 Nov 2010 21:19:35 +0000 (21:19 +0000)]
Move hasFP() and few related hooks to TargetFrameInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119740
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 18 Nov 2010 21:16:28 +0000 (21:16 +0000)]
Fix thinko: we must turn select(anyext, sext) into sext(select)
not anyext(select). Spotted by Frits van Bommel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119739
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 18 Nov 2010 21:16:28 +0000 (21:16 +0000)]
Split up ARM LowerShift function.
This function was being called from two different places for completely
unrelated reasons. During type legalization, it was called to expand 64-bit
shift operations. During operation legalization, it was called to handle
Neon vector shifts. The vector shift code was not written to check for
illegal types, since it was assumed to be only called after type legalization.
Fixed this by splitting off the 64-bit shift expansion into a separate
function. I don't have a particular testcase for this; I just noticed it
by inspection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119738
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 21:15:19 +0000 (21:15 +0000)]
More Thumb2 encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119737
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 20:32:18 +0000 (20:32 +0000)]
Fill out the set of Thumb2 multiplication operator encodings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119733
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 18 Nov 2010 20:05:18 +0000 (20:05 +0000)]
The DAGCombiner was threading select over pairs of extending loads even
if the extension types were not the same. The result was that if you
fed a select with sext and zext loads, as in the testcase, then it
would get turned into a zext (or sext) of the select, which is wrong
in the cases when it should have been an sext (resp. zext). Reported
and diagnosed by Sebastien Deldon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119728
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 18 Nov 2010 19:59:41 +0000 (19:59 +0000)]
Factor code for testing whether replacing one value with another
preserves LCSSA form out of ScalarEvolution and into the LoopInfo
class. Use it to check that SimplifyInstruction simplifications
are not breaking LCSSA form. Fixes PR8622.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119727
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 18 Nov 2010 19:44:29 +0000 (19:44 +0000)]
Missed the _RET versions of LDMIA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119726
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 18 Nov 2010 19:40:05 +0000 (19:40 +0000)]
Rewrite stack callee saved spills and restores to use push/pop instructions.
Remove movePastCSLoadStoreOps and associated code for simple pointer
increments. Update routines that depended upon other opcodes for save/restore.
Adjust all testcases accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119725
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 18:59:13 +0000 (18:59 +0000)]
Fix an order-of-deallocation issue where the AttrListImpl could be deallocated before the global
LLVMContext, causing memory errors. Patch by Peter Collingbourne.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119721
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 18:49:05 +0000 (18:49 +0000)]
Use thread-safe statics to avoid a static constructor here. This isn't thread-safe on MSVC, but we don't
support threaded LLVM there anyways.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119718
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 18:48:28 +0000 (18:48 +0000)]
Oops, missed this file when remaing ExpandPseudos to ExpandISelPseudos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119717
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 18:45:06 +0000 (18:45 +0000)]
Rename ExpandPseudos to ExpandISelPseudos to help clarify its role.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119716
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 18:32:40 +0000 (18:32 +0000)]
Completely rework the datastructure GVN uses to represent the value number to leader mapping. Previously,
this was a tree of hashtables, and a query recursed into the table for the immediate dominator ad infinitum
if the initial lookup failed. This led to really bad performance on tall, narrow CFGs.
We can instead replace it with what is conceptually a multimap of value numbers to leaders (actually
represented by a hashtable with a list of Value*'s as the value type), and then
determine which leader from that set to use very cheaply thanks to the DFS numberings maintained by
DominatorTree. Because there are typically few duplicates of a given value, this scan tends to be
quite fast. Additionally, we use a custom linked list and BumpPtr allocation to avoid any unnecessary
allocation in representing the value-side of the multimap.
This change brings with it a 15% (!) improvement in the total running time of GVN on 403.gcc, which I
think is pretty good considering that includes all the "real work" being done by MemDep as well.
The one downside to this approach is that we can no longer use GVN to perform simple conditional progation,
but that seems like an acceptable loss since we now have LVI and CorrelatedValuePropagation to pick up
the slack. If you see conditional propagation that's not happening, please file bugs against LVI or CVP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119714
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 18:01:40 +0000 (18:01 +0000)]
ARMPseudoInst instructions should default to being considered a single 4-byte
instruction. Any that may be expanded otherwise by MC lowering should
override this value. rdar://
8683274
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119713
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 17:44:17 +0000 (17:44 +0000)]
Fix typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119712
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 17:39:01 +0000 (17:39 +0000)]
Document the units for the Size field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119711
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 17:14:56 +0000 (17:14 +0000)]
Bounds-check APInt's operator[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119708
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 17:14:05 +0000 (17:14 +0000)]
ExpandPseudos doesn't have any dependencies, so it can use the
simple form of INITIALIZE_PASS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119707
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 17:06:31 +0000 (17:06 +0000)]
Strip trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119706
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 17:05:57 +0000 (17:05 +0000)]
Use llvm_unreachable for "impossible" situations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119705
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 17:05:13 +0000 (17:05 +0000)]
Add support for PHI-translating sext, zext, and trunc instructions,
enabling more PRE. PR8586.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119704
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 08:07:09 +0000 (08:07 +0000)]
slightly simplify code and substantially improve comment. Instead of
saying "it would be bad", give an example of what is going on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119695
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 08:00:57 +0000 (08:00 +0000)]
remove a pointless restriction from memcpyopt. It was
refusing to optimize two memcpy's like this:
copy A <- B
copy C <- A
if it couldn't prove that noalias(B,C). We can eliminate
the copy by producing a memmove instead of memcpy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119694
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 07:49:32 +0000 (07:49 +0000)]
filecheckize, this is still not optimal, see PR8643
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119693
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 07:39:57 +0000 (07:39 +0000)]
remove another pointless noalias check: M is a memcpy, so the
source and dest are known to not overlap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119692
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 07:38:43 +0000 (07:38 +0000)]
use AA::isNoAlias instead of open coding it. Remove an extraneous noalias check:
there is no need to check to see if the source and dest of a memcpy are noalias,
behavior is undefined if not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119691
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 07:32:33 +0000 (07:32 +0000)]
finish a thought.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119690
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 07:02:37 +0000 (07:02 +0000)]
rearrange some code, splitting memcpy/memcpy optimization
out of processMemCpy into its own function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119687
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 06:41:51 +0000 (06:41 +0000)]
allow eliminating an alloca that is just copied from an constant global
if it is passed as a byval argument. The byval argument will just be a
read, so it is safe to read from the original global instead. This allows
us to promote away the %agg.tmp alloca in PR8582
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119686
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 06:26:49 +0000 (06:26 +0000)]
enhance the "alloca is just a memcpy from constant global"
to ignore calls that obviously can't modify the alloca
because they are readonly/readnone.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119683
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 06:20:47 +0000 (06:20 +0000)]
fix a small oversight in the "eliminate memcpy from constant global"
optimization. If the alloca that is "memcpy'd from constant" also has
a memcpy from *it*, ignore it: it is a load. We now optimize the testcase to:
define void @test2() {
%B = alloca %T
%a = bitcast %T* @G to i8*
%b = bitcast %T* %B to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false)
call void @bar(i8* %b)
ret void
}
previously we would generate:
define void @test() {
%B = alloca %T
%b = bitcast %T* %B to i8*
%G.0 = getelementptr inbounds %T* @G, i32 0, i32 0
%tmp3 = load i8* %G.0, align 4
%G.1 = getelementptr inbounds %T* @G, i32 0, i32 1
%G.15 = bitcast [123 x i8]* %G.1 to i8*
%1 = bitcast [123 x i8]* %G.1 to i984*
%srcval = load i984* %1, align 1
%B.0 = getelementptr inbounds %T* %B, i32 0, i32 0
store i8 %tmp3, i8* %B.0, align 4
%B.1 = getelementptr inbounds %T* %B, i32 0, i32 1
%B.12 = bitcast [123 x i8]* %B.1 to i8*
%2 = bitcast [123 x i8]* %B.1 to i984*
store i984 %srcval, i984* %2, align 1
call void @bar(i8* %b)
ret void
}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119682
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 06:16:43 +0000 (06:16 +0000)]
filecheckize
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119681
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 02:53:02 +0000 (02:53 +0000)]
trivial QoI improvement. On this invalid input:
sahf movl 344(%rdi),%r14d
we used to produce:
t.s:2:1: error: unexpected token in argument list
^
we now produce:
t.s:1:11: error: unexpected token in argument list
sahf movl 344(%rdi),%r14d
^
rdar://
8581401
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119676
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 18 Nov 2010 02:15:42 +0000 (02:15 +0000)]
patch from Frits van Bommel:
The attached patch fixes IRBuilder and the NoFolder class so that when
NoFolder is used the instructions it generates are treated just like
the ones IRBuilder creates directly (insert into block, assign them a
name and debug info, as applicable).
It does this by
1) having NoFolder return Instruction*s instead of Value*s,
2) having IRBuilder call Insert(Value, Name) on values obtained from
the folder like it does on instructions it creates directly, and
3) adding an Insert(Constant*, const Twine& = "") overload which just
returns the constant so that the other folders shouldn't have any
extra overhead as long as inlining is enabled.
While I was there, I also added some missing (CreateFNeg and various
Create*Cast) methods to NoFolder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119614
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 18 Nov 2010 02:04:25 +0000 (02:04 +0000)]
Change CodeGen to use .loc directives. This produces a lot more readable output
and testing is easier. A good example is the unknown-location.ll test that
now can just look for ".loc 1 0 0". We also don't use a DW_LNE_set_address for
every address change anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119613
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 18 Nov 2010 01:43:23 +0000 (01:43 +0000)]
Silence compiler warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119610
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 01:39:50 +0000 (01:39 +0000)]
Remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119608
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 01:38:26 +0000 (01:38 +0000)]
ARM PseudoInst instructions don't need or use an assembler string. Get rid of
the operand to the pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119607
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 01:38:07 +0000 (01:38 +0000)]
Revert 119600 to unbreak the build. Francois, please investigate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119606
91177308-0d34-0410-b5e6-
96231b3b80d8
Dale Johannesen [Thu, 18 Nov 2010 01:35:23 +0000 (01:35 +0000)]
Do not throw away alignment when generating the DAG for
memset; we may need it to decide between MOVAPS and MOVUPS
later. Adjust a test that was looking for wrong code.
PR 3866 /
8675131.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119605
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Thu, 18 Nov 2010 01:28:51 +0000 (01:28 +0000)]
Code clean up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119604
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 01:20:48 +0000 (01:20 +0000)]
Add FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119603
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 01:15:56 +0000 (01:15 +0000)]
Refactor the ARM PICADD and PICLDR* instructions to really be pseudos and not
just pretend to be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119602
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 01:08:42 +0000 (01:08 +0000)]
Try again at providing Thumb2 encodings for basic multiplication operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119601
91177308-0d34-0410-b5e6-
96231b3b80d8
Francois Pichet [Thu, 18 Nov 2010 00:59:50 +0000 (00:59 +0000)]
Appease MSVC 2008: you can't use keyword this inside EXPECT_EQ().
This is because of bug 331418 on Microsoft Connect.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119600
91177308-0d34-0410-b5e6-
96231b3b80d8
John Thompson [Thu, 18 Nov 2010 00:50:20 +0000 (00:50 +0000)]
Fixed to use input redirection for source - to eliminate .s output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119599
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 18 Nov 2010 00:46:58 +0000 (00:46 +0000)]
Refactor a few ARM load instructions to better parameterize things and re-use
common encoding information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119598
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 00:42:51 +0000 (00:42 +0000)]
Revert r119593 while I figure out my testing disagrees with the buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119597
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Thu, 18 Nov 2010 00:34:22 +0000 (00:34 +0000)]
Introduce memoization for ScalarEvolution dominates and properlyDominates
queries, and SCEVExpander getRelevantLoop queries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119595
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 18 Nov 2010 00:19:10 +0000 (00:19 +0000)]
Provide correct Thumb2 encodings for basic multiplication operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119593
91177308-0d34-0410-b5e6-
96231b3b80d8
Oscar Fuentes [Thu, 18 Nov 2010 00:12:27 +0000 (00:12 +0000)]
Updated library dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119592
91177308-0d34-0410-b5e6-
96231b3b80d8
John Thompson [Wed, 17 Nov 2010 23:58:47 +0000 (23:58 +0000)]
Bug 8621 fix - pointer cast stripped from inline asm constraint argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119590
91177308-0d34-0410-b5e6-
96231b3b80d8
Wesley Peck [Wed, 17 Nov 2010 23:35:07 +0000 (23:35 +0000)]
Make MCJIT work with CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119589
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Wed, 17 Nov 2010 23:33:14 +0000 (23:33 +0000)]
Clean up LEApcrel instuction(s) a bit. It's not really a Pseudo, so don't mark
it as such. Add some encoding information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119588
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Nov 2010 23:28:48 +0000 (23:28 +0000)]
Factor out the code for purging a SCEV from all the various memoization maps.
Some of these maps may merge in the future, but for now it's convenient to have
a utility function for them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119587
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Nov 2010 23:21:44 +0000 (23:21 +0000)]
Merge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
memoize the results. This improves compile time in code which highly complex
expressions which get queried many times.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119584
91177308-0d34-0410-b5e6-
96231b3b80d8
Wesley Peck [Wed, 17 Nov 2010 22:54:43 +0000 (22:54 +0000)]
Now that the MBlaze backend is in its own directory, split the test cases into multiple files for different types of instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119580
91177308-0d34-0410-b5e6-
96231b3b80d8
Dan Gohman [Wed, 17 Nov 2010 22:27:42 +0000 (22:27 +0000)]
Make SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand
to ScalarEvolution. Delete SCEV::~SCEV. SCEV is no longer virtual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119578
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Wed, 17 Nov 2010 22:16:31 +0000 (22:16 +0000)]
Second attempt at correct encodings for Thumb2 bitfield instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119575
91177308-0d34-0410-b5e6-
96231b3b80d8