Commit Graph

69890 Commits

Author SHA1 Message Date
Nick Lewycky
3ba974a1c5 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
2011-02-09 06:32:02 +00:00
NAKAMURA Takumi
f287f01cd1 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
2011-02-09 04:19:28 +00:00
NAKAMURA Takumi
c37b429484 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
2011-02-09 04:19:21 +00:00
NAKAMURA Takumi
302b169323 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
2011-02-09 04:19:15 +00:00
NAKAMURA Takumi
df944f1f83 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
2011-02-09 04:19:06 +00:00
NAKAMURA Takumi
b656a11c70 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
2011-02-09 04:18:58 +00:00
NAKAMURA Takumi
e29b0aca51 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
2011-02-09 04:18:48 +00:00
NAKAMURA Takumi
fd289497a5 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
2011-02-09 04:18:30 +00:00
NAKAMURA Takumi
2d52a612d9 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
2011-02-09 04:18:21 +00:00
NAKAMURA Takumi
ad1b453b24 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
2011-02-09 04:18:12 +00:00
NAKAMURA Takumi
4203b7116a llvm-lit may be available with CMake.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:18:02 +00:00
NAKAMURA Takumi
ce83025ad1 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
2011-02-09 04:17:54 +00:00
NAKAMURA Takumi
8d5e22aa74 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
2011-02-09 04:17:47 +00:00
NAKAMURA Takumi
fea2b517cf tools/llvm-ld: Cygwin can handle #!shbang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-09 04:17:39 +00:00
Jakob Stoklund Olesen
2710638db2 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
2011-02-09 01:14:03 +00:00
Jakob Stoklund Olesen
c3dca3f9d4 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
2011-02-09 00:25:36 +00:00
Jakob Stoklund Olesen
8a2bbdeee2 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
2011-02-08 23:26:48 +00:00
Jakob Stoklund Olesen
a50c539b7a 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
2011-02-08 23:02:58 +00:00
Rafael Espindola
b4cc031a3e 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
2011-02-08 22:40:47 +00:00
Owen Anderson
971b83b67a 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
2011-02-08 22:39:40 +00:00
Benjamin Kramer
0fd90bc12f 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
2011-02-08 22:29:56 +00:00
Jakob Stoklund Olesen
d08d77318a 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
2011-02-08 21:46:11 +00:00
Jakob Stoklund Olesen
8a61da8a68 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
2011-02-08 21:13:03 +00:00
Jakob Stoklund Olesen
124e423cce Trim debug spew
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125109 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 19:33:58 +00:00
Jakob Stoklund Olesen
7b1f498a76 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
2011-02-08 19:33:55 +00:00
David Greene
f125a29885 [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
2011-02-08 19:04:41 +00:00
Jakob Stoklund Olesen
5c716bdccc 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
2011-02-08 18:50:21 +00:00
Jakob Stoklund Olesen
01cb34b011 Add assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125101 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 18:50:18 +00:00
Andrew Trick
f73311bb64 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
2011-02-08 18:20:48 +00:00
Andrew Trick
de86cbdc57 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125095 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 18:07:10 +00:00
Andrew Trick
651c4ba80c PostRA antidependence breaker unit test for PR8986.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125091 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08 17:42:05 +00:00
Andrew Trick
e4f34cd4db 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
2011-02-08 17:41:12 +00:00
Andrew Trick
bc4bd92d52 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
2011-02-08 17:39:46 +00:00
Evan Cheng
75396a9988 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
2011-02-08 03:07:03 +00:00
Dan Gohman
3ef9838f89 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
2011-02-08 00:55:13 +00:00
Jakob Stoklund Olesen
11513e5d1e 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
2011-02-08 00:03:05 +00:00
Benjamin Kramer
33828bcb24 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
2011-02-07 22:37:28 +00:00
Bruno Cardoso Lopes
706d946cfe Add support for parsing dmb/dsb instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125055 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 22:09:15 +00:00
Devang Patel
480d1e3a67 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
2011-02-07 21:58:52 +00:00
Bruno Cardoso Lopes
fafde7f0b7 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
2011-02-07 21:41:25 +00:00
Chris Lattner
eb59ca976c fix comment change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125047 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 20:03:14 +00:00
Bruno Cardoso Lopes
e7a54520b3 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
2011-02-07 19:38:32 +00:00
David Greene
a5f2601e4d [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
2011-02-07 19:36:54 +00:00
Jason W Kim
c046d64f1b 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
2011-02-07 19:07:11 +00:00
Evan Cheng
aa26102db4 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
2011-02-07 18:50:47 +00:00
Devang Patel
8c8d95d0c2 Reduce test case, smaller is better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125019 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 18:24:18 +00:00
Bob Wilson
1c3ef90cab 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
2011-02-07 17:43:21 +00:00
Bob Wilson
7de6814405 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
2011-02-07 17:43:15 +00:00
Bob Wilson
6eb08dd9bf Fix some NEON instruction itineraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125012 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 17:43:12 +00:00
Bob Wilson
d3a076503b 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
2011-02-07 17:43:09 +00:00