oota-llvm.git
11 years agoFix compiling the ocaml kaleidoscope tutorials
Erick Tryzelaar [Wed, 9 Feb 2011 18:32:02 +0000 (18:32 +0000)]
Fix compiling the ocaml kaleidoscope tutorials

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

11 years agoFormatting and comment tweaks.
Duncan Sands [Wed, 9 Feb 2011 17:45:03 +0000 (17:45 +0000)]
Formatting and comment tweaks.

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

11 years agoTeach instsimplify some tricks about exact/nuw/nsw shifts.
Chris Lattner [Wed, 9 Feb 2011 17:15:04 +0000 (17:15 +0000)]
Teach instsimplify some tricks about exact/nuw/nsw shifts.
improve interfaces to instsimplify to take this info.

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

11 years agomerge two tests.
Chris Lattner [Wed, 9 Feb 2011 17:06:41 +0000 (17:06 +0000)]
merge two tests.

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

11 years agoRework InstrTypes.h so to reduce the repetition around the NSW/NUW/Exact
Chris Lattner [Wed, 9 Feb 2011 17:00:45 +0000 (17:00 +0000)]
Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/Exact
versions of creation functions.  Eventually, the "insertion point" versions
of these should just be removed, we do have IRBuilder afterall.

Do a massive rewrite of much of pattern match.  It is now shorter and less
redundant and has several other widgets I will be using in other patches.
Among other changes, m_Div is renamed to m_IDiv (since it only matches
integer divides) and m_Shift is gone (it used to match all binops!!) and
we now have m_LogicalShift for the one client to use.

Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv
and reduce redundancy within IRbuilder by having these methods chain to
each other more instead of duplicating code.

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

11 years agoemit a specific error when the input file is empty. This fixes
Chris Lattner [Wed, 9 Feb 2011 16:46:02 +0000 (16:46 +0000)]
emit a specific error when the input file is empty.  This fixes
an annoyance of mine when working on tests: if the input .ll file
is broken, opt outputs an error and generates an empty file.  FileCheck
then emits its "ooh I couldn't find the first CHECK line, scanning
from ..." which obfuscates the actual problem.

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

11 years agofix typo
Chris Lattner [Wed, 9 Feb 2011 16:44:44 +0000 (16:44 +0000)]
fix typo

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

11 years agoenrich folder interfaces around exactness.
Chris Lattner [Wed, 9 Feb 2011 16:44:36 +0000 (16:44 +0000)]
enrich folder interfaces around exactness.

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

11 years agorefactor ConstantExpr interfaces a bit around "exactness".
Chris Lattner [Wed, 9 Feb 2011 16:43:07 +0000 (16:43 +0000)]
refactor ConstantExpr interfaces a bit around "exactness".

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

11 years agoremove a small scattering of basically pointless tests. These are
Chris Lattner [Wed, 9 Feb 2011 16:41:31 +0000 (16:41 +0000)]
remove a small scattering of basically pointless tests.  These are
all covered by llvm-test, which is what they were reduced from back
in 2003.

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

11 years agoremove a broken test, this is matching nounwind on intrinsics, not the old unwind...
Chris Lattner [Wed, 9 Feb 2011 16:40:56 +0000 (16:40 +0000)]
remove a broken test, this is matching nounwind on intrinsics, not the old unwind instruction

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

11 years ago[AVX] Implement 256-bit vector lowering for INSERT_VECTOR_ELT.
David Greene [Wed, 9 Feb 2011 15:32:06 +0000 (15:32 +0000)]
[AVX] Implement 256-bit vector lowering for INSERT_VECTOR_ELT.

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

11 years agoAdd intrinsic for setc instruction on the XCore.
Richard Osborne [Wed, 9 Feb 2011 13:22:12 +0000 (13:22 +0000)]
Add intrinsic for setc instruction on the XCore.

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

11 years agoWhen removing a function from the function set and adding it to deferred, we
Nick Lewycky [Wed, 9 Feb 2011 06:32:02 +0000 (06:32 +0000)]
When removing a function from the function set and adding it to deferred, we
could end up removing a different function than we intended because it was
functionally equivalent, then end up with a comparison of a function against
itself in the next round of comparisons (the one in the function set and the
one on the deferred list). To fix this, I introduce a choice in the form of
comparison for ComparableFunctions, either normal or "pointer only" used to
find exact Function*'s in lookups.

Also add some debugging statements.

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

11 years agoAdd testing stuff to CMake documents.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:19:28 +0000 (04:19 +0000)]
Add testing stuff to CMake documents.

  - Note "GnuWin32".
  - Note LLVM_LIT_TOOLS_DIR
  - Now we can run tests on VS w/e all tests might pass or not!

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

11 years agotest/lit.cfg: Seek sane tools(and bash) in directories and set to $PATH.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:19:21 +0000 (04:19 +0000)]
test/lit.cfg: Seek sane tools(and bash) in directories and set to $PATH.

LitConfig.getBashPath() will not seek in $PATH after LitConfig.getToolsPath() was executed.

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

11 years agolit/LitConfig.py: Add the new method getToolsPath(dir,paths,tools).
NAKAMURA Takumi [Wed, 9 Feb 2011 04:19:15 +0000 (04:19 +0000)]
lit/LitConfig.py: Add the new method getToolsPath(dir,paths,tools).

It seeks tools(eg. [cmp, grep, sed]) in same directory, to be sane.

It seeks "bash" only in the directory found at last time. Or bash would be insane (against other tools).

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

11 years agolit/Util.py: Add two functions, checkToolsPath(dir,tools) and whichTools(tools,paths).
NAKAMURA Takumi [Wed, 9 Feb 2011 04:19:06 +0000 (04:19 +0000)]
lit/Util.py: Add two functions, checkToolsPath(dir,tools) and whichTools(tools,paths).

checkToolsPath(dir,tools):
return True if "dir" contains all "tools".

whichTools(tools,paths):
return a directory that contains all "tools" in "paths".
Or return None when all "tools" were not met.

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

11 years agoCMake: Add the new option LLVM_LIT_TOOLS_DIR. It can specify "Path to GnuWin32 tools".
NAKAMURA Takumi [Wed, 9 Feb 2011 04:18:58 +0000 (04:18 +0000)]
CMake: Add the new option LLVM_LIT_TOOLS_DIR. It can specify "Path to GnuWin32 tools".

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

11 years agolib/Support/Errno.cpp: Check strerror_s() with HAVE_DECL_STRERROR_S in config.h.*.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:18:48 +0000 (04:18 +0000)]
lib/Support/Errno.cpp: Check strerror_s() with HAVE_DECL_STRERROR_S in config.h.*.

AC_CHECK_FUNCS seeks a symbol only in libs. We should check the declaration in string.h.

FIXME: I have never seen mingw(s) have strerror_s() (not _strerror_s()).
FIXME: Autoconf/CMake may seek strerror_s() with the definition MINGW_HAS_SECURE_API in future.

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

11 years agoWindows/Windows.h: Redefine _WIN32_WINNT here. mingw-w64 tends to define it as 0x0502...
NAKAMURA Takumi [Wed, 9 Feb 2011 04:18:30 +0000 (04:18 +0000)]
Windows/Windows.h: Redefine _WIN32_WINNT here. mingw-w64 tends to define it as 0x0502 in its headers.

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

11 years agoWindows/Program.inc: Eliminate the declaration of SetInformationJobObject(). It shoul...
NAKAMURA Takumi [Wed, 9 Feb 2011 04:18:21 +0000 (04:18 +0000)]
Windows/Program.inc: Eliminate the declaration of SetInformationJobObject(). It should be provided with _WIN32_WINNT>=0x0500.

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

11 years agoWindows/DynamicLibrary.inc: ELM_Callback fix for mingw-w64.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:18:12 +0000 (04:18 +0000)]
Windows/DynamicLibrary.inc: ELM_Callback fix for mingw-w64.

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

11 years agollvm-lit may be available with CMake.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:18:02 +0000 (04:18 +0000)]
llvm-lit may be available with CMake.

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

11 years agollvm-lit may be able to invoke clang tests.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:17:54 +0000 (04:17 +0000)]
llvm-lit may be able to invoke clang tests.

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

11 years agotools/llvm-ld/CMakeLists.txt: llvm-ld depends on llvm-stub at runtime.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:17:47 +0000 (04:17 +0000)]
tools/llvm-ld/CMakeLists.txt: llvm-ld depends on llvm-stub at runtime.

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

11 years agotools/llvm-ld: Cygwin can handle #!shbang.
NAKAMURA Takumi [Wed, 9 Feb 2011 04:17:39 +0000 (04:17 +0000)]
tools/llvm-ld: Cygwin can handle #!shbang.

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

11 years agoEvict a lighter single interference before attempting to split a live range.
Jakob Stoklund Olesen [Wed, 9 Feb 2011 01:14:03 +0000 (01:14 +0000)]
Evict a lighter single interference before attempting to split a live range.

Registers are not allocated strictly in spill weight order when live range
splitting and spilling has created new shorter intervals with higher spill
weights.

When one of the new heavy intervals conflicts with a single lighter interval,
simply evict the old interval instead of trying to split the heavy one.

The lighter interval is a better candidate for splitting, it has a smaller use
density.

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

11 years agoSet an allocation hint when rematting before a COPY.
Jakob Stoklund Olesen [Wed, 9 Feb 2011 00:25:36 +0000 (00:25 +0000)]
Set an allocation hint when rematting before a COPY.

This almost guarantees that the COPY will be coalesced.

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

11 years agoFix one more case of splitting after the last split point.
Jakob Stoklund Olesen [Tue, 8 Feb 2011 23:26:48 +0000 (23:26 +0000)]
Fix one more case of splitting after the last split point.

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

11 years agoReorganize interference code to check LastSplitPoint first.
Jakob Stoklund Olesen [Tue, 8 Feb 2011 23:02:58 +0000 (23:02 +0000)]
Reorganize interference code to check LastSplitPoint first.

The last split point can be anywhere in the block, so it interferes with the
strictly monotonic requirements of advanceTo().

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

11 years agoDon't open the file again in the gold plugin. To be able to do this, update
Rafael Espindola [Tue, 8 Feb 2011 22:40:47 +0000 (22:40 +0000)]
Don't open the file again in the gold plugin. To be able to do this, update
MemoryBuffer::getOpenFile to not close the file descriptor.

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

11 years agoRevert both r121082 (which broke a bunch of constant pool stuff) and r125074 (which...
Owen Anderson [Tue, 8 Feb 2011 22:39:40 +0000 (22:39 +0000)]
Revert both r121082 (which broke a bunch of constant pool stuff) and r125074 (which worked around it).  This should get us back to the old, correct behavior, though it will make the integrated assembler unhappy for the time being.

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

11 years agoSupport for .ifdef / .ifndef in the assembler parser. Patch by Joerg Sonnenberger.
Benjamin Kramer [Tue, 8 Feb 2011 22:29:56 +0000 (22:29 +0000)]
Support for .ifdef / .ifndef in the assembler parser. Patch by Joerg Sonnenberger.

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

11 years agoAlso handle the situation where an indirect branch is the first (and last)
Jakob Stoklund Olesen [Tue, 8 Feb 2011 21:46:11 +0000 (21:46 +0000)]
Also handle the situation where an indirect branch is the first (and last)
instruction in a basic block.

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

11 years agoAdd LiveIntervals::addKillFlags() to recompute kill flags after register allocation.
Jakob Stoklund Olesen [Tue, 8 Feb 2011 21:13:03 +0000 (21:13 +0000)]
Add LiveIntervals::addKillFlags() to recompute kill flags after register allocation.

This is a lot easier than trying to get kill flags right during live range
splitting and rematerialization.

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

11 years agoTrim debug spew
Jakob Stoklund Olesen [Tue, 8 Feb 2011 19:33:58 +0000 (19:33 +0000)]
Trim debug spew

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

11 years agoAvoid folding a load instruction into an instruction that redefines the register.
Jakob Stoklund Olesen [Tue, 8 Feb 2011 19:33:55 +0000 (19:33 +0000)]
Avoid folding a load instruction into an instruction that redefines the register.

The target hook doesn't know how to do that. (Neither do I).

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

11 years ago[AVX] Implement BUILD_VECTOR lowering for 256-bit vectors. For
David Greene [Tue, 8 Feb 2011 19:04:41 +0000 (19:04 +0000)]
[AVX] Implement BUILD_VECTOR lowering for 256-bit vectors.  For
anything but the simplest of cases, lower a 256-bit BUILD_VECTOR by
splitting it into 128-bit parts and recombining.

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

11 years agoAdd SplitEditor::overlapIntv() to create small ranges where both registers are live.
Jakob Stoklund Olesen [Tue, 8 Feb 2011 18:50:21 +0000 (18:50 +0000)]
Add SplitEditor::overlapIntv() to create small ranges where both registers are live.

If a live range is used by a terminator instruction, and that live range needs
to leave the block on the stack or in a different register, it can be necessary
to have both sides of the split live at the terminator instruction.

Example:

  %vreg2 = COPY %vreg1
  JMP %vreg1

Becomes after spilling %vreg2:

  SPILL %vreg1
  JMP %vreg1

The spill doesn't kill the register as is normally the case.

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

11 years agoAdd assertion.
Jakob Stoklund Olesen [Tue, 8 Feb 2011 18:50:18 +0000 (18:50 +0000)]
Add assertion.

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

11 years agoAdded bugpoint options: -compile-custom and -compile-command=...
Andrew Trick [Tue, 8 Feb 2011 18:20:48 +0000 (18:20 +0000)]
Added bugpoint options: -compile-custom and -compile-command=...

I've been using this mode to narrow down llc unit tests. Example
custom compile script:
llc "$@"
not pygrep.py 'mul\s+r([0-9]), r\1,' < bugpoint-test-program.s

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

11 years agowhitespace
Andrew Trick [Tue, 8 Feb 2011 18:07:10 +0000 (18:07 +0000)]
whitespace

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

11 years agoPostRA antidependence breaker unit test for PR8986.
Andrew Trick [Tue, 8 Feb 2011 17:42:05 +0000 (17:42 +0000)]
PostRA antidependence breaker unit test for PR8986.

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

11 years agoPostRA antidependence breaker unit test for rdar://8959122.
Andrew Trick [Tue, 8 Feb 2011 17:41:12 +0000 (17:41 +0000)]
PostRA antidependence breaker unit test for rdar://8959122.

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

11 years agoFix PostRA antidependence breaker.
Andrew Trick [Tue, 8 Feb 2011 17:39:46 +0000 (17:39 +0000)]
Fix PostRA antidependence breaker.

Avoid using the same register for two def operands or and earlyclobber
def and use operand. This fixes PR8986 and improves on the prior fix
for rdar://problem/8959122.

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

11 years agoTemporary workaround for a bad bug introduced by r121082 which replaced
Evan Cheng [Tue, 8 Feb 2011 03:07:03 +0000 (03:07 +0000)]
Temporary workaround for a bad bug introduced by r121082 which replaced
t2LDRpci with t2LDRi12.
There are a couple of problems with this.
1. The encoding for the literal and immediate constant are different.
   Note bit 7 of the literal case is 'U' so it can be negative.
2. t2LDRi12 is now narrowed to tLDRpci before constant island pass is run.
   So we end up never using the Thumb2 instruction, which ends up creating a
   lot more constant islands.

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

11 years agoDon't split any loop backedges, including backedges of loops other than
Dan Gohman [Tue, 8 Feb 2011 00:55:13 +0000 (00:55 +0000)]
Don't split any loop backedges, including backedges of loops other than
the active loop. This is generally desirable, and it avoids trouble
in situations such as the testcase in PR9123, though the failure
mode depends on use-list order, so it is infeasible to test.

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

11 years agoAdd LiveIntervals::shrinkToUses().
Jakob Stoklund Olesen [Tue, 8 Feb 2011 00:03:05 +0000 (00:03 +0000)]
Add LiveIntervals::shrinkToUses().

After uses of a live range are removed, recompute the live range to only cover
the remaining uses. This is necessary after rematerializing the value before
some (but not all) uses.

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

11 years agoSimplifyCFG: Track the number of used icmps when turning a icmp chain into a switch...
Benjamin Kramer [Mon, 7 Feb 2011 22:37:28 +0000 (22:37 +0000)]
SimplifyCFG: Track the number of used icmps when turning a icmp chain into a switch. If we used only one icmp, don't turn it into a switch.

Also prevent the switch-to-icmp transform from creating identity adds, noticed by Marius Wachtler.

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

11 years agoAdd support for parsing dmb/dsb instructions
Bruno Cardoso Lopes [Mon, 7 Feb 2011 22:09:15 +0000 (22:09 +0000)]
Add support for parsing dmb/dsb instructions

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

11 years agoRemove comment about an argument that was removed couple of years ago.
Devang Patel [Mon, 7 Feb 2011 21:58:52 +0000 (21:58 +0000)]
Remove comment about an argument that was removed couple of years ago.

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

11 years agoRemove the MCR asm parser hack and start using the custom target specific asm
Bruno Cardoso Lopes [Mon, 7 Feb 2011 21:41:25 +0000 (21:41 +0000)]
Remove the MCR asm parser hack and start using the custom target specific asm
parsing of operands introduced in r125030. As a small note, besides using a more
generic approach we can also have more descriptive output when debugging
llvm-mc, example:

mcr  p7, #1, r5, c1, c1, #4

note: parsed instruction:
  ['mcr', <ARMCC::al>,
          <coprocessor number: 7>,
          1,
          <register 73>,
          <coprocessor register: 1>,
          <coprocessor register: 1>,
          4]

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

11 years agofix comment change.
Chris Lattner [Mon, 7 Feb 2011 20:03:14 +0000 (20:03 +0000)]
fix comment change.

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

11 years agoImplement support for custom target specific asm parsing of operands.
Bruno Cardoso Lopes [Mon, 7 Feb 2011 19:38:32 +0000 (19:38 +0000)]
Implement support for custom target specific asm parsing of operands.
Motivation: Improve the parsing of not usual (different from registers or
immediates) operand forms.

This commit implements only the generic support. The ARM specific modifications
will come next.

A table like the one below is autogenerated for every instruction
containing a 'ParserMethod' in its AsmOperandClass

static const OperandMatchEntry OperandMatchTable[20] = {
 /* Mnemonic, Operand List Mask, Operand Class, Features */
 { "cdp", 29 /* 0, 2, 3, 4 */, MCK_Coproc, Feature_IsThumb|Feature_HasV6 },
 { "cdp", 58 /* 1, 3, 4, 5 */, MCK_Coproc, Feature_IsARM },

A matcher function very similar (but lot more naive) to
MatchInstructionImpl scans the table. After the mnemonic match, the
features are checked and if the "to be parsed" operand index is
present in the mask, there's a real match. Then, a switch like the one
below dispatch the parsing to the custom method provided in
'ParseMethod':

 case MCK_Coproc:
   return TryParseCoprocessorOperandName(Operands);

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

11 years ago[AVX] Insert/extract subvector lowering support. This includes a
David Greene [Mon, 7 Feb 2011 19:36:54 +0000 (19:36 +0000)]
[AVX] Insert/extract subvector lowering support.  This includes a
couple of utility functions that will be used in other places for more
AVX lowering.

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

11 years agoARM/MC/ELF Lowercase .cpu attributes in .s, but make them uppercase in .o
Jason W Kim [Mon, 7 Feb 2011 19:07:11 +0000 (19:07 +0000)]
ARM/MC/ELF Lowercase .cpu attributes in .s, but make them uppercase in .o

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

11 years agoFix an obvious typo which caused an isel assertion. rdar://8964854.
Evan Cheng [Mon, 7 Feb 2011 18:50:47 +0000 (18:50 +0000)]
Fix an obvious typo which caused an isel assertion. rdar://8964854.

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

11 years agoReduce test case, smaller is better.
Devang Patel [Mon, 7 Feb 2011 18:24:18 +0000 (18:24 +0000)]
Reduce test case, smaller is better.

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

11 years agoAdd codegen support for using post-increment NEON load/store instructions.
Bob Wilson [Mon, 7 Feb 2011 17:43:21 +0000 (17:43 +0000)]
Add codegen support for using post-increment NEON load/store instructions.

The vld1-lane, vld1-dup and vst1-lane instructions do not yet support using
post-increment versions, but all the rest of the NEON load/store instructions
should be handled now.

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

11 years agoChange VLD3/4 and VST3/4 for quad registers to not update the address register.
Bob Wilson [Mon, 7 Feb 2011 17:43:15 +0000 (17:43 +0000)]
Change VLD3/4 and VST3/4 for quad registers to not update the address register.

These operations are expanded to pairs of loads or stores, and the first one
uses the address register update to produce the address for the second one.
So far, the second load/store has also updated the address register, just
for convenience, since that output has never been used.  In anticipation of
actually supporting post-increment updates for these operations, this changes
the non-updating operations to use a non-updating load/store for the second
instruction.

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

11 years agoFix some NEON instruction itineraries.
Bob Wilson [Mon, 7 Feb 2011 17:43:12 +0000 (17:43 +0000)]
Fix some NEON instruction itineraries.

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

11 years agoFix a comment: addrmode6 no longer includes the optional writeback flag.
Bob Wilson [Mon, 7 Feb 2011 17:43:09 +0000 (17:43 +0000)]
Fix a comment: addrmode6 no longer includes the optional writeback flag.

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

11 years agoRemove inaccurate comments: so_imm and t2_so_imm operands are not encoded
Bob Wilson [Mon, 7 Feb 2011 17:43:06 +0000 (17:43 +0000)]
Remove inaccurate comments: so_imm and t2_so_imm operands are not encoded
until the instructions are emitted or printed.

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

11 years agoMove code for OffsetCompare struct closer to where it is used.
Bob Wilson [Mon, 7 Feb 2011 17:43:03 +0000 (17:43 +0000)]
Move code for OffsetCompare struct closer to where it is used.

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

11 years agoimplement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Chris Lattner [Mon, 7 Feb 2011 16:40:21 +0000 (16:40 +0000)]
implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.

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

11 years agoAdd an m_Div pattern for matching either a udiv or an sdiv and use it
Duncan Sands [Mon, 7 Feb 2011 09:36:32 +0000 (09:36 +0000)]
Add an m_Div pattern for matching either a udiv or an sdiv and use it
to simplify the "(X/Y)*Y->X when the division is exact" transform.

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

11 years agoAdd IRBuilder methods for creating an exact udiv, like for exact sdiv.
Duncan Sands [Mon, 7 Feb 2011 09:21:52 +0000 (09:21 +0000)]
Add IRBuilder methods for creating an exact udiv, like for exact sdiv.

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

11 years agoInstall only *.cmake files. Don't install .svn directory.
Oscar Fuentes [Mon, 7 Feb 2011 02:22:23 +0000 (02:22 +0000)]
Install only *.cmake files. Don't install .svn directory.

Fixes PR9159.

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

11 years agoTeach ARM/MC/ELF about gcc compatible reloc output to get past odd linkage
Jason W Kim [Mon, 7 Feb 2011 01:11:15 +0000 (01:11 +0000)]
Teach ARM/MC/ELF about gcc compatible reloc output to get past odd linkage
failures with relocations.

The code committed is a first cut at compatibility for emitted relocations in
ELF .o.

Why do this? because existing ARM tools like emitting relocs symbols as
explicit relocations, not as section-offset relocs.

Result is that with these changes,
1) relocs are now substantially identical what to gcc outputs.
2) larger apps (including many spec2k tests) compile, cross-link, and pass

Added reminder fixme to tests for future conversion to .s form.

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

11 years agoRework some .ARM.attribute work for improved gcc compatibility.
Jason W Kim [Mon, 7 Feb 2011 00:49:53 +0000 (00:49 +0000)]
Rework some .ARM.attribute work for improved gcc compatibility.
Unified EmitTextAttribute for both Asm and Obj emission (.cpu only)
Added necessary cortex-A8 related attrs for codegen compat tests.

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

11 years agoteach instsimplify to transform (X / Y) * Y to X
Chris Lattner [Sun, 6 Feb 2011 22:05:31 +0000 (22:05 +0000)]
teach instsimplify to transform (X / Y) * Y to X
when the div is an exact udiv.

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

11 years agorename test.
Chris Lattner [Sun, 6 Feb 2011 21:59:10 +0000 (21:59 +0000)]
rename test.

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

11 years agoenhance vmcore to know that udiv's can be exact, and add a trivial
Chris Lattner [Sun, 6 Feb 2011 21:44:57 +0000 (21:44 +0000)]
enhance vmcore to know that udiv's can be exact, and add a trivial
instcombine xform to exercise this.

Nothing forms exact udivs yet though.  This is progress on PR8862

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

11 years agoRemove premature optimization that avoided calculating argument weights
Eric Christopher [Sun, 6 Feb 2011 21:27:46 +0000 (21:27 +0000)]
Remove premature optimization that avoided calculating argument weights
if we weren't going to inline the function. The rest of the code using
this was removed.

Fixes PR9154.

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

11 years agoSimplify test, as suggested by Chris.
Anders Carlsson [Sun, 6 Feb 2011 20:22:49 +0000 (20:22 +0000)]
Simplify test, as suggested by Chris.

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

11 years agoRemove a virtual inheritance case that clang can devirtualize fully now.
Anders Carlsson [Sun, 6 Feb 2011 20:16:49 +0000 (20:16 +0000)]
Remove a virtual inheritance case that clang can devirtualize fully now.

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

11 years agoWhen loading from a constant, fold inttoptr if the integer type and the resulting...
Anders Carlsson [Sun, 6 Feb 2011 20:11:56 +0000 (20:11 +0000)]
When loading from a constant, fold inttoptr if the integer type and the resulting pointer type both have the same size.

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

11 years agoDon't define NDEBUG on MSVC_IDE and XCode builds. Fixes PR9155.
Oscar Fuentes [Sun, 6 Feb 2011 19:07:06 +0000 (19:07 +0000)]
Don't define NDEBUG on MSVC_IDE and XCode builds. Fixes PR9155.

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

11 years agoSimplify away redundant test, and document what's going on.
Nick Lewycky [Sun, 6 Feb 2011 05:04:00 +0000 (05:04 +0000)]
Simplify away redundant test, and document what's going on.

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

11 years agoRemove specialized comparison of InlineAsm objects. They're uniqued on creation
Nick Lewycky [Sun, 6 Feb 2011 04:33:50 +0000 (04:33 +0000)]
Remove specialized comparison of InlineAsm objects. They're uniqued on creation
now, and this wasn't comparing some of their relevant bits anyhow.

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

11 years agoMoved more stuff to HandleLLVMOptions.cmake
Oscar Fuentes [Sat, 5 Feb 2011 19:08:42 +0000 (19:08 +0000)]
Moved more stuff to HandleLLVMOptions.cmake

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

11 years agoFix another warning.
Anders Carlsson [Sat, 5 Feb 2011 18:33:43 +0000 (18:33 +0000)]
Fix another warning.

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

11 years agoFix a clang warning.
Anders Carlsson [Sat, 5 Feb 2011 18:19:35 +0000 (18:19 +0000)]
Fix a clang warning.

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

11 years agoWindows/DynamicLibrary.inc: Split explicit symbols into explicit_symbols.inc.
NAKAMURA Takumi [Sat, 5 Feb 2011 15:11:53 +0000 (15:11 +0000)]
Windows/DynamicLibrary.inc: Split explicit symbols into explicit_symbols.inc.

config.h.* have conditions whether each symbol is defined or not.
Autoconf and CMake may check symbols in libgcc.a for JIT on Mingw.

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

11 years agoTarget/X86: Tweak allocating shadow area (aka home) on Win64. It must be enough for...
NAKAMURA Takumi [Sat, 5 Feb 2011 15:11:32 +0000 (15:11 +0000)]
Target/X86: Tweak allocating shadow area (aka home) on Win64. It must be enough for caller to allocate one.

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

11 years agolib/Target/X86/X86ISelLowering.cpp: Introduce a new variable "IsWin64". No functional...
NAKAMURA Takumi [Sat, 5 Feb 2011 15:11:13 +0000 (15:11 +0000)]
lib/Target/X86/X86ISelLowering.cpp: Introduce a new variable "IsWin64". No functional changes.

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

11 years agolib/Target/X86/X86JITInfo.cpp: Add Win64 stuff.
NAKAMURA Takumi [Sat, 5 Feb 2011 15:11:03 +0000 (15:11 +0000)]
lib/Target/X86/X86JITInfo.cpp: Add Win64 stuff.

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

11 years agoTarget/X86: Fix whitespace.
NAKAMURA Takumi [Sat, 5 Feb 2011 15:10:54 +0000 (15:10 +0000)]
Target/X86: Fix whitespace.

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

11 years agoWindows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or...
NAKAMURA Takumi [Sat, 5 Feb 2011 08:53:12 +0000 (08:53 +0000)]
Windows/Program.inc: Quote arguments when dubious characters (used by cmd.exe or MSYS shell) are included to invoke CreateProcess(). Thanks to Danil Malyshev.

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

11 years agoMove a test that ended up in the wrong place.
Bob Wilson [Sat, 5 Feb 2011 04:15:50 +0000 (04:15 +0000)]
Move a test that ended up in the wrong place.

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

11 years agoFix an anti-dep breaker corner case.
Andrew Trick [Sat, 5 Feb 2011 02:58:46 +0000 (02:58 +0000)]
Fix an anti-dep breaker corner case.
<rdar://problem/8959122> illegal register operands for UMULL instruction in cfrac nightly test
I'm stil working on a unit test, but the case is:
rx = movcc rx, r3
r2 = ldr
r2, r3 = umull r2, r2

The anti-dep breaker should not convert this into an illegal instruction:
r2, r2 = umull

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

11 years agoFix cut and paste error spotted by Jakob.
Eric Christopher [Sat, 5 Feb 2011 02:48:47 +0000 (02:48 +0000)]
Fix cut and paste error spotted by Jakob.

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

11 years agoBe more strict about the first/last interference-free use.
Jakob Stoklund Olesen [Sat, 5 Feb 2011 01:06:39 +0000 (01:06 +0000)]
Be more strict about the first/last interference-free use.

If the interference overlaps the instruction, we cannot separate it.

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

11 years agoAdd assertions to verify that the new interval is clear of the interference.
Jakob Stoklund Olesen [Sat, 5 Feb 2011 01:06:36 +0000 (01:06 +0000)]
Add assertions to verify that the new interval is clear of the interference.

If these inequalities don't hold, we are creating a live range split that won't
allocate.

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

11 years agoRewrite how the indirect call bonus is handled. This now works by:
Eric Christopher [Sat, 5 Feb 2011 00:49:15 +0000 (00:49 +0000)]
Rewrite how the indirect call bonus is handled. This now works by:

a) Making it a per call site bonus for functions that we can move from
indirect to direct calls.
b) Reduces the bonus from 500 to 100 per call site.
c) Subtracts the size of the possible newly inlineable call from the
bonus to only add a bonus if we can inline a small function to devirtualize
it.

Also changes the bonus from a positive that's subtracted to a negative
that's added.

Fixes the remainder of rdar://8546196 by reducing the object file size
after inlining by 84%.

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

11 years ago[AVX] Revert 124910 until clients are ready.
David Greene [Sat, 5 Feb 2011 00:24:41 +0000 (00:24 +0000)]
[AVX] Revert 124910 until clients are ready.

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

11 years ago[AVX] Add some utilities to insert and extract 128-bit subvectors.
David Greene [Fri, 4 Feb 2011 23:29:33 +0000 (23:29 +0000)]
[AVX] Add some utilities to insert and extract 128-bit subvectors.
This allows us to easily support 256-bit operations that don't have
native 256-bit support.  This applies to integer operations, certain
types of shuffles and various othher things.

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

11 years agoMC/AsmMatcher: Sink ConvertToMCInst into the TargetAsmParser instance, which
Daniel Dunbar [Fri, 4 Feb 2011 23:17:40 +0000 (23:17 +0000)]
MC/AsmMatcher: Sink ConvertToMCInst into the TargetAsmParser instance, which
implicitly allows custom conversions to be member functions.

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

11 years agoApparently, it is possible for a block with a landing pad successor to have no calls.
Jakob Stoklund Olesen [Fri, 4 Feb 2011 23:11:13 +0000 (23:11 +0000)]
Apparently, it is possible for a block with a landing pad successor to have no calls.

In that case we simply ignore the landing pad and split live ranges before the
first terminator.

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