140241 Commits

Author SHA1 Message Date
Lang Hames
60699bf49a [Error] Unify +Asserts/-Asserts behavior for checked flags in Error/Expected<T>.
(1) Switches to raw pointer and bitmasking operations for Error payload.
(2) Always includes the 'unchecked' bitfield in Expected<T>, even in -Asserts.
(3) Always propagates checked bit status in move-ops for both classes, even in
    -Asserts.

This should allow debug programs to link against release libraries without
encountering spurious 'unchecked error' terminations.

Error checks still aren't verified in release mode so this doesn't introduce
any new control flow, but it does require new bit-masking ops in release mode
to preserve the flag values during move ops. I expect the overhead to be
minimal, but if we discover any corner cases where it matters we could fix
this by making flag propagation conditional on a new build option.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 18:24:15 +00:00
Adrian Prantl
f2e1fce7b1 Move the DWARF attribute constants into Dwarf.def and delete 300 lines of silly code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 18:21:39 +00:00
Matthias Braun
15cdf2c20b MachineRegisterInfo: Remove unused arg from isConstantPhysReg(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 18:05:09 +00:00
Matthias Braun
23ea6d343f TargetPassConfig: Move addPass of IPRA RegUsageInfoProp down.
TargetPassConfig::addMachinePasses() does some housekeeping first:
Handling the -print-machineinstrs flag and doing an initial printing
"After Instruction Selection". There is no reason for RegUsageInfoProp
to run before those two steps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 18:05:05 +00:00
Adrian Prantl
9fd3a76f78 Import/update constants from the DWARF 5 public review draft document.
https://reviews.llvm.org/D26051

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 17:59:50 +00:00
Arnold Schwaighofer
05af2b25b3 More swift calling convention tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 17:21:05 +00:00
Kostya Serebryany
a3dd1fe4c0 [libFuzzer] a bit more docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 16:55:29 +00:00
Sanjay Patel
db3dd81011 [InstCombine] move/add tests for smin/smax folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 16:54:03 +00:00
Lang Hames
95d4f2ce21 [lli] Pass command line arguments in to the orc-lazy JIT.
This brings the LLI orc-lazy JIT's behavior more closely in-line with LLI's
mcjit bahavior.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285413 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 16:52:34 +00:00
Krzysztof Parzyszek
fe1e3ecadd [Hexagon] Maintain kill flags through splitting in expand-condsets
Do not use LiveIntervals to recalculate kills, because that cannot be
done accurately without implicit uses on predicated instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 15:50:22 +00:00
Tom Stellard
d0b25b0041 [Loads] Fix crash in is isDereferenceableAndAlignedPointer()
Summary:
We were trying to add APInt values with different bit sizes after
visiting an addrspacecast instruction which changed the bit width
of the pointer.

Reviewers: majnemer, hfinkel

Subscribers: hfinkel, wdng, llvm-commits

Differential Revision: https://reviews.llvm.org/D24774

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 15:32:28 +00:00
Teresa Johnson
749a022c0b [cmake] Temporarily revert enforcement of minimum GCC version increase
Summary:
This is temporary, until bot that builds public facing LLVM
documentation is upgraded. It reverts only the cmake change in r284497,
but leaves the doc changes in place to preserve intent.

Reviewers: aaron.ballman

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D26078

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285406 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 15:30:27 +00:00
Matthew Simpson
889ff7ba68 [LV] Correct misleading comments in test (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 14:27:45 +00:00
Simon Pilgrim
734d68c70e [SelectionDAG] computeKnownBits - early-out if any BUILD_VECTOR element has no known bits
No need to check the remaining elements - no common known bits are available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 14:07:44 +00:00
Simon Pilgrim
7117050551 [SelectionDAG] Tidyup UDIV computeKnownBits implementation
No need to clear KnownOne2/KnownZero2 bits as the next call to computeKnownBits will overwrite them anyway

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 13:42:23 +00:00
Simon Pilgrim
f59b437f45 [SelectionDAG] Increment computeKnownBits recursion depth for SMIN/SMAX/UMIN/UMAX like all other ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 13:13:16 +00:00
Igor Laevsky
22eba5a2e2 [LCSSA] Perform LCSSA verification only for the current loop nest.
Now LPPassManager will run LCSSA verification only for the top-level loop
which was processed on the current iteration.

Differential Revision: https://reviews.llvm.org/D25873



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 12:57:20 +00:00
Juergen Ributzka
67d80b9ced Revert "[DAGCombiner] Add vector demanded elements support to computeKnownBits"
This seems to have increased LTO compile time bejond 2x of previous builds.
See http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto/10676/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 04:01:12 +00:00
Davide Italiano
5ecb91b321 [Reassociate] Removing instructions mutates the IR.
Fixes PR 30784. Discussed with Justin, who pointed out that
in the new PassManager infrastructure we can have more fine-grained
control on which analyses we want to preserve, but this is the
best we can do with the current infrastructure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 02:47:09 +00:00
Teresa Johnson
d39de45399 [ThinLTO] Create AliasSummary when building index
Summary:
Previously we were creating the alias summary on the fly while writing
the summary to bitcode. This moves the creation of these summaries to
the module summary index builder where we build the rest of the summary
index.

This is going to be necessary for setting the NoRename flag for values
possibly used in inline asm or module level asm.

Reviewers: mehdi_amini

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26049

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 02:39:38 +00:00
Teresa Johnson
89aab30a42 [ThinLTO] Rename HasSection to NoRename (NFC)
Summary:
This is in preparation for a change to utilize this flag for symbols
referenced/defined in either inline or module level assembly.

Reviewers: mehdi_amini

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26048

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 02:24:59 +00:00
Davide Italiano
bf13e73f9a [IR] Clang-format my previous commit. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285375 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 01:41:56 +00:00
Davide Italiano
e3433e6c11 [ConstantFold] Get the correct vector type when folding a getelementptr.
Differential Revision:  https://reviews.llvm.org/D26014

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 00:53:16 +00:00
Tom Stellard
a911f5ff01 AMDGPU/SI: Handle hazard with s_rfe_b64
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

Differential Revision: https://reviews.llvm.org/D25638

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:50:21 +00:00
Tom Stellard
8434132101 AMDGPU/SI: Handle hazard with sgpr lane selects for v_{read,write}lane
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D25637

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:42:29 +00:00
Davide Italiano
3058da2c45 Remove accidentally commited test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:40:19 +00:00
Davide Italiano
d637592982 [IR] Reintroduce getGEPReturnType(), it will be used in a later patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:38:51 +00:00
Tom Stellard
0b23373c51 AMDGPU/SI: Fix unused variable warning on non-debug builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285363 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:28:03 +00:00
Ekaterina Romanova
80b025217b Reverting back r285355: "Update .debug_line section version information to match DWARF version", while I'm investigating a test failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285362 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:20:19 +00:00
Vedant Kumar
d950fb2fa8 [Coverage] Darwin: Move __llvm_covmap from __DATA to __LLVM_COV
Programs with very large __llvm_covmap sections may fail to link on
Darwin because because of out-of-range 32-bit RIP relative references.
It isn't possible to work around this by using the large code model
because it isn't supported on Darwin. One solution is to move the
__llvm_covmap section past the end of the __DATA segment.

=== Testing ===

In addition to check-{llvm,clang,profile}, I performed a link test on a
simple object after injecting ~4GB of padding into __llvm_covmap:

  @__llvm_coverage_padding = internal constant [4000000000 x i8] zeroinitializer, section "__LLVM_COV,__llvm_covmap", align 8

(This test is too expensive to check-in.)

=== Backwards Compatibility ===

This patch should not pose any backwards-compatibility concerns. LLVM
is expected to scan all of the sections in a binary for __llvm_covmap,
so changing its segment shouldn't affect anything. I double-checked this
by loading coverage produced by an unpatched compiler with a patched
llvm-cov.

Suggested by Nick Kledzik.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:17:51 +00:00
Tom Stellard
5480a2423d AMDGPU/SI: Handle hazard with > 8 byte VMEM stores
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D25577

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285359 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 23:05:31 +00:00
Tim Shen
f95be0d257 Reapply r285351 "[APFloat] Add DoubleAPFloat mode to APFloat. NFC." with
a workaround for old clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 22:52:40 +00:00
Ekaterina Romanova
e2196c5336 Update .debug_line section version information to match DWARF version.
In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler. 

This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted. 

Differential Revision: https://reviews.llvm.org/D16697



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285355 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 22:37:25 +00:00
Tim Shen
441030d026 Revert "[APFloat] Add DoubleAPFloat mode to APFloat. NFC."
This reverts r285351, since it breaks the build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285354 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:54:29 +00:00
Kostya Serebryany
302a19a141 [libFuzzer] enable use_cmp by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:44:37 +00:00
Tim Shen
4cdbd20e4e [APFloat] Add DoubleAPFloat mode to APFloat. NFC.
Summary:
This patch adds DoubleAPFloat mode to APFloat.

Now, an APFloat with semantics PPCDoubleDouble will have DoubleAPFloat layout
(APFloat.U.Double), which contains two underlying APFloats as
PPCDoubleDoubleImpl and IEEEdouble semantics. Currently the IEEEdouble APFloat
is not used, and the first APFloat behaves exactly the same before this change.

This patch consists of three kinds of logics:
1) Construction and destruction of APFloat. Now the ctors, dtor, assign
   opertors and factory functions construct different underlying layout
   based on the semantics passed in.
2) s/IEEE/getIEEE()/ for normal, lifetime-unrelated computation functions.
   These functions only access Floats[0] in DoubleAPFloat, which is the
   same as today's semantic.
3) A "Double dispatch" function, APFloat::convert. Converting between two
   different layouts requires appropriate logic.

Neither of these change the external behavior.

Reviewers: hfinkel, kbarton, echristo, iteratee

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D25977

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:39:51 +00:00
Peter Collingbourne
0f84babf62 BitcodeReader: Require clients to read the block info block at most once.
This change makes it the client's responsibility to call ReadBlockInfoBlock()
at most once. This is in preparation for a future change that will allow
there to be multiple block info blocks.

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106512.html

Differential Revision: https://reviews.llvm.org/D26016

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:39:28 +00:00
Kyle Butt
bf977933f4 CodeGen: Handle missed case of block removal during BlockPlacement.
There is a use after free bug in the existing code. Loop layout selects
a preferred exit block, and then lays out the loop. If this block is
removed during layout, it needs to be invalidated to prevent a use after
free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:37:20 +00:00
Sanjay Patel
428b70f50e [InstCombine] fix foldSPFofSPF() to handle vector splats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:19:40 +00:00
Kostya Serebryany
cbc0087a47 [libFuzzer] docs: update the examples
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:03:48 +00:00
Kevin Enderby
60923f36b5 Another additional error check for invalid Mach-O files for the
obsolete load commands.

Again the philosophy of the error checking in libObject for
Mach-O files, the idea behind the checking is that we never
will return a Mach-O file out of libObject that contains unknown
things the library code can’t operate on.  So known obsolete
load commands will cause a hard error.

Also to make things clear I have added comments to the
values and structures in Support/Mach-O.h and
Support/MachO.def as to what is obsolete.

As noted in a TODO in the code, there may need to be a
non-default mode to allow some unknown values for well
structured Mach-O files with things like unknown load
load commands.  So things like using an old lldb on a newer
Mach-O file could still provide some limited functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 20:59:10 +00:00
Sanjay Patel
964532ccc5 [InstCombine] add vector tests for foldSPFofSPF to show missing folds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285340 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 20:51:03 +00:00
Kostya Serebryany
23d90fc543 [libFuzzer] docs: separate section for fuzz target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 20:45:35 +00:00
Tom Stellard
79758d450e AMDGPU/SI: Handle s_setreg hazard in GCNHazardRecognizer
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

Differential Revision: https://reviews.llvm.org/D25528

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285338 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 20:39:09 +00:00
Kostya Serebryany
f8e32dda35 [libFuzzer] remove large examples from the libFuzzer docs and link to the libFuzzer tutorial instead; also fix a build error in another file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 20:14:03 +00:00
Sanjay Patel
245c383b96 [InstCombine] auto-generate checks for min/max tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 19:54:15 +00:00
Ehsan Amiri
34a73b3124 [PPC] Adding the removed testcase again
This testcase was originally part of r284995, but I put it in a wrong directory.
So I removed it. Before adding it back I did some small enhancements. Also I
changed the assertions a little bit, to take into account the impact of some
changes performed since code review is done.

This is similar to changes done for another testcase in the original commit.
See: https://reviews.llvm.org/D23614#577749
Basically for instead of vxor we now generate xxlxor in some cases, which is
better.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 19:10:09 +00:00
Haicheng Wu
86f0394337 [LoopUnroll] Check partial unrolling is enabled before initialization. NFC.
Differential Revision: https://reviews.llvm.org/D23891

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 18:40:02 +00:00
Simon Pilgrim
6c0e6ef493 [X86][AVX512] Fix MUL v8i64 costs on non-AVX512DQ targets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 18:32:06 +00:00
Sanjay Patel
74906fa09e [InstCombine] handle simple vector integer constants in IsFreeToInvert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 17:30:50 +00:00