Commit Graph

107275 Commits

Author SHA1 Message Date
Craig Topper
16edb0e930 Fix some cases were ArrayRefs were being passed by reference. Also remove 'const' from some other ArrayRef uses since its implicitly const already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216524 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 05:25:00 +00:00
David Majnemer
dd5456bd01 InstCombine: Optimize GEP's involving ptrtoint better
We supported transforming:
(gep i8* X, -(ptrtoint Y))

to:
(inttoptr (sub (ptrtoint X), (ptrtoint Y)))

However, this only fired if 'X' had type i8*.  Generalize this to
support various types of different sizes.  This results in much better
CodeGen, especially for pointers to packed structs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216523 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 05:16:04 +00:00
David Blaikie
ad2a271781 Remove type unit skeletons. GDB no longer needs them & this saves a heap of space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216521 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 05:04:14 +00:00
Juergen Ributzka
fc03e72b4f [FastISel][AArch64] Fix address simplification.
When a shift with extension or an add with shift and extension cannot be folded
into the memory operation, then the address calculation has to be materialized
separately. While doing so the code forgot to consider a possible sign-/zero-
extension. This fix folds now also the sign-/zero-extension into the add or
shift instruction which is used to materialize the address.

This fixes rdar://problem/18141718.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216511 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 00:58:30 +00:00
Juergen Ributzka
836f4bd090 [FastISel][AArch64] Fold Sign-/Zero-Extend into the shift immediate instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216510 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 00:58:26 +00:00
David Blaikie
c04b78627d Fix a couple of debug info test cases to match the metadata schema change in r216239
Found these while testing something else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216505 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 00:04:16 +00:00
Rafael Espindola
fb1af0a48a Pass a std::unique_ptr<MemoryBuffer>& to getLazyBitcodeModule.
By taking a reference we can do the ownership transfer in one place instead of
expecting every caller to do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216492 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 22:00:09 +00:00
Rafael Espindola
2292996e1a Pass a MemoryBufferRef when we can avoid taking ownership.
The attached patch simplifies a few interfaces that don't need to take
ownership of a buffer.

For example, both parseAssembly and parseBitcodeFile will parse the
entire buffer before returning. There is no need to take ownership.

Using a MemoryBufferRef makes it obvious in the type signature that
there is no ownership transfer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216488 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 21:49:01 +00:00
Rafael Espindola
af07403c3e Give ExecutionEngine of top level buffers.
Long term the idea if for the engine to not own the buffers, but for now
this is consistent with the rest of the API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216484 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 21:04:04 +00:00
Reid Kleckner
3c92309f0d MC: Split the x86 asm matcher implementations by dialect
The existing matcher has lots of AT&T assembly dialect assumptions baked
into it.  In particular, the hack for resolving the size of a memory
operand by appending the four most common suffixes doesn't work at all.
The Intel assembly dialect mnemonic table has ambiguous entries, so we
need to try matching multiple times with different operand sizes, since
that's the only way to choose different instruction variants.

This makes us more compatible with gas's implementation of Intel
assembly syntax.  MSVC assumes you want byte-sized operations for the
instructions that we reject as ambiguous.

Reviewed By: grosbach

Differential Revision: http://reviews.llvm.org/D4747

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216481 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 20:32:34 +00:00
Joerg Sonnenberger
1d5cdfd751 Revert r210342 and r210343, add test case for the crasher.
PR 20642.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216475 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 19:06:41 +00:00
Joerg Sonnenberger
a5718c69b4 Convert MC command line option for fatal assembler warnings into a
proper flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216471 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 18:39:50 +00:00
Rafael Espindola
de2d08ea17 Invert the condition to have a single return.
Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216468 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 18:03:35 +00:00
Rafael Espindola
81e49922a8 Return a std::unique_ptr from the IRReader.h functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216466 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 17:29:46 +00:00
Rafael Espindola
1bfd87a150 Return a std::unique_ptr from parseInputFile and propagate. NFC.
The memory management in BugPoint is fairly convoluted, so this just unwraps
one layer by changing the return type of functions that always return
owned Modules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216464 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 17:19:03 +00:00
Rafael Espindola
85ae5fc082 Simplify LTOModule::makeLTOModule a bit. NFC.
Just call parseBitcodeFile instead of getLazyBitcodeModule followed by
materializeAllPermanently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216461 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 15:09:32 +00:00
Rafael Espindola
9be4884731 Merge TempDir and system_temp_directory.
We had two functions for finding the temp or cache directory. Each had a
different set of smarts about OS specific APIs.

With this patch system_temp_directory becomes the only way to do it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216460 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 14:47:52 +00:00
Benjamin Kramer
083c9de5a0 Silence unused function warning in Release builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216458 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 14:22:05 +00:00
James Molloy
698eabd8b7 Change the return value of "getEnd()" from a MachineInstr* to a MachineBasicBlock::iterator.
It seems on Darwin the illegal round-trip ::iterator -> MachineInstr* -> ::iterator breaks execution horribly when the iterator is not a real MachineInstr, like ::end().



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216455 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 13:41:31 +00:00
Yi Kong
2282afa6cc ARM: Add patterns for dbg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216451 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 12:47:26 +00:00
Dinesh Dwivedi
52c92df181 This patch enables SimplifyUsingDistributiveLaws() to handle following pattens.
(X >> Z) & (Y >> Z)  -> (X&Y) >> Z  for all shifts.
(X >> Z) | (Y >> Z)  -> (X|Y) >> Z  for all shifts.
(X >> Z) ^ (Y >> Z)  -> (X^Y) >> Z  for all shifts.

These patterns were previously handled separately in visitAnd()/visitOr()/visitXor().

Differential Revision: http://reviews.llvm.org/D4951


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216443 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 08:53:32 +00:00
Bill Wendling
647d329db3 Use 'xz' compression instead of 'gz'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216442 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 08:11:22 +00:00
David Majnemer
8058ffeb18 InstSimplify: Fold gep X, (sub 0, ptrtoint(X)) to null
Save InstCombine some work if we can perform this fold during
InstSimplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216441 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 07:08:03 +00:00
David Majnemer
594e4a1dd3 InstSimplify: Simplify trivial pointer expressions like b + (e - b)
consider:
long long *f(long long *b, long long *e) {
  return b + (e - b);
}

we would lower this to something like:
define i64* @f(i64* %b, i64* %e) {
  %1 = ptrtoint i64* %e to i64
  %2 = ptrtoint i64* %b to i64
  %3 = sub i64 %1, %2
  %4 = ashr exact i64 %3, 3
  %5 = getelementptr inbounds i64* %b, i64 %4
  ret i64* %5
}

This should fold away to just 'e'.

N.B.  This adds m_SpecificInt as a convenient way to match against a
particular 64-bit integer when using LLVM's match interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216439 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 05:55:16 +00:00
Dylan Noblesmith
2db57b44de AArch64: use std::fill instead of memset
Followup based on review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216436 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 03:33:26 +00:00
Dylan Noblesmith
4a3195c40d Revert "AArch64: use std::vector for temp array"
This reverts commit r216365.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216433 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:43 +00:00
Dylan Noblesmith
7532912545 Analysis: cleanup
Address review comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216432 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:40 +00:00
Dylan Noblesmith
8cb2706af6 Revert "Analysis: unique_ptr-ify DependenceAnalysis::collectCoeffInfo"
This reverts commit r216358.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216431 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:38 +00:00
Dylan Noblesmith
ce0adaab88 Revert "NVPTX: remove another raw delete call"
This reverts commit r216364.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216430 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:35 +00:00
Dylan Noblesmith
ae65d0e330 Revert "Support/APFloat: unique_ptr-ify temp arrays"
This reverts commit rr216359.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216429 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:33 +00:00
Dylan Noblesmith
27dc1b8446 Revert "Support/Path: remove raw delete"
This reverts commit r216360.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216428 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:30 +00:00
Dylan Noblesmith
759a71a1fa ExecutionEngine: address review comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216427 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:28 +00:00
Dylan Noblesmith
71499d3a5d CodeGen/LiveVariables: use vector::assign()
Address review comments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216426 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 02:03:25 +00:00
Reid Kleckner
fad8d818db musttail: Don't eliminate varargs packs if there is a forwarding call
Also clean up and beef up this grep test for the feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216425 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 00:59:51 +00:00
Sanjay Patel
18637beefe fix typos in comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216424 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 00:59:15 +00:00
Reid Kleckner
44b3a0b411 Declare that musttail calls in variadic functions forward the ellipsis
Summary:
There is no functionality change here except in the way we assemble and
dump musttail calls in variadic functions. There's really no need to
separate out the bits for musttail and "is forwarding varargs" on call
instructions. A musttail call by definition has to forward the ellipsis
or it would fail verification.

Reviewers: chandlerc, nlewycky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D4892

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216423 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 00:33:28 +00:00
Reid Kleckner
64bb4a64e7 Fix Path unittests on Windows after raw_fd_ostream changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216422 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-26 00:24:23 +00:00
Reid Kleckner
9d1f8b1b21 ArgPromotion: Don't touch variadic functions
Adding, removing, or changing non-pack parameters can change the ABI
classification of pack parameters. Clang and other frontends encode the
classification in the IR of the call site, but the callee side
determines it dynamically based on the number of registers consumed so
far. Changing the prototype affects the number of registers consumed
would break such code.

Dead argument elimination performs a similar task and already has a
similar check to avoid this problem.

Patch by Thomas Jablin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216421 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 23:58:48 +00:00
Lang Hames
9fe621a69e [MCJIT][SystemZ] Use a simpler expression for indirect relocation offsets.
The expressions 'Reloc.Addend - Addend' and 'Reloc.Offset' should always be
equal in this context. The latter is prefered - we want to remove the
RelocationValueRef::Addend field in the future.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216418 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 23:33:48 +00:00
Rafael Espindola
c33fe1b296 Fix bug in llvm::sys::argumentsFitWithinSystemLimits().
This patch fixes a subtle bug in the UNIX implementation of
llvm::sys::argumentsFitWithinSystemLimits() regarding the misuse of a static
variable. This bug causes our cached number that stores the system command line
maximum length to be halved after each call to the function. With a sufficient
number of calls to this function, it will eventually report any given command
line string to be over system limits.

Patch by Rafael Auler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216415 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 22:53:21 +00:00
Lang Hames
476f2435f5 [MCJIT] Dump section memory both before and after relocations are applied.
Also switch section memory dump format from 8 to 16 columns.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216413 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 22:19:14 +00:00
Rafael Espindola
749c73842d Refactor argument serialization logic when executing process. NFC.
This patch refactors the argument serialization logic used in the Execute
function, used to launch new Windows processes. There is a critical step that
joins char** arguments into a single string, building the command line used to
launch the new process, and the readability of this code is improved if this
part is refactored in its own helper function.

Patch by Rafael Auler!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216411 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 22:15:06 +00:00
Juergen Ributzka
670885e56e [FastISel][AArch64] Refactor float zero materialization. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216403 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 19:58:05 +00:00
Lang Hames
f9526ac188 [MCJIT] Make RuntimeDyld dump section contents in -debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216400 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 18:37:38 +00:00
Rafael Espindola
8c96862847 Modernize raw_fd_ostream's constructor a bit.
Take a StringRef instead of a "const char *".
Take a "std::error_code &" instead of a "std::string &" for error.

A create static method would be even better, but this patch is already a bit too
big.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216393 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 18:16:47 +00:00
Chandler Carruth
a4c8f31dd0 [x86] Fix a bug in r216319 where I was missing a 'break'.
This actually was caught by existing tests but those tests were disabled
with an XFAIL because of PR20736. While working on fixing that,
I noticed the test failure, and tracked it down to this.

We even have a really nice Clang warning that would have caught this but
it isn't enabled in LLVM! =[ I may look at enabling it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216391 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 18:06:11 +00:00
Bruno Cardoso Lopes
ff69509f94 Remove dangling initializers in GlobalDCE
GlobalDCE deletes global vars and updates their initializers to nullptr
while leaving underlying constants to be cleaned up later by its uses.
The clean up may never happen, fix this by forcing it every time it's
safe to destroy constants.

Final patch by Rafael Espindola
http://reviews.llvm.org/D4931

<rdar://problem/17523868>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216390 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 17:51:14 +00:00
Bruno Cardoso Lopes
a696ccb89e Rise from the dead and update personal info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 17:51:04 +00:00
Chad Rosier
373fc00835 [AArch32] Add patterns for VCVT{A,N,P,M}.
Patterns for lowering libm calls to VCVT{A,N,P,M} are also included.
Phabricator Revision: http://reviews.llvm.org/D5033

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216388 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 16:56:33 +00:00
Robert Khasanov
cc4b123a47 [SKX] avx512_icmp_packed multiclass extension
Extended avx512_icmp_packed multiclass by masking versions.
Added avx512_icmp_packed_rmb multiclass for embedded broadcast versions.
Added corresponding _vl multiclasses.
Added encoding tests for CPCMP{EQ|GT}* instructions.
Add more fields for X86VectorVTInfo.
Added AVX512VLVectorVTInfo that include X86VectorVTInfo for 512/256/128-bit versions

Differential Revision: http://reviews.llvm.org/D5024


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216383 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-25 14:49:34 +00:00