Commit Graph

84634 Commits

Author SHA1 Message Date
Benjamin Kramer
c81fe9cab5 InstCombine: Fix comment to reflect the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162911 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 15:07:40 +00:00
Jakob Stoklund Olesen
e941df5e35 Don't use MCInstrDesc flags for implicit operands.
When a MachineInstr is constructed, its implicit operands are added
first, then the explicit operands are inserted before the implicits.

MCInstrDesc has oprand flags like early clobber and operand ties that
apply to the explicit operands.

Don't look at those flags when the implicit operands are first added in
the explicit operands's positions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162910 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 14:39:06 +00:00
Alexey Samsonov
1dfe9b5264 Whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162907 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 13:47:13 +00:00
Nadav Rotem
639570c311 It is illegal to transform (sdiv (ashr X c1) c2) -> (sdiv x (2^c1 * c2)),
because C always rounds towards zero.

Thanks Dirk and Ben.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162899 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 11:23:20 +00:00
Tim Northover
c4a32e6596 Add support for moving pure S-register to NEON pipeline if desired
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162898 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 10:17:45 +00:00
Nadav Rotem
f52f6b9eca remove old docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162896 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 09:23:13 +00:00
Alexey Samsonov
38a6381c0a Refactor fetching file/line info from DWARFContext to simplify the
code and allow better code reuse. Make the code a bit more conforming
to LLVM code style.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162895 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 07:49:50 +00:00
Craig Topper
6b1e1d8b3d Add FMA to switch statement in VectorLegalizer::LegalizeOp so that it can be expanded when it isn't legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162894 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 07:34:22 +00:00
Craig Topper
3b9dfc9bf7 Add support for FMA to WidenVectorResult.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162893 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 07:13:41 +00:00
Craig Topper
b1bdd7d818 Only perform DAG combine on FMAs of legal types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162892 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 06:56:15 +00:00
Bill Wendling
73996f4407 Pass by pointer and not std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162888 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 01:32:31 +00:00
Michael Liao
b6efbd2145 Should put test case under test/ExecutionEngine/MCJIT/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162885 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 00:43:57 +00:00
Bill Wendling
6e5190c193 Revert r162855 in favor of changing clang to emit the absolute coverage file path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162883 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 00:34:21 +00:00
Will Dietz
55a4b514fa Fix HashString's Bernstein hash to use unsigned chars, as is usually done.
Changes the hash result for strings containing characters
with values >= 128, such as UTF8 strings (not normal ASCII).

Changed mostly so we match other implementations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162882 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 00:30:21 +00:00
Michael Liao
faa1159a69 Fix PR13727
- The root cause is that target constant materialization in X86 fast-isel
  creates a PC-rel addressing which may overflow 32-bit range in non-Small code
  model if .rodata section is allocated too far away from code segment in
  MCJIT, which uses Large code model so far.
- Follow the similar logic to fix non-Small code model in fast-isel by skipping
  non-Small code model.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162881 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-30 00:30:16 +00:00
Jakob Stoklund Olesen
b4e090dffc Add a bit of documentation to copyPhysReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162879 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 23:52:55 +00:00
Jakob Stoklund Olesen
492d76b02e Verify the order of tied operands in inline asm.
When there are multiple tied use-def pairs on an inline asm instruction,
the tied uses must appear in the same order as the defs.

It is possible to write an LLVM IR inline asm instruction that breaks
this constraint, but there is no reason for a front end to emit the
operands out of order.

The gnu inline asm syntax specifies tied operands as a single read/write
constraint "+r", so ouf of order operands are not possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162878 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 23:52:52 +00:00
Benjamin Kramer
4d69a8c8b2 Explicitly cast an expression to bool before handing it off to __builtin_expect.
Avoids surprises when someone uses LLVM_(UN)LIKELY with an integer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162877 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 23:28:45 +00:00
Benjamin Kramer
e160c53fbe Add some __builtin_expect magic to StringMap.
Tombstones and full hash collisions are rare, mark the "empty"
and "no collision" paths as likely. The bug in simplifycfg
that prevented the hints from being picked during selfhost
up was fixed recently :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162874 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 22:57:04 +00:00
Benjamin Kramer
55907d1274 Replace the BUILTIN_EXPECT macro with a less horrible LLVM_LIKELY/LLVM_UNLIKELY interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162873 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 22:57:00 +00:00
Owen Anderson
15b7a98ece Allow targets to specify a minimum supported NOP size when performing NOP padding. If the desired padding is smaller than the supported NOP size,
we will enlarge the padding to make it work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162870 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 22:18:56 +00:00
Jakob Stoklund Olesen
66390805ad Set the isTied flags when building INLINEASM MachineInstrs.
For normal instructions, isTied() is set automatically by addOperand(),
based on MCInstrDesc, but inline asm has tied operands outside the
descriptor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162869 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 22:02:00 +00:00
Andrew Trick
b1b97833ae Preserve branch profile metadata during switch formation.
Patch by Michael Ilseman!
This fixes SimplifyCFGOpt::FoldValueComparisonIntoPredecessors to preserve metata when folding conditional branches into switches.

void foo(int x) {
  if (x == 0)
    bar(1);
  else if (__builtin_expect(x == 10, 1))
    bar(2);
  else if (x == 20)
    bar(3);
}

CFG:

B0
|  \
|   X0
B10
|  \
|   X10
B20
|  \
E   X20

Merge B0-B10:
w(B0-X0) = w(B0-X0)*sum-weights(B10) = w(B0-X0) * (w(B10-X10) + w(B10-B20))
w(B0-X10) = w(B0-B10) * w(B10-X10)
w(B0-B20) = w(B0-B10) * w(B10-B20)

B0 __
| \  \
| X10 X0
B20
|  \
E  X20

Merge B0-B20:
w(B0-X0) = w(B0-X0) * sum-weights(B20) = w(B0-X0) * (w(B20-E) + w(B20-X20))
w(B0-X10) = w(B0-X10) * sum-weights(B20) = ...
w(B0-X20) = w(B0-B20) * w(B20-X20)
w(B0-E) = w(B0-B20) * w(B20-E)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162868 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 21:46:38 +00:00
Andrew Trick
6b01438dec whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162867 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 21:46:36 +00:00
Jakob Stoklund Olesen
f036f7a1e7 Rename hasVolatileMemoryRef() to hasOrderedMemoryRef().
Ordered memory operations are more constrained than volatile loads and
stores because they must be ordered with respect to all other memory
operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162861 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 21:19:21 +00:00
Jakob Stoklund Olesen
ad7ebc2aeb Add MachineMemOperand::isUnordered().
This means the same as LoadInst/StoreInst::isUnordered(), and implies
!isVolatile().

Atomic loads and stored are also ordered, and this is the right method
to check if it is safe to reorder memory operations. Ordered atomics
can't be reordered wrt normal loads and stores, which is a stronger
constraint than volatile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162859 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 21:08:52 +00:00
Jakob Stoklund Olesen
0d75858395 Don't move normal loads across volatile/atomic loads.
It is technically allowed to move a normal load across a volatile load,
but probably not a good idea.

It is not allowed to move a load across an atomic load with
Ordering > Monotonic, and we model those with MOVolatile as well.

I recently removed the mayStore flag from atomic load instructions, so
they don't need a pseudo-opcode. This patch makes up for the difference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162857 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 20:48:45 +00:00
Michael Liao
688c1cd6c9 fix C++ comment in C header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162856 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 20:32:13 +00:00
Bill Wendling
0e76db9ad4 Use the full path to output the .gcda file.
This lets the user run the program from a different directory and still have the
.gcda files show up in the correct place.
<rdar://problem/12179524>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162855 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 20:30:44 +00:00
Hal Finkel
bbd169b1d9 Reserve space for the mandatory traceback fields on PPC64.
We need to reserve space for the mandatory traceback fields,
though leaving them as zero is appropriate for now.

Although the ABI calls for these fields to be filled in fully, no
compiler on Linux currently does this, and GDB does not read these
fields.  GDB uses the first word of zeroes during exception handling to
find the end of the function and the size field, allowing it to compute
the beginning of the function.  DWARF information is used for everything
else.  We need the extra 8 bytes of pad so the size field is found in
the right place.

As a comparison, GCC fills in a few of the fields -- language, number
of saved registers -- but ignores the rest.  IBM's proprietary OSes do
make use of the full traceback table facility.

Patch by Bill Schmidt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162854 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 20:22:24 +00:00
Bill Wendling
21b742ffce Use ArrayRef instead of SmallVector when passing vector into function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162851 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 18:45:41 +00:00
Jakob Stoklund Olesen
90a4f78d3b Verify the consistency of inline asm operands.
The operands on an INLINEASM machine instruction are divided into groups
headed by immediate flag operands. Verify this structure.

Extract verifyTiedOperands(), and only call it for non-inlineasm
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162849 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 18:11:05 +00:00
Eric Christopher
17dd9a992a Clean this up slightly, doesn't really fall through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162848 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 17:59:32 +00:00
Tim Northover
20599ea4bc Refactor setExecutionDomain to be clearer about what it's doing and more robust.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162844 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 16:36:07 +00:00
Benjamin Kramer
773eb97bba Make helper function static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 16:17:01 +00:00
Benjamin Kramer
8e0d1c03ca Make MemoryBuiltins aware of TargetLibraryInfo.
This disables malloc-specific optimization when -fno-builtin (or -ffreestanding)
is specified. This has been a problem for a long time but became more severe
with the recent memory builtin improvements.

Since the memory builtin functions are used everywhere, this required passing
TLI in many places. This means that functions that now have an optional TLI
argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead
mallocs anymore if the TLI argument is missing. I've updated most passes to do
the right thing.

Fixes PR13694 and probably others.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162841 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 15:32:21 +00:00
Craig Topper
fd49821c35 Convert FMA4 patterns to use target specific nodes instead of intrinsics to align with FMA3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162829 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 07:18:25 +00:00
Craig Topper
1f7210e808 Make use of the LLVM_DELETED_FUNCTION macro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162828 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 06:28:46 +00:00
Craig Topper
345d16ddcc Add virtual keywords for methods that override the base class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162826 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 05:48:09 +00:00
Andrew Trick
7611a88b58 Cleanup sloppy code. Jakob's review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 04:41:37 +00:00
Andrew Trick
2b70dfaaeb Fix a nondeterminism in the ARM assembler.
Adding arbitrary records to ARM.td would break
basic-arm-instructions.s because selection of nop vs mov r0,r0 was
ambiguous (this will be tested by a subsequent addition to ARM.td).
An imperfect but sensible fix is to give precedence to match rules
that have more constraints.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162824 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 03:52:57 +00:00
Jush Lu
c4dc2490c4 [arm-fast-isel] Add support for ARM PIC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162823 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 02:41:21 +00:00
Andrew Trick
f26e43df26 Fix ARM vector copies of overlapping register tuples.
I have tested the fix, but have not been successfull in generating
a robust unit test. This can only be exposed through particular
register assignments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162821 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 01:58:55 +00:00
Andrew Trick
d79dedd458 cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162820 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 01:58:52 +00:00
NAKAMURA Takumi
68990df1f9 Create llvm/test/Object/Mips/lit.local.cfg to check Mips in targets_to_build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162819 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 01:37:57 +00:00
Jakob Stoklund Olesen
ca71c5debe Verify the tied operand flags.
WHen running with -verify-machineinstrs, check that tied operands come
in matching use/def pairs, and that they are consistent with MCInstrDesc
when it applies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 00:38:03 +00:00
Chandler Carruth
d9f3dd96b2 Enable recursing into the compiler-rt projcet with the CMake build.
This only fires if using a recent enough CMake -- compiler-rt uses a few
of the more advanced features that not everyone needs.

Please let me know if anyone sees issues with this. I'll be updating
documentation and other stuff to tell people about this.

Many thanks to Alexey for doing a ton of work to get ASan's CMake build
into a really fantastic shape. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162815 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 00:38:02 +00:00
Jakob Stoklund Olesen
699ac04951 Maintain a vaild isTied bit as operands are added and removed.
The isTied bit is set automatically when a tied use is added and
MCInstrDesc indicates a tied operand. The tie is broken when one of the
tied operands is removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162814 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 00:37:58 +00:00
NAKAMURA Takumi
14b5bac547 llvm/test: [CMake] Add profile_rt-shared to deps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162813 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 00:37:56 +00:00
NAKAMURA Takumi
20f09ac39a libprofile: [CMake] Let libprofile_rt be not loadable_module but shared library. Autoconf's one does so.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162812 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29 00:37:51 +00:00