OSDN Git Service

android-x86/external-llvm.git
7 years ago[LLVM/Support] - Create no-arguments constructor for llvm::Regex
George Rimar [Thu, 1 Sep 2016 08:00:28 +0000 (08:00 +0000)]
[LLVM/Support] - Create no-arguments constructor for llvm::Regex

This is useful when need to defer the construction,
e.g. using Regex as a member of class.

Differential revision: https://reviews.llvm.org/D24101

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

7 years ago[SimplifyCFG] Improve FoldValueComparisonIntoPredecessors to handle more cases
James Molloy [Thu, 1 Sep 2016 07:45:25 +0000 (07:45 +0000)]
[SimplifyCFG] Improve FoldValueComparisonIntoPredecessors to handle more cases

A very important case is not handled here: multiple arcs to a single block with a PHI. Consider:

    a:
      %1 = icmp %b, 1
      br %1, label %c, label %e
    c:
      %2 = icmp %b, 2
      br %2, label %d, label %e
    d:
      br %e
    e:
      phi [0, %a], [1, %c], [2, %d]

FoldValueComparisonIntoPredecessors will refuse to fold this, as it doesn't know how to deal with two arcs to a common destination with different PHI values. The answer is obvious - just split all conflicting arcs.

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

7 years ago[NFC] Remove unnecessary comment
Dean Michael Berris [Thu, 1 Sep 2016 01:58:24 +0000 (01:58 +0000)]
[NFC] Remove unnecessary comment

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

7 years ago[XRay] Detect and emit sleds for sibling/tail calls
Dean Michael Berris [Thu, 1 Sep 2016 01:29:13 +0000 (01:29 +0000)]
[XRay] Detect and emit sleds for sibling/tail calls

Summary:
This change promotes the 'isTailCall(...)' member function to
TargetInstrInfo as a query interface for determining on a per-target
basis whether a given MachineInstr is a tail call instruction. We build
upon this in the XRay instrumentation pass to emit special sleds for
tail call optimisations, where we emit the correct kind of sled.

The tail call sleds look like a mix between the function entry and
function exit sleds. Form-wise, the sled comes before the "jmp"
instruction that implements the tail call similar to how we do it for
the function entry sled. Functionally, because we know this is a tail
call, it behaves much like an exit sled -- i.e. at runtime we may use
the exit trampolines instead of a different kind of trampoline.

A follow-up change to recognise these sleds will be done in compiler-rt,
so that we can start intercepting these initially as exits, but also
have the option to have different log entries to more accurately reflect
that this is actually a tail call.

Reviewers: echristo, rSerge, majnemer

Subscribers: mehdi_amini, dberris, llvm-commits

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

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

7 years ago[libFuzzer] add -minimize_crash flag (to minimize crashers). also add two tests that...
Kostya Serebryany [Thu, 1 Sep 2016 01:22:27 +0000 (01:22 +0000)]
[libFuzzer] add -minimize_crash flag (to minimize crashers). also add two tests that I failed to commit last time

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

7 years ago[XRay][NFC] Promote isTailCall() as virtual in TargetInstrInfo.
Dean Michael Berris [Thu, 1 Sep 2016 01:03:22 +0000 (01:03 +0000)]
[XRay][NFC] Promote isTailCall() as virtual in TargetInstrInfo.

This change is broken out from D23986, where XRay detects tail call
exits.

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

7 years agoRevert "Add asm.js-style setjmp/longjmp handling for wasm"
Heejin Ahn [Thu, 1 Sep 2016 00:44:37 +0000 (00:44 +0000)]
Revert "Add asm.js-style setjmp/longjmp handling for wasm"

This reverts commit r280302, it broke the integration tests.

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

7 years agoSupport: Avoid errors with LLVM_FALLTHROUGH in clang 3.6 and below in C mode
Justin Bogner [Wed, 31 Aug 2016 23:43:14 +0000 (23:43 +0000)]
Support: Avoid errors with LLVM_FALLTHROUGH in clang 3.6 and below in C mode

Older versions of clang defined __has_cpp_attribute in C mode, but
would choke on scoped attributes, as per llvm.org/PR23435. Since we
support building with clang all the way back to 3.1, we have to work
around this issue.

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

7 years agoAdd cast to appease windows builder. Fixes build break introduced in r280306.
Nick Lewycky [Wed, 31 Aug 2016 23:24:43 +0000 (23:24 +0000)]
Add cast to appease windows builder. Fixes build break introduced in r280306.

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

7 years ago[codeview] Have visitTypeBegin return the record type.
Zachary Turner [Wed, 31 Aug 2016 23:14:31 +0000 (23:14 +0000)]
[codeview] Have visitTypeBegin return the record type.

Previously we were assuming that any visitation of types would
necessarily be against a type we had binary data for.  Reasonable
assumption when were just reading PDBs and dumping them, but once
we start writing PDBs from Yaml this breaks down, because we have
no binary data yet, only Yaml, and from that we need to read the
record kind and perform the switch based on that.

So this patch does that.  Instead of having the visitor switch
on the kind that is already in the CVType record, we change the
visitTypeBegin() method to return the Kind, and switch on the
returned value.  This way, the default implementation can still
return the value from the CVType, but the implementation which
visits Yaml records and serializes binary PDB type records can
use the field in the Yaml as the source of the switch.

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

7 years agoAdd -fprofile-dir= to clang.
Nick Lewycky [Wed, 31 Aug 2016 23:04:32 +0000 (23:04 +0000)]
Add -fprofile-dir= to clang.

-fprofile-dir=path allows the user to specify where .gcda files should be
emitted when the program is run. In particular, this is the first flag that
causes the .gcno and .o files to have different paths, LLVM is extended to
support this. -fprofile-dir= does not change the file name in the .gcno (and
thus where lcov looks for the source) but it does change the name in the .gcda
(and thus where the runtime library writes the .gcda file). It's different from
a GCOV_PREFIX because a user can observe that the GCOV_PREFIX_STRIP will strip
paths off of -fprofile-dir= but not off of a supplied GCOV_PREFIX.

To implement this we split -coverage-file into -coverage-data-file and
-coverage-notes-file to specify the two different names. The !llvm.gcov
metadata node grows from a 2-element form {string coverage-file, node dbg.cu}
to 3-elements, {string coverage-notes-file, string coverage-data-file, node
dbg.cu}. In the 3-element form, the file name is already "mangled" with
.gcno/.gcda suffixes, while the 2-element form left that to the middle end
pass.

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

7 years agoFix the MSVC 2013 build by using Elf_Word instead of making a local typedef
Reid Kleckner [Wed, 31 Aug 2016 22:45:36 +0000 (22:45 +0000)]
Fix the MSVC 2013 build by using Elf_Word instead of making a local typedef

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

7 years ago[CMake] Increase stack size to 16MiB for all mingw executables.
NAKAMURA Takumi [Wed, 31 Aug 2016 22:43:23 +0000 (22:43 +0000)]
[CMake] Increase stack size to 16MiB for all mingw executables.

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

7 years agoAdd asm.js-style setjmp/longjmp handling for wasm
Heejin Ahn [Wed, 31 Aug 2016 22:40:34 +0000 (22:40 +0000)]
Add asm.js-style setjmp/longjmp handling for wasm

Summary: This patch adds asm.js-style setjmp/longjmp handling support for WebAssembly. It also uses JavaScript's try and catch mechanism.

Reviewers: jpp, dschuff

Subscribers: jfb, dschuff

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

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

7 years agoRevert "Add an optional parameter with a list of undefs to extendToIndices"
Reid Kleckner [Wed, 31 Aug 2016 22:36:02 +0000 (22:36 +0000)]
Revert "Add an optional parameter with a list of undefs to extendToIndices"

This reverts commit r280268, it causes all MSVC 2013 to ICE. This
appears to have been fixed in a later MSVC 2013 update, because I cannot
reproduce it locally. That said, all upstream LLVM bots are broken right
now, so I am reverting.

Also reverts dependent change r280275, "[Hexagon] Deal with undefs when
extending live intervals".

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

7 years ago[InstCombine] allow icmp (shr exact X, C2), C fold for splat constant vectors
Sanjay Patel [Wed, 31 Aug 2016 22:18:43 +0000 (22:18 +0000)]
[InstCombine] allow icmp (shr exact X, C2), C fold for splat constant vectors

The enhancement to foldICmpDivConstant ( http://llvm.org/viewvc/llvm-project?view=revision&revision=280299 )
allows us to remove the ConstantInt check; no other changes needed.

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

7 years ago[InstCombine] allow icmp (div X, Y), C folds for splat constant vectors
Sanjay Patel [Wed, 31 Aug 2016 21:57:21 +0000 (21:57 +0000)]
[InstCombine] allow icmp (div X, Y), C folds for splat constant vectors

Converting all of the overflow ops to APInt looked risky, so I've left that as a TODO.

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

7 years agoAMDGPU: Fix introducing stack access on unaligned v16i8
Matt Arsenault [Wed, 31 Aug 2016 21:52:27 +0000 (21:52 +0000)]
AMDGPU: Fix introducing stack access on unaligned v16i8

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

7 years agoAMDGPU: Use copy instead of mov during frame lowering
Matt Arsenault [Wed, 31 Aug 2016 21:52:25 +0000 (21:52 +0000)]
AMDGPU: Use copy instead of mov during frame lowering

This occurs before RA pseudos are expanded. It's less
code to emit the copy.

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

7 years agoAMDGPU: Refactor frame lowering
Matt Arsenault [Wed, 31 Aug 2016 21:52:21 +0000 (21:52 +0000)]
AMDGPU: Refactor frame lowering

This will make future changes easier.

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

7 years ago[codeview] Add TypeVisitorCallbackPipeline.
Zachary Turner [Wed, 31 Aug 2016 21:42:26 +0000 (21:42 +0000)]
[codeview] Add TypeVisitorCallbackPipeline.

We were kind of hacking this together before by embedding the
ability to forward requests into the TypeDeserializer.  When
we want to start adding more different kinds of visitor callback
interfaces though, this doesn't scale well and is very inflexible.

So introduce the notion of a pipeline, which itself implements
the TypeVisitorCallbacks interface, but which contains an internal
list of other callbacks to invoke in sequence.

Also update the existing uses of CVTypeVisitor to use this new
pipeline class for deserializing records before visiting them
with another visitor.

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

7 years agoGlobalISel: use G_TYPE to annotate physregs with a type.
Tim Northover [Wed, 31 Aug 2016 21:24:02 +0000 (21:24 +0000)]
GlobalISel: use G_TYPE to annotate physregs with a type.

More preparation for dropping source types from MachineInstrs: regsters coming
out of already-selected code (i.e. non-generic instructions) don't have a type,
but that information is needed so we must add it manually.

This is done via a new G_TYPE instruction.

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

7 years ago[WebAssembly] Disable folding of GA+reg into load/store constant offsets
Derek Schuff [Wed, 31 Aug 2016 20:27:20 +0000 (20:27 +0000)]
[WebAssembly] Disable folding of GA+reg into load/store constant offsets

Summary:
If the register has a negative value then unsigned overflow will occur;
this case is sometimes even created intentionally by LSR. For now
disable GA+reg folding. Fixes PR29127

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

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

7 years ago[InstCombine] change insertRangeTest() to use APInt instead of Constant; NFCI
Sanjay Patel [Wed, 31 Aug 2016 19:49:56 +0000 (19:49 +0000)]
[InstCombine] change insertRangeTest() to use APInt instead of Constant; NFCI

This is prep work before changing the callers to also use APInt which will
allow folds for splat vectors. Currently, the callers have ConstantInt
guards in place, so no functional change intended with this commit.

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

7 years ago[LoopInfo] Add verification by recomputation.
Michael Zolotukhin [Wed, 31 Aug 2016 19:26:19 +0000 (19:26 +0000)]
[LoopInfo] Add verification by recomputation.

Summary:
Current implementation of LI verifier isn't ideal and fails to detect
some cases when LI is incorrect. For instance, it checks that all
recorded loops are in a correct form, but it has no way to check if
there are no more other (unrecorded in LI) loops in the function. This
patch adds a way to detect such bugs.

Reviewers: chandlerc, sanjoy, hfinkel

Subscribers: llvm-commits, silvas, mzolotukhin

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

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

7 years ago[EarlyCSE] Optionally use MemorySSA. NFC.
Geoff Berry [Wed, 31 Aug 2016 19:24:10 +0000 (19:24 +0000)]
[EarlyCSE] Optionally use MemorySSA. NFC.

Summary:
Use MemorySSA, if requested, to do less conservative memory dependency
checking.

This change doesn't enable the MemorySSA enhanced EarlyCSE in the
default pipelines, so should be NFC.

Reviewers: dberlin, sanjoy, reames, majnemer

Subscribers: mcrosier, llvm-commits

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

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

7 years agoActually check for the diagnostic to be emitted!
Quentin Colombet [Wed, 31 Aug 2016 18:53:32 +0000 (18:53 +0000)]
Actually check for the diagnostic to be emitted!

This makes the test case in r280273 actually useful!

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

7 years ago[Hexagon] Deal with undefs when extending live intervals
Krzysztof Parzyszek [Wed, 31 Aug 2016 18:52:09 +0000 (18:52 +0000)]
[Hexagon] Deal with undefs when extending live intervals

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

7 years agoAMDGPU/SI: Make sure llvm.amdgcn.implicitarg.ptr() is at least 4-byte aligned
Tom Stellard [Wed, 31 Aug 2016 18:46:07 +0000 (18:46 +0000)]
AMDGPU/SI: Make sure llvm.amdgcn.implicitarg.ptr() is at least 4-byte aligned

Summary: This fixes some OpenCV tests that were broken by libclc commit r276443.

Reviewers: arsenm, jvesely

Subscribers: arsenm, wdng, llvm-commits

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

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

7 years ago[TargetPassConfig] Add a hook to tell whether GlobalISel should warm on fallback.
Quentin Colombet [Wed, 31 Aug 2016 18:43:04 +0000 (18:43 +0000)]
[TargetPassConfig] Add a hook to tell whether GlobalISel should warm on fallback.

Thanks to this patch, we know have a way to easly see if GlobalISel
failed.

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

7 years ago[ResetMachineFunction] Emit the diagnostic isel fallback when asked.
Quentin Colombet [Wed, 31 Aug 2016 18:43:01 +0000 (18:43 +0000)]
[ResetMachineFunction] Emit the diagnostic isel fallback when asked.

This pass is now able to report when the function is being reset.

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

7 years ago[DiagnosticInfo] Add a diagnostic class for the fallback of ISel.
Quentin Colombet [Wed, 31 Aug 2016 18:42:55 +0000 (18:42 +0000)]
[DiagnosticInfo] Add a diagnostic class for the fallback of ISel.

This will be used to warm when we fallback in GlobalISel.

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

7 years agoFix indent. NFC.
Chad Rosier [Wed, 31 Aug 2016 18:37:52 +0000 (18:37 +0000)]
Fix indent. NFC.

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

7 years agoAdd an optional parameter with a list of undefs to extendToIndices
Krzysztof Parzyszek [Wed, 31 Aug 2016 18:02:19 +0000 (18:02 +0000)]
Add an optional parameter with a list of undefs to extendToIndices

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

7 years agoNext set of additional error checks for invalid Mach-O files for bad load commands
Kevin Enderby [Wed, 31 Aug 2016 17:57:46 +0000 (17:57 +0000)]
Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::linkedit_data_command type for the load commands that are
currently used in the MachOObjectFile constructor.

This contains the missing checks for LC_DATA_IN_CODE and
LC_LINKER_OPTIMIZATION_HINT load commands and the fields for the
Mach::linkedit_data_command type.  Checking for other load commands that
use this type will be added later.

Also fixed a couple of places that was using sizeof(MachOObjectFile::LoadCommandInfo)
that should have been using sizeof(MachO::load_command).

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

7 years ago[EarlyCSE] Allow forwarding a non-invariant load into an invariant load.
Geoff Berry [Wed, 31 Aug 2016 17:45:31 +0000 (17:45 +0000)]
[EarlyCSE] Allow forwarding a non-invariant load into an invariant load.

Reviewers: sanjoy

Subscribers: mcrosier, llvm-commits

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

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

7 years ago[SLP] Update the debug based on Michael's suggestion.
Chad Rosier [Wed, 31 Aug 2016 17:41:12 +0000 (17:41 +0000)]
[SLP] Update the debug based on Michael's suggestion.

Passing the types/opcode check still doesn't guarantee we'll actually vectorize.
Therefore, just make it clear we're attempting to vectorize.

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

7 years ago[LangRef] Clarify !invariant.load semantics.
Geoff Berry [Wed, 31 Aug 2016 17:39:21 +0000 (17:39 +0000)]
[LangRef] Clarify !invariant.load semantics.

Based on discussion on llvm-dev.

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

7 years ago[SLP] Sink debug after checking for matching types/opcode.
Chad Rosier [Wed, 31 Aug 2016 17:31:09 +0000 (17:31 +0000)]
[SLP] Sink debug after checking for matching types/opcode.

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

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

7 years ago[lib/LTO] Factor out logic for running passes.
Davide Italiano [Wed, 31 Aug 2016 17:02:44 +0000 (17:02 +0000)]
[lib/LTO] Factor out logic for running passes.

This is in preparation for adding an option
to run a custom pipeline with the new PM. It's
currently used in lld.

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

7 years agos/static inline/static/ for headers I have changed in r279475. NFC.
Tim Shen [Wed, 31 Aug 2016 16:48:13 +0000 (16:48 +0000)]
s/static inline/static/ for headers I have changed in r279475. NFC.

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

7 years ago[LTO] Fix common test to reflect r279911 and move to X86 subdirectory
Teresa Johnson [Wed, 31 Aug 2016 16:15:39 +0000 (16:15 +0000)]
[LTO] Fix common test to reflect r279911 and move to X86 subdirectory

Adjust the test to reflect the changes to common handling in r279911.
This test wasn't running due to an incorrect REQUIRES and thus missed
being modified for r279911 before. It was changed to XFAIL when the
bad REQUIRES was discovered.

Remove the XFAIL and move to a new X86 subdirectory that will properly
disable on non-X86.

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

7 years ago[codeview] Emit vtable shape information
Reid Kleckner [Wed, 31 Aug 2016 15:59:30 +0000 (15:59 +0000)]
[codeview] Emit vtable shape information

The shape of the vtable is passed down as the size of the
__vtbl_ptr_type. This special pointer type appears both as the pointee
type of the vptr type, and by itself in every dynamic class. For classes
with multiple vtables, only the shape of the primary vftable is
included, as the shape of all secondary vftables will be the same as in
the base class.

Fixes PR28150

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

7 years ago[statepoints][experimental] Add support for live-in semantics of values in deopt...
Philip Reames [Wed, 31 Aug 2016 15:12:17 +0000 (15:12 +0000)]
[statepoints][experimental] Add support for live-in semantics of values in deopt bundles

This is a first step towards supporting deopt value lowering and reporting entirely with the register allocator. I hope to build on this in the near future to support live-on-return semantics, but I have a use case which allows me to test and investigate code quality with just the live-in semantics so I've chosen to start there. For those curious, my use cases is our implementation of the "__llvm_deoptimize" function we bind to @llvm.deoptimize. I'm choosing not to hard code that fact in the patch and instead make it configurable via function attributes.

The basic approach here is modelled on what is done for the "Live In" values on stackmaps and patchpoints. (A secondary goal here is to remove one of the last barriers to merging the pseudo instructions.) We start by adding the operands directly to the STATEPOINT SDNode. Once we've lowered to MI, we extend the remat logic used by the register allocator to fold virtual register uses into StackMap::Indirect entries as needed. This does rely on the fact that the register allocator rematerializes. If it didn't along some code path, we could end up with more vregs than physical registers and fail to allocate.

Today, we *only* fold in the register allocator. This can create some weird effects when combined with arguments passed on the stack because we don't fold them appropriately. I have an idea how to fix that, but it needs this patch in place to work on that effectively. (There's some weird interaction with the scheduler as well, more investigation needed.)

My near term plan is to land this patch off-by-default, experiment in my local tree to identify any correctness issues and then start fixing codegen problems one by one as I find them. Once I have the live-in lowering fully working (both correctness and code quality), I'm hoping to move on to the live-on-return semantics. Note: I don't have any *known* miscompiles with this patch enabled, but I'm pretty sure I'll find at least a couple. Thus, the "experimental" tag and the fact it's off by default.

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

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

7 years ago[X86][SSE] Improve awareness of (v)cvtpd2ps implicit zeroing of upper 64-bits of...
Simon Pilgrim [Wed, 31 Aug 2016 15:09:34 +0000 (15:09 +0000)]
[X86][SSE] Improve awareness of (v)cvtpd2ps implicit zeroing of upper 64-bits of xmm result

Associate x86_sse2_cvtpd2ps with X86ISD::VFPROUND to avoid inserting unnecessary zeroing shuffles.

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

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

7 years ago[SLP] Arguments should be camel case, and start with an upper case letter. NFC.
Chad Rosier [Wed, 31 Aug 2016 15:06:58 +0000 (15:06 +0000)]
[SLP] Arguments should be camel case, and start with an upper case letter. NFC.

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

7 years agoChanging a code block to text because Sphinx does not like it on the builder (http...
Aaron Ballman [Wed, 31 Aug 2016 14:37:20 +0000 (14:37 +0000)]
Changing a code block to text because Sphinx does not like it on the builder (lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/12517/steps/docs-llvm-html/logs/stdio)

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

7 years agoClang patch r280064 introduced ways to set the FP exceptions and denormal
Sjoerd Meijer [Wed, 31 Aug 2016 14:17:38 +0000 (14:17 +0000)]
Clang patch r280064 introduced ways to set the FP exceptions and denormal
types. This is the LLVM counterpart and it adds options that map onto FP
exceptions and denormal build attributes allowing better fp math library
selections.

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

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

7 years agoFixed spill stack objects are mutable
Krzysztof Parzyszek [Wed, 31 Aug 2016 13:52:17 +0000 (13:52 +0000)]
Fixed spill stack objects are mutable

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

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

7 years agoFix comments about IndirectBrInst in Instructions.h
Chad Rosier [Wed, 31 Aug 2016 13:39:34 +0000 (13:39 +0000)]
Fix comments about IndirectBrInst in Instructions.h

Patch by yo (Chiang, Yi-Yo) <yo@skymizer.com>.
Differential Revision: https://reviews.llvm.org/D23982

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

7 years agoRevert "[SimplifyCFG] Improve FoldValueComparisonIntoPredecessors to handle more...
James Molloy [Wed, 31 Aug 2016 13:32:28 +0000 (13:32 +0000)]
Revert "[SimplifyCFG] Improve FoldValueComparisonIntoPredecessors to handle more cases"

This reverts commit r280218. This *also* causes buildbot errors. Sigh. Not a successful day all around!

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

7 years agoChanging a code block to text because Sphinx does not like it on the builder (http...
Aaron Ballman [Wed, 31 Aug 2016 13:29:23 +0000 (13:29 +0000)]
Changing a code block to text because Sphinx does not like it on the builder (lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/12516/steps/docs-llvm-html/logs/stdio)

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

7 years agoRevert "[SimplifyCFG] Change the algorithm in SinkThenElseCodeToEnd"
James Molloy [Wed, 31 Aug 2016 13:16:52 +0000 (13:16 +0000)]
Revert "[SimplifyCFG] Change the algorithm in SinkThenElseCodeToEnd"

This reverts commit r280216 - it caused buildbot failures.

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

7 years agoRevert "[SimplifyCFG] Handle tail-sinking of more than 2 incoming branches"
James Molloy [Wed, 31 Aug 2016 13:16:45 +0000 (13:16 +0000)]
Revert "[SimplifyCFG] Handle tail-sinking of more than 2 incoming branches"

This reverts commit r280217. r280216 caused buildbot failures - backing out the entire chain.

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

7 years agoRevert "[SimplifyCFG] Add a workaround to fix PR30188"
James Molloy [Wed, 31 Aug 2016 13:16:36 +0000 (13:16 +0000)]
Revert "[SimplifyCFG] Add a workaround to fix PR30188"

This reverts commit r280219. r280216 caused buildbot failures - backing out the entire chain.

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

7 years agoRevert "[SimplifyCFG] Fix bootstrap failure after r280220"
James Molloy [Wed, 31 Aug 2016 13:16:30 +0000 (13:16 +0000)]
Revert "[SimplifyCFG] Fix bootstrap failure after r280220"

This reverts commit r280228. r280216 caused buildbot failures - backing out the entire sequence.

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

7 years agoUse abstraction in AArch64AsmPrinter::lowerSTACKMAP. NFCI
Diana Picus [Wed, 31 Aug 2016 12:43:49 +0000 (12:43 +0000)]
Use abstraction in AArch64AsmPrinter::lowerSTACKMAP. NFCI

Use functionality from StackMapOpers instead of hardcoding an operand access.

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

7 years agoTypo fixes. NFC
Diana Picus [Wed, 31 Aug 2016 12:43:44 +0000 (12:43 +0000)]
Typo fixes. NFC

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

7 years ago[SimplifyCFG] Fix bootstrap failure after r280220
James Molloy [Wed, 31 Aug 2016 12:33:48 +0000 (12:33 +0000)]
[SimplifyCFG] Fix bootstrap failure after r280220

We check that a sinking candidate is used by only one PHI node during our legality checks. However for instructions that are used by other sinking candidates our heuristic is less conservative. This can result in a candidate actually being illegal when we come to sink it because of how we sunk a predecessor. Do the used-by-only-one-PHI checks again during sinking to ensure we don't crash.

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

7 years agoAMDGPU/SI: Handle aliases in AMDGPUAlwaysInlinePass
Nikolay Haustov [Wed, 31 Aug 2016 11:18:33 +0000 (11:18 +0000)]
AMDGPU/SI: Handle aliases in AMDGPUAlwaysInlinePass

Summary:
Simply replace usage of aliases to functions with aliasee.
This came up when bitcode linking to builtin library and
calls to aliases not being resolved.

Also made minor improvements to existing test.

Reviewers: tstellarAMD, alex-t, vpykhtin

Subscribers: arsenm, wdng, rampitec

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

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

7 years ago[SimplifyCFG] Add a workaround to fix PR30188
James Molloy [Wed, 31 Aug 2016 10:46:45 +0000 (10:46 +0000)]
[SimplifyCFG] Add a workaround to fix PR30188

We're sinking stores, which is a good thing, but in the process creating selects for the store address operand, which SROA/Mem2Reg can't look through, which caused serious regressions.

The real fix is in SROA, which I'll be looking into.

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

7 years ago[SimplifyCFG] Improve FoldValueComparisonIntoPredecessors to handle more cases
James Molloy [Wed, 31 Aug 2016 10:46:39 +0000 (10:46 +0000)]
[SimplifyCFG] Improve FoldValueComparisonIntoPredecessors to handle more cases

A very important case is not handled here: multiple arcs to a single block with a PHI. Consider:

    a:
      %1 = icmp %b, 1
      br %1, label %c, label %e
    c:
      %2 = icmp %b, 2
      br %2, label %d, label %e
    d:
      br %e
    e:
      phi [0, %a], [1, %c], [2, %d]

FoldValueComparisonIntoPredecessors will refuse to fold this, as it doesn't know how to deal with two arcs to a common destination with different PHI values. The answer is obvious - just split all conflicting arcs.

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

7 years ago[SimplifyCFG] Handle tail-sinking of more than 2 incoming branches
James Molloy [Wed, 31 Aug 2016 10:46:33 +0000 (10:46 +0000)]
[SimplifyCFG] Handle tail-sinking of more than 2 incoming branches

This was a real restriction in the original version of SinkIfThenCodeToEnd. Now it's been rewritten, the restriction can be lifted.

As part of this, we handle a very common and useful case where one of the incoming branches is actually conditional. Consider:

   if (a)
     x(1);
   else if (b)
     x(2);

This produces the following CFG:

         [if]
        /    \
      [x(1)] [if]
        |     | \
        |     |  \
        |  [x(2)] |
         \    |  /
          [ end ]

[end] has two unconditional predecessor arcs and one conditional. The conditional refers to the implicit empty 'else' arc. This same pattern can also be caused by an empty default block in a switch.

We can't sink the call to x() down to end because no call to x() happens on the third incoming arc (assume that x() has sideeffects for the sake of argument; if something is safe to speculate we could indeed sink nevertheless but this cannot happen in the general case and causes many extra selects).

We are now able to detect this case and split off the unconditional arcs to a common successor:

         [if]
        /    \
      [x(1)] [if]
        |     | \
        |     |  \
        |  [x(2)] |
         \   /    |
     [sink.split] |
           \     /
           [ end ]

Now we can sink the call to x() into %sink.split. This can cause significant code simplification in many testcases.

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

7 years ago[SimplifyCFG] Change the algorithm in SinkThenElseCodeToEnd
James Molloy [Wed, 31 Aug 2016 10:46:23 +0000 (10:46 +0000)]
[SimplifyCFG] Change the algorithm in SinkThenElseCodeToEnd

r279460 rewrote this function to be able to handle more than two incoming edges and took pains to ensure this didn't regress anything.

This time we change the logic for determining if an instruction should be sunk. Previously we used a single pass greedy algorithm - sink instructions until one requires more than one PHI node or we run out of instructions to sink.

This had the problem that sinking instructions that had non-identical but trivially the same operands needed extra logic so we sunk them aggressively. For example:

    %a = load i32* %b          %d = load i32* %b
    %c = gep i32* %a, i32 0    %e = gep i32* %d, i32 1

Sinking %c and %e would naively require two PHI merges as %a != %d. But the loads are obviously equivalent (and maybe can't be hoisted because there is no common predecessor).

This is why we implemented the fairly complex function areValuesTriviallySame(), to look through trivial differences like this. However it's just not clever enough.

Instead, throw areValuesTriviallySame away, use pointer equality to check equivalence of operands and switch to a two-stage algorithm.

In the "scan" stage, we look at every sinkable instruction in isolation from end of block to front. If it's sinkable, we keep track of all operands that required PHI merging.

In the "sink" stage, we iteratively sink the last non-terminator in the source blocks. But when calculating how many PHIs are actually required to be inserted (to work out if we should stop or not) we remove any values that have already been sunk from the set of PHI-merges required, which allows us to be more aggressive.

This turns an algorithm with potentially recursive lookahead (looking through GEPs, casts, loads and any other instruction potentially not CSE'd) to two linear scans.

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

7 years ago[SimplifyCFG] Tail-merge calls with sideeffects
James Molloy [Wed, 31 Aug 2016 10:46:16 +0000 (10:46 +0000)]
[SimplifyCFG] Tail-merge calls with sideeffects

This was deliberately disabled during my rewrite of SinkIfThenToEnd to keep behaviour
at least vaguely consistent with the previous version and keep it as close to NFC as
I could.

There's no real reason not to merge sideeffect calls though, so let's do it! Small fixup
along the way to ensure we don't create indirect calls.

Should fix PR28964.

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

7 years ago[X86][SSE] Improve awareness of fptrunc implicit zeroing of upper 64-bits of xmm...
Simon Pilgrim [Wed, 31 Aug 2016 10:35:13 +0000 (10:35 +0000)]
[X86][SSE] Improve awareness of fptrunc implicit zeroing of upper 64-bits of xmm result

Add patterns to avoid inserting unnecessary zeroing shuffles when lowering fptrunc to (v)cvtpd2ps

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

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

7 years ago[Coverage] Make sorting criteria for CounterMappingRegions local.
Igor Kudrin [Wed, 31 Aug 2016 07:01:17 +0000 (07:01 +0000)]
[Coverage] Make sorting criteria for CounterMappingRegions local.

Move the comparison function into the only place there it is used,
i.e. the call to std::stable_sort in CoverageMappingWriter::write().

Add sorting by region kinds as it is required to ensure stable order
in our tests and to simplify D23987.

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

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

7 years ago[AVX-512] Add patterns to select masked logical operations if the select has a floati...
Craig Topper [Wed, 31 Aug 2016 05:37:52 +0000 (05:37 +0000)]
[AVX-512] Add patterns to select masked logical operations if the select has a floating point type.

This is needed in order to replace the masked floating point logical op intrinsics with native IR.

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

7 years ago[AVX-512] Add test cases for masked floating point logic operations with bitcasts...
Craig Topper [Wed, 31 Aug 2016 05:37:50 +0000 (05:37 +0000)]
[AVX-512] Add test cases for masked floating point logic operations with bitcasts between the logic ops and the select. We don't currently select masked operations for these cases.

Test cases taken from optimized clang output after trying to convert the masked floating point logical op intrinsics to native IR.

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

7 years ago[X86] Regenerate a test using update_llc_test_checks.py.
Craig Topper [Wed, 31 Aug 2016 05:37:47 +0000 (05:37 +0000)]
[X86] Regenerate a test using update_llc_test_checks.py.

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

7 years ago[XRay] Support multiple return instructions in a single basic block
Dean Michael Berris [Wed, 31 Aug 2016 05:20:08 +0000 (05:20 +0000)]
[XRay] Support multiple return instructions in a single basic block

Add a .mir test to catch this case, and fix the xray-instrumentation
pass to handle it appropriately.

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

7 years ago[Loads] Properly populate the visited set in isDereferenceableAndAlignedPointer
David Majnemer [Wed, 31 Aug 2016 03:22:32 +0000 (03:22 +0000)]
[Loads] Properly populate the visited set in isDereferenceableAndAlignedPointer

There were paths where we wouldn't populate the visited set, causing us
to recurse forever if an SSA variable was defined in terms of itself.

This fixes PR30210.

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

7 years ago[PowerPC] Don't spill the frame pointer twice
Hal Finkel [Wed, 31 Aug 2016 00:52:03 +0000 (00:52 +0000)]
[PowerPC] Don't spill the frame pointer twice

When a function contains something, such as inline asm, which explicitly
clobbers the register used as the frame pointer, don't spill it twice. If we
need a frame pointer, it will be saved/restored in the prologue/epilogue code.
Explicitly spilling it again will reuse the same spill slot used by the
prologue/epilogue code, thus clobbering the saved value. The same applies
to the base-pointer or PIC-base register.

Partially fixes PR26856. Thanks to Ulrich for his analysis and the small
inline-asm reproducer.

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

7 years ago[Coroutines] Part 10: Add coroutine promise support.
Gor Nishanov [Wed, 31 Aug 2016 00:35:41 +0000 (00:35 +0000)]
[Coroutines] Part 10: Add coroutine promise support.

Summary:
1) CoroEarly now lowers llvm.coro.promise intrinsic that allows to obtain
a coroutine promise pointer from a coroutine frame and vice versa.

2) CoroFrame now interprets Promise argument of llvm.coro.begin to
place CoroutinPromise alloca at a deterministic offset from the coroutine frame.

Now, the coroutine promise example from docs\Coroutines.rst compiles and produces expected result (see test/Transform/Coroutines/ex4.ll).

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

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

7 years ago[InstCombine] clean up InsertRangeTest; NFCI
Sanjay Patel [Wed, 31 Aug 2016 00:19:35 +0000 (00:19 +0000)]
[InstCombine] clean up InsertRangeTest; NFCI

It's much less code and easier to read if we don't duplicate
everything between the 'Inside' and not 'Inside' cases.

As noted with the FIXME, the goal is to make this vector-friendly
in a follow-up patch.

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

7 years ago[llvm-cov] Drop redundant "No." suffix in a column title
Vedant Kumar [Wed, 31 Aug 2016 00:09:44 +0000 (00:09 +0000)]
[llvm-cov] Drop redundant "No." suffix in a column title

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

7 years ago[LoadStoreVectorizer] Change VectorSet to Vector to match head and tail positions...
Alina Sbirlea [Tue, 30 Aug 2016 23:53:59 +0000 (23:53 +0000)]
[LoadStoreVectorizer] Change VectorSet to Vector to match head and tail positions. Resolves PR29148.

Summary:
LSV was using two vector sets (heads and tails) to track pairs of adjiacent position to vectorize.
A recent optimization is trying to obtain the longest chain to vectorize and assumes the positions
in heads(H) and tails(T) match, which is not the case is there are multiple tails for the same head.

e.g.:
i1: store a[0]
i2: store a[1]
i3: store a[1]
Leads to:
H: i1
T: i2 i3
Instead of:
H: i1 i1
T: i2 i3
So the positions for instructions that follow i3 will have different indexes in H/T.
This patch resolves PR29148.

This issue also surfaced the fact that if the chain is too long, and TLI
returns a "not-fast" answer, the whole chain will be abandoned for
vectorization, even though a smaller one would be beneficial.
Added a testcase and FIXME for this.

Reviewers: tstellarAMD, arsenm, jlebar

Subscribers: mzolotukhin, wdng, llvm-commits

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

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

7 years ago[InstCombine] add tests to show type limitations of InsertRangeTest and callers
Sanjay Patel [Tue, 30 Aug 2016 23:16:59 +0000 (23:16 +0000)]
[InstCombine] add tests to show type limitations of InsertRangeTest and callers

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

7 years ago[codeview] Remove redundant TypeTable lookup
Reid Kleckner [Tue, 30 Aug 2016 21:48:14 +0000 (21:48 +0000)]
[codeview] Remove redundant TypeTable lookup

As written, the code should assert if this lookup would have ever
succeeded.  Without looking through composite types, the type graph
should be acyclic.

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

7 years agoAdd a test file, macho-invalid-dysymtab-extreloff-nextrel,
Kevin Enderby [Tue, 30 Aug 2016 21:48:06 +0000 (21:48 +0000)]
Add a test file, macho-invalid-dysymtab-extreloff-nextrel,
I forgot to do an svn add on.

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

7 years ago[ORC][RPC] Fix some bugs in the callB primitive.
Lang Hames [Tue, 30 Aug 2016 21:29:48 +0000 (21:29 +0000)]
[ORC][RPC] Fix some bugs in the callB primitive.

Still no unit test due to synchronization bugs on s390. These issues were
discovered in an out-of-tree utility.

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

7 years ago[CMake] Ensure that compiler-rt is added first
Chris Bieneman [Tue, 30 Aug 2016 21:29:21 +0000 (21:29 +0000)]
[CMake] Ensure that compiler-rt is added first

This will enable other runtime projects to detect the presence of sanitizer runtimes by referring to the sanitizer targets directly.

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

7 years agoNext set of additional error checks for invalid Mach-O files for bad LC_DYSYMTAB’s.
Kevin Enderby [Tue, 30 Aug 2016 21:28:30 +0000 (21:28 +0000)]
Next set of additional error checks for invalid Mach-O files for bad LC_DYSYMTAB’s.

This contains the missing checks for LC_DYSYMTAB load command fields.

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

7 years agollvm-readobj: speculative fix for MSVC
Saleem Abdulrasool [Tue, 30 Aug 2016 21:21:07 +0000 (21:21 +0000)]
llvm-readobj: speculative fix for MSVC

Use the typedef rather than using to type alias the typename.

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

7 years agoGlobalISel: combine extracts & sequences created for legalization
Tim Northover [Tue, 30 Aug 2016 20:51:25 +0000 (20:51 +0000)]
GlobalISel: combine extracts & sequences created for legalization

Legalization ends up creating many G_SEQUENCE/G_EXTRACT pairs which leads to
inefficient codegen (even for -O0), so add a quick pass over the function to
remove them again.

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

7 years agoAMDGPU: Relax SGPR asm constraint register class
Matt Arsenault [Tue, 30 Aug 2016 20:50:08 +0000 (20:50 +0000)]
AMDGPU: Relax SGPR asm constraint register class

s should be SReg_32 to be as general as possible. This can avoid a copy
from m0.

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

7 years ago[libfuzzer] simplified unit truncation; do not write trunc items to disc
Mike Aizatsky [Tue, 30 Aug 2016 20:49:07 +0000 (20:49 +0000)]
[libfuzzer] simplified unit truncation; do not write trunc items to disc

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

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

7 years agoRevert "ELFDumper: Unversioned symbols must not have trailing @"
Hemant Kulkarni [Tue, 30 Aug 2016 20:42:46 +0000 (20:42 +0000)]
Revert "ELFDumper: Unversioned symbols must not have trailing @"

This reverts commit 8df7a877949e8782a3a28e3ecdb0770c1e444056.

Fixing other repositories and adding changes together.

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

7 years ago[LoopVectorizer] Predicate instructions in blocks with several incoming edges
Michael Kuperstein [Tue, 30 Aug 2016 20:22:21 +0000 (20:22 +0000)]
[LoopVectorizer] Predicate instructions in blocks with several incoming edges

We don't need to limit predication to blocks that have a single incoming
edge, we just need to use the right mask.
This fixes PR30172.

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

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

7 years ago[COFFObjectFile] Ignore broken symbol table
David Majnemer [Tue, 30 Aug 2016 20:20:24 +0000 (20:20 +0000)]
[COFFObjectFile] Ignore broken symbol table

When binaries are compressed by UPX, information about symbol table
offset and symbol count remain unchanged (but became invalid due to
compression).
This causes failure in the constructor and the rest of the binary cannot
be processed.

Instead, reset symbol related information (symbol/string table pointers,
sizes) - this should disable the related iterators and functions while
the rest of the binary can still be processed.

Patch by Bandzi Michal!

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

7 years agoIntrArgMemOnly is only defined (and current AA machinery only sanely supports) pointe...
Daniel Berlin [Tue, 30 Aug 2016 19:58:48 +0000 (19:58 +0000)]
IntrArgMemOnly is only defined (and current AA machinery only sanely supports) pointer arguments, and these intrinsics have vector of pointer arguments.  Remove ArgMemOnly until we either have the machinery, define a new attribute, or something similar

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

7 years agoRe-instate recent RPC updates (r280016, r280017, r280027, r280051) with a
Lang Hames [Tue, 30 Aug 2016 19:56:15 +0000 (19:56 +0000)]
Re-instate recent RPC updates (r280016, r280017, r280027, r280051) with a
workaround for the limitations of MSVC 2013's std::future class.

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

7 years agoELFDumper: Unversioned symbols must not have trailing @
Hemant Kulkarni [Tue, 30 Aug 2016 19:50:02 +0000 (19:50 +0000)]
ELFDumper: Unversioned symbols must not have trailing @

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

7 years agoCodeGen: Fixup for r280128, since GCC isn't as permissive as Clang
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 19:11:11 +0000 (19:11 +0000)]
CodeGen: Fixup for r280128, since GCC isn't as permissive as Clang

Fixes the bots, e.g.:
http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/10055

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

7 years agoGlobalISel: forbid physical registers on generic MIs.
Tim Northover [Tue, 30 Aug 2016 18:52:46 +0000 (18:52 +0000)]
GlobalISel: forbid physical registers on generic MIs.

We're intending to move to a world where the type of a register is determined
by its (unique) def. This is incompatible with physregs, which are untyped.

It also means the other passes don't have to worry quite so much about
register-class compatibility and inserting COPYs appropriately.

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

7 years agollvm-readobj: add support for printing GNU Notes
Saleem Abdulrasool [Tue, 30 Aug 2016 18:52:02 +0000 (18:52 +0000)]
llvm-readobj: add support for printing GNU Notes

Add support for printing the GNU Notes.  This allows an easy way to view the
build id for a binary built with the build id.  Currently, this only handles the
GNU notes, though it would be easy to extend for other note types (default,
FreeBSD, NetBSD, etc).  Only the GNU style is supported currently.

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

7 years agoSupport: add some more ELF constants
Saleem Abdulrasool [Tue, 30 Aug 2016 18:51:59 +0000 (18:51 +0000)]
Support: add some more ELF constants

Add constants for additional GNU note types and the GNU Notes OS type id.  This
is needed to support printing the notes in ELF binaries.

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

7 years agoFix unit test after function name change.
Zachary Turner [Tue, 30 Aug 2016 18:45:32 +0000 (18:45 +0000)]
Fix unit test after function name change.

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

7 years agoADT: Split ilist_node_traits into alloc and callback, NFC
Duncan P. N. Exon Smith [Tue, 30 Aug 2016 18:40:47 +0000 (18:40 +0000)]
ADT: Split ilist_node_traits into alloc and callback, NFC

Many lists want to override only allocation semantics, or callbacks for
iplist.  Split these up to prevent code duplication.
- Specialize ilist_alloc_traits to change the implementations of
  deleteNode() and createNode().
- One common desire is to do nothing deleteNode() and disable
  createNode().  Specialize ilist_alloc_traits to inherit from
  ilist_noalloc_traits for that behaviour.
- Specialize ilist_callback_traits to use the addNodeToList(),
  removeNodeFromList(), and transferNodesFromList() callbacks.

As a drive-by, add some coverage to the callback-related unit tests.

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

7 years agoRename ArrayRef::keep_front / keep_back to take_front / take_back.
Zachary Turner [Tue, 30 Aug 2016 18:19:18 +0000 (18:19 +0000)]
Rename ArrayRef::keep_front / keep_back to take_front / take_back.

The name decided on was take_, but I only updated it for StringRef
and forgot to do it for ArrayRef.

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