5 years agoCreate a git ignore file for openmp runtime.
Andrey Churbanov [Sat, 11 Mar 2017 13:05:08 +0000 (13:05 +0000)]
Create a git ignore file for openmp runtime.

Patch by Guansong Zhang.

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

llvm-svn: 297562

5 years agoFix signed/unsigned comparison warnings
Simon Pilgrim [Sat, 11 Mar 2017 13:02:31 +0000 (13:02 +0000)]
Fix signed/unsigned comparison warnings

llvm-svn: 297561

5 years agoFix -Wsentinel warning
Simon Pilgrim [Sat, 11 Mar 2017 12:56:02 +0000 (12:56 +0000)]
Fix -Wsentinel warning

llvm-svn: 297560

5 years agoUse setBits in SelectionDAG
Amaury Sechet [Sat, 11 Mar 2017 11:24:03 +0000 (11:24 +0000)]
Use setBits in SelectionDAG

Summary: As per title.

Reviewers: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 297559

5 years ago[isl++] Add last set of missing isl:: prefixes to increase consistency [NFC]
Tobias Grosser [Sat, 11 Mar 2017 07:58:12 +0000 (07:58 +0000)]
[isl++] Add last set of missing isl:: prefixes to increase consistency [NFC]

llvm-svn: 297558

5 years agoAMDGPU: Remove packf16 intrinsic
Matt Arsenault [Sat, 11 Mar 2017 05:51:16 +0000 (05:51 +0000)]
AMDGPU: Remove packf16 intrinsic

llvm-svn: 297557

5 years agoAMDGPU: Keep track of modifiers when converting v_mac to v_mad
Matt Arsenault [Sat, 11 Mar 2017 05:40:40 +0000 (05:40 +0000)]
AMDGPU: Keep track of modifiers when converting v_mac to v_mad

Since v_max_f32_e64/v_max_f16_e64 can be folded if the target
instruction supports the clamp bit, we also need to maintain
modifiers when converting v_mac to v_mad.

This fixes a rendering issue with Dirt Rally because a v_mac
instruction with the clamp bit set was converted to a v_mad
but that bit was lost during the conversion.

Fixes: e184e01dd79 ("AMDGPU: Fold FP clamp as modifier bit")

Patch by Samuel Pitoiset <samuel.pitoiset@gmail.com>

llvm-svn: 297556

5 years agofix test coverage capture dirs
Eric Fiselier [Sat, 11 Mar 2017 05:28:09 +0000 (05:28 +0000)]
fix test coverage capture dirs

llvm-svn: 297555

5 years ago[libFuzzer] add more iterations to LLVMFuzzer-Memcmp64BytesTest
Kostya Serebryany [Sat, 11 Mar 2017 05:14:49 +0000 (05:14 +0000)]
[libFuzzer] add more iterations to LLVMFuzzer-Memcmp64BytesTest

llvm-svn: 297554

5 years agoChange test coverage generation to use llvm-cov instead of gcov.
Eric Fiselier [Sat, 11 Mar 2017 03:24:18 +0000 (03:24 +0000)]
Change test coverage generation to use llvm-cov instead of gcov.

Clang doesn't produce gcov compatible coverage files. This
causes lcov to break because it uses gcov by default. This
patch switches lcov to use llvm-cov as the gcov-tool.

Unfortunatly llvm-cov doesn't provide a gcov like interface by
default so it won't work with lcov. However `llvm-cov gcov` does.
For this reason we generate 'llvm-cov-wrapper' script that always
passes the gcov flag.

llvm-svn: 297553

5 years ago[ADT] Add a DenseMapInfo<T> for shorts.
Zachary Turner [Sat, 11 Mar 2017 02:52:48 +0000 (02:52 +0000)]
[ADT] Add a DenseMapInfo<T> for shorts.

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

llvm-svn: 297552

5 years ago[libFuzzer] reduce the number of vector resizes during merge (https://github.com...
Kostya Serebryany [Sat, 11 Mar 2017 02:50:47 +0000 (02:50 +0000)]
[libFuzzer] reduce the number of vector resizes during merge (https://github.com/google/oss-fuzz/issues/445)

llvm-svn: 297551

5 years agoFix line endings of DenseMapInfo.h
Zachary Turner [Sat, 11 Mar 2017 02:50:18 +0000 (02:50 +0000)]
Fix line endings of DenseMapInfo.h

llvm-svn: 297550

5 years agoRemove eol-style:native from DenseMapInfo.h
Zachary Turner [Sat, 11 Mar 2017 02:47:59 +0000 (02:47 +0000)]
Remove eol-style:native from DenseMapInfo.h

llvm-svn: 297549

5 years ago[Support] Add a formatv provider for Twine.
Zachary Turner [Sat, 11 Mar 2017 02:45:50 +0000 (02:45 +0000)]
[Support] Add a formatv provider for Twine.

llvm-svn: 297548

5 years ago[coroutines] Fix diagnostics depending on the first coroutine statement.
Eric Fiselier [Sat, 11 Mar 2017 02:35:37 +0000 (02:35 +0000)]
[coroutines] Fix diagnostics depending on the first coroutine statement.

Some coroutine diagnostics need to point to the location of the first coroutine keyword in the function, like when diagnosing a `return` inside a coroutine. Previously we did this by storing each *valid* coroutine statement in a list and select the first one to use in diagnostics. However if every coroutine statement is invalid we would have no location to point to.

This patch fixes the storage of the first coroutine statement location, ensuring that it gets stored even when the resulting AST node would be invalid.
This patch also removes the `CoroutineStmts` list in `FunctionScopeInfo` because it was unused.

Reviewers: rsmith, GorNishanov, aaron.ballman

Reviewed By: GorNishanov

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 297547

5 years ago[libFuzzer] print how much memory is consumed by the outer merge process (https:...
Kostya Serebryany [Sat, 11 Mar 2017 02:26:20 +0000 (02:26 +0000)]
[libFuzzer] print how much memory is consumed by the outer merge process (https://github.com/google/oss-fuzz/issues/445)

llvm-svn: 297546

5 years agoRevert r297516 - Respect CMAKE_INSTALL_MANDIR for sphinx generated manpages
Eric Fiselier [Sat, 11 Mar 2017 02:24:13 +0000 (02:24 +0000)]
Revert r297516 - Respect CMAKE_INSTALL_MANDIR for sphinx generated manpages

When CMAKE_INSTALL_MANDIR isn't defined it ends up attempting to install
the man pages under "/man1" and we really don't want to accidentally install
stuff at the filesystem root.

llvm-svn: 297545

5 years ago[libFuzzer] add test/LargeTest.cpp, mostly for manual experiments with large number...
Kostya Serebryany [Sat, 11 Mar 2017 01:54:06 +0000 (01:54 +0000)]
[libFuzzer] add test/LargeTest.cpp, mostly for manual experiments with large number of edges, not yet suitable for unit testing

llvm-svn: 297544

5 years ago[libFuzzer] remove fuzzer-jobs.test which is flaky and not very useful
Kostya Serebryany [Sat, 11 Mar 2017 01:48:54 +0000 (01:48 +0000)]
[libFuzzer] remove fuzzer-jobs.test which is flaky and not very useful

llvm-svn: 297543

5 years agoRemove opt-bisect support for "cases" in favor of debug counters
Daniel Berlin [Sat, 11 Mar 2017 01:41:03 +0000 (01:41 +0000)]
Remove opt-bisect support for "cases" in favor of debug counters

Ths "cases" support was not quite finished, is unused, and is really just debug counters.
(well, almost, debug counters are slightly more powerful, in that they can skip things at the start, too).
Note, opt-bisect itself could also be implemented as a wrapper around
debug counters, but not sure it's worth it ATM.

I'll shove it on a todo list if we think it is.

Reviewers: MatzeB, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 297542

5 years ago[coroutines] Refactor SuspendExpr to create just one OpaqueValue (almost NFC)
Gor Nishanov [Sat, 11 Mar 2017 01:30:17 +0000 (01:30 +0000)]
[coroutines] Refactor SuspendExpr to create just one OpaqueValue (almost NFC)

Create only one OpaqueValue for await_ready/await_suspend/await_resume.
Store OpaqueValue used in the CoroutineSuspendExpr node, so that CodeGen does not have to hunt looking for it.

Reviewers: rsmith, EricWF, aaron.ballman

Reviewed By: EricWF

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 297541

5 years ago[unittest] Explicitly specify alignment when using BumpPtrAllocator.
Jordan Rose [Sat, 11 Mar 2017 01:24:56 +0000 (01:24 +0000)]
[unittest] Explicitly specify alignment when using BumpPtrAllocator.

r297310 began inserting red zones around allocations under ASan, which
perturbs the alignment of subsequent allocations. Deliberately specify
this in two places where it matters.

Fixes failures when these tests are run under ASan and UBSan together.
Reviewed by Duncan Exon Smith.


llvm-svn: 297540

5 years agoUse a WeakVH for UnknownInstructions in AliasSetTracker
Sanjoy Das [Sat, 11 Mar 2017 01:15:48 +0000 (01:15 +0000)]
Use a WeakVH for UnknownInstructions in AliasSetTracker

This change solves the same problem as D30726, except that this only
throws out the bathwater.

AST was not correctly tracking and deleting UnknownInstructions via
handles.  The existing code only tracks "pointers" in its
`ASTCallbackVH`, so an UnknownInstruction (that isn't also def'ing a
pointer used by another memory instruction) never gets a

There are two other ways to solve this problem:

 - Use the `PointerRec` scheme for both known and unknown instructions.
 - Use a `CallbackVH` that erases the offending Instruction from the
   UnknownInstruction list.

Both of the above changes seemed to be significantly (and unnecessarily
IMO) more complex than this.

Reviewers: chandlerc, dberlin, hfinkel, reames

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 297539

5 years agofix xunit attribute parsing
Tim Hammerquist [Sat, 11 Mar 2017 00:58:41 +0000 (00:58 +0000)]
fix xunit attribute parsing

llvm-svn: 297538

5 years agoVNCoercion: Make the function signatures all consistent
Daniel Berlin [Sat, 11 Mar 2017 00:51:01 +0000 (00:51 +0000)]
VNCoercion: Make the function signatures all consistent

llvm-svn: 297537

5 years ago[AMDGPU] Remove getBidirectionalReasonRank
Stanislav Mekhanoshin [Sat, 11 Mar 2017 00:29:27 +0000 (00:29 +0000)]
[AMDGPU] Remove getBidirectionalReasonRank

This method inverts the Reason field of a scheduling candidate.
It does right comparison between RegCritical and RegExcess, but
everything else is broken. In fact it can prefer less strong reason
such as Weak over RegCritical because Weak > -RegCritical.

The CandReason enum is properly sorted, so just remove artificial

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

llvm-svn: 297536

5 years ago[IRTranslator] Simplify error handling for translating constants. NFC.
Quentin Colombet [Sat, 11 Mar 2017 00:28:33 +0000 (00:28 +0000)]
[IRTranslator] Simplify error handling for translating constants. NFC.

We don't need to check whether the fallback path is enabled to return
false. Just do that all the time on error cases, the caller knows (or
at least should know!) how to handle the failing case.

llvm-svn: 297535

5 years agoFix subreg value numbers in handleMoveUp
Stanislav Mekhanoshin [Sat, 11 Mar 2017 00:14:52 +0000 (00:14 +0000)]
Fix subreg value numbers in handleMoveUp

The problem can occur in presence of subregs. If we are swapping two
instructions defining different subregs of the same register we will
get a new liveout from a block. We need to preserve value number for
block's liveout for successor block's livein to match.

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

llvm-svn: 297534

5 years agoRevert "Reapply [VFS] Ignore broken symlinks in the directory iterator."
Juergen Ributzka [Sat, 11 Mar 2017 00:14:50 +0000 (00:14 +0000)]
Revert "Reapply [VFS] Ignore broken symlinks in the directory iterator."

Still broken on Windows and SystemZ bot ... sorry for the noise.

llvm-svn: 297533

5 years agoFix DoNotOptimize on MSVC
Eric Fiselier [Sat, 11 Mar 2017 00:07:08 +0000 (00:07 +0000)]
Fix DoNotOptimize on MSVC

llvm-svn: 297532

5 years agoAdding debug output to investigate systemz bot issue.
Juergen Ributzka [Sat, 11 Mar 2017 00:01:24 +0000 (00:01 +0000)]
Adding debug output to investigate systemz bot issue.

llvm-svn: 297531

5 years agoclang/test/SemaOpenCL/overload_addrspace_resolution.cl: Appease MS mangler to specify...
NAKAMURA Takumi [Fri, 10 Mar 2017 23:06:34 +0000 (23:06 +0000)]
clang/test/SemaOpenCL/overload_addrspace_resolution.cl: Appease MS mangler to specify triple=x86_64-unknown.

llvm-svn: 297530

5 years agoStrip trailing whitespace.
Simon Pilgrim [Fri, 10 Mar 2017 22:53:19 +0000 (22:53 +0000)]
Strip trailing whitespace.

llvm-svn: 297529

5 years agoReapply [VFS] Ignore broken symlinks in the directory iterator.
Juergen Ributzka [Fri, 10 Mar 2017 22:49:04 +0000 (22:49 +0000)]
Reapply [VFS] Ignore broken symlinks in the directory iterator.

Modified the tests to accept any iteration order.

The VFS directory iterator and recursive directory iterator behave differently
from the LLVM counterparts. Once the VFS iterators hit a broken symlink they
immediately abort. The LLVM counterparts allow to recover from this issue by
clearing the error code and skipping to the next entry.

This change adds the same functionality to the VFS iterators. There should be
no change in current behavior in the current CLANG source base, because all
clients have loop exit conditions that also check the error code.

This fixes rdar://problem/30934619.

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

llvm-svn: 297528

5 years agoFix redundant condition (PR32138)
Simon Pilgrim [Fri, 10 Mar 2017 22:44:47 +0000 (22:44 +0000)]
Fix redundant condition (PR32138)

'!A || (A && B)' is equivalent to '!A || B'

llvm-svn: 297527

5 years ago[RDF] Remove the map of reaching defs from copy propagation
Krzysztof Parzyszek [Fri, 10 Mar 2017 22:44:24 +0000 (22:44 +0000)]
[RDF] Remove the map of reaching defs from copy propagation

Use Liveness::getNearestAliasedRef to find the reaching def instead.

llvm-svn: 297526

5 years ago[ELF] Handle NONE relocations on AArch64
Petr Hosek [Fri, 10 Mar 2017 22:42:22 +0000 (22:42 +0000)]
[ELF] Handle NONE relocations on AArch64

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

llvm-svn: 297525

5 years ago[RDF] Implement Liveness::getNearestAliasedRef(Reg, Inst)
Krzysztof Parzyszek [Fri, 10 Mar 2017 22:42:17 +0000 (22:42 +0000)]
[RDF] Implement Liveness::getNearestAliasedRef(Reg, Inst)

This function will find the closest ref node aliased to Reg that is
in an instruction preceding Inst. This could be used to identify the
hypothetical reaching def of Reg, if Reg was a member of Inst.

llvm-svn: 297524

5 years ago[X86][SSE] Fix load folding for (V)CVTDQ2PD
Simon Pilgrim [Fri, 10 Mar 2017 22:35:07 +0000 (22:35 +0000)]
[X86][SSE] Fix load folding for (V)CVTDQ2PD

This only requires a 64-bit memory source, not the whole 128-bits. But the 128-bit case is still supported via X86InstrInfo::foldMemoryOperandImpl

llvm-svn: 297523

5 years ago[unittest] Do not convert large unsigned long to isl::val
Tobias Grosser [Fri, 10 Mar 2017 22:25:39 +0000 (22:25 +0000)]
[unittest] Do not convert large unsigned long to isl::val

Currently the isl::val constructor only takes a signed long as parameter, which
on Windows is only 32 bit large and can consequently not be used to obtain the
same result when loading from the expression '(1ull << 32) - 1)' that we get
when loading this value via isl_val_int_from_ui or when loading the value
on Linux systems with 64 bit long data types. We avoid this issue by performing
the shift and subtractiong within the isl::val.

It would be nice to teach the isl++ bindings to construct isl::val from other
integer types, but the current interface is not sufficient to do so. If
constructors from both signed long and unsigned long are exposed, then integer
literals that are of type 'int' and which must be converted to 'long' to match
the constructor have two ambigious constructors to choose from, which result
in a compiler error. The right solution is likely to additionally expose
constructors from signed and unsigned int, but these are not yet available in
the isl C interface and adding those adhoc to our bindings is something I would
like to avoid for now. We should address this issue with a proper discussion
on the isl side.

llvm-svn: 297522

5 years ago[X86] Fix Wunused-lambda-capture warning
Simon Pilgrim [Fri, 10 Mar 2017 22:10:34 +0000 (22:10 +0000)]
[X86] Fix Wunused-lambda-capture warning

llvm-svn: 297521

5 years ago[isl++] Add namespace prefixes to isl::ctx and isl::stat
Tobias Grosser [Fri, 10 Mar 2017 22:10:19 +0000 (22:10 +0000)]
[isl++] Add namespace prefixes to isl::ctx and isl::stat

These were missed in r297478. We add them for consistency.

llvm-svn: 297520

5 years ago[isl++] Drop warning about experimental status
Tobias Grosser [Fri, 10 Mar 2017 22:10:15 +0000 (22:10 +0000)]
[isl++] Drop warning about experimental status

As most discussions about these bindings have concluded and only the final
patch review on the isl mailing list is missing, we drop the experimental
warning tag to match the patchset we will submit to isl, which is expected to
not change notably any more.

llvm-svn: 297519

5 years ago[X86][RTM] Regenerate RTM intrinsic tests for 32/64-bit targets.
Simon Pilgrim [Fri, 10 Mar 2017 21:55:24 +0000 (21:55 +0000)]
[X86][RTM] Regenerate RTM intrinsic tests for 32/64-bit targets.

llvm-svn: 297518

5 years agoRevert r297510 "[VFS] Ignore broken symlinks in the directory iterator."
Juergen Ributzka [Fri, 10 Mar 2017 21:46:51 +0000 (21:46 +0000)]
Revert r297510 "[VFS] Ignore broken symlinks in the directory iterator."

The tests are failing on one of the bots.

llvm-svn: 297517

5 years agoRespect CMAKE_INSTALL_MANDIR for sphinx generated manpages
Jonathan Roelofs [Fri, 10 Mar 2017 21:44:16 +0000 (21:44 +0000)]
Respect CMAKE_INSTALL_MANDIR for sphinx generated manpages

llvm-svn: 297516

5 years agoSilence a pedantic warning, NFC
Erik Pilkington [Fri, 10 Mar 2017 21:38:59 +0000 (21:38 +0000)]
Silence a pedantic warning, NFC

llvm-svn: 297515

5 years agoLTO: Hash type identifier resolutions for WholeProgramDevirt.
Peter Collingbourne [Fri, 10 Mar 2017 21:37:10 +0000 (21:37 +0000)]
LTO: Hash type identifier resolutions for WholeProgramDevirt.

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

llvm-svn: 297514

5 years agoLTO: Hash type identifier resolutions for LowerTypeTests.
Peter Collingbourne [Fri, 10 Mar 2017 21:35:17 +0000 (21:35 +0000)]
LTO: Hash type identifier resolutions for LowerTypeTests.

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

llvm-svn: 297513

5 years ago[GlobalISel] LegalizerHelper: Lower (G_FSUB X, Y) to (G_FADD X, (G_FNEG Y))
Volkan Keles [Fri, 10 Mar 2017 21:25:09 +0000 (21:25 +0000)]
[GlobalISel] LegalizerHelper: Lower (G_FSUB X, Y) to (G_FADD X, (G_FNEG Y))

Summary: No test case as none of the in-tree targets with GlobalISel support has this condition.

Reviewers: qcolombet, aditya_nandakumar, dsanders, t.p.northover, ab

Reviewed By: qcolombet

Subscribers: dberris, rovka, kristof.beyls, llvm-commits, igorb

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

llvm-svn: 297512

5 years ago[VFS] Remove the Path variable from RealFSDirIter. NFC.
Juergen Ributzka [Fri, 10 Mar 2017 21:23:29 +0000 (21:23 +0000)]
[VFS] Remove the Path variable from RealFSDirIter. NFC.

This variable is set, but never used.

llvm-svn: 297511

5 years ago[VFS] Ignore broken symlinks in the directory iterator.
Juergen Ributzka [Fri, 10 Mar 2017 21:23:27 +0000 (21:23 +0000)]
[VFS] Ignore broken symlinks in the directory iterator.

The VFS directory iterator and recursive directory iterator behave differently
from the LLVM counterparts. Once the VFS iterators hit a broken symlink they
immediately abort. The LLVM counterparts allow to recover from this issue by
clearing the error code and skipping to the next entry.

This change adds the same functionality to the VFS iterators. There should be
no change in current behavior in the current CLANG source base, because all
clients have loop exit conditions that also check the error code.

This fixes rdar://problem/30934619.

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

llvm-svn: 297510

5 years agoGlobalISel: Translate ConstantAggregateZero vectors
Volkan Keles [Fri, 10 Mar 2017 21:23:13 +0000 (21:23 +0000)]
GlobalISel: Translate ConstantAggregateZero vectors

Reviewers: qcolombet, aditya_nandakumar, dsanders, ab, t.p.northover, javed.absar

Reviewed By: qcolombet

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

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

llvm-svn: 297509

5 years agoOptions such as -omagic or -opt-remarks-* should be interpreted as -o.
Rui Ueyama [Fri, 10 Mar 2017 21:22:28 +0000 (21:22 +0000)]
Options such as -omagic or -opt-remarks-* should be interpreted as -o.

Options can start with `-` or `--` unless they start with "o".
Any option that starts with `-o` should be interpreted as an output
file name. This is a quote from the GNU ld man page.

  Note -- there is one exception to this rule.  Multiple letter
  options that start with a lower case 'o' can only be preceded by
  two dashes.  This is to reduce confusion with the -o option.
  So for example -omagic sets the output file name to magic whereas
  --omagic sets the NMAGIC flag on the output.

We didn't handle that properly before.

llvm-svn: 297508

5 years agoSink accessing TII to fix release Werror builds.
Eric Christopher [Fri, 10 Mar 2017 21:20:17 +0000 (21:20 +0000)]
Sink accessing TII to fix release Werror builds.

llvm-svn: 297507

5 years ago[ProfileSummaryInfo] Remove unneeded braces. NFCI.
Davide Italiano [Fri, 10 Mar 2017 20:50:51 +0000 (20:50 +0000)]
[ProfileSummaryInfo] Remove unneeded braces. NFCI.

llvm-svn: 297506

5 years agoFix all these headers to properly mark the doxygen comments.
Daniel Berlin [Fri, 10 Mar 2017 20:44:39 +0000 (20:44 +0000)]
Fix all these headers to properly mark the doxygen comments.

llvm-svn: 297505

5 years ago[AArch64, X86] Additional debug information for MacroFusion
Evandro Menezes [Fri, 10 Mar 2017 20:20:04 +0000 (20:20 +0000)]
[AArch64, X86] Additional debug information for MacroFusion

In order to make it easier to parse information about the performance of
MacroFusion, this patch adds the function and the instruction names to the
debug output of this pass.

llvm-svn: 297504

5 years agoWholeProgramDevirt: Implement export/import support for VCP.
Peter Collingbourne [Fri, 10 Mar 2017 20:13:58 +0000 (20:13 +0000)]
WholeProgramDevirt: Implement export/import support for VCP.

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

llvm-svn: 297503

5 years agoWholeProgramDevirt: Implement export/import support for unique ret val opt.
Peter Collingbourne [Fri, 10 Mar 2017 20:09:11 +0000 (20:09 +0000)]
WholeProgramDevirt: Implement export/import support for unique ret val opt.

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

llvm-svn: 297502

5 years ago[ELF] Propely handle .eh_frame in linker scripts
Petr Hosek [Fri, 10 Mar 2017 20:00:42 +0000 (20:00 +0000)]
[ELF] Propely handle .eh_frame in linker scripts

Using .eh_frame input section pattern in linker script currently
causes a crash; this is because .eh_frame input sections require
special handling since they're all combined into a synthetic
section rather than regular output section.

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

llvm-svn: 297501

5 years agoRefactor the PSI to extract getCallSiteCount and remove checks for profile type.
Dehao Chen [Fri, 10 Mar 2017 19:45:16 +0000 (19:45 +0000)]
Refactor the PSI to extract getCallSiteCount and remove checks for profile type.

Summary: There is no need to check profile count as only CallInst will have metadata attached.

Reviewers: eraman

Reviewed By: eraman

Subscribers: llvm-commits

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

llvm-svn: 297500

5 years ago[AMDGPU] Split R600/SI getFrameIndexReference and emit stack object offsets for SI
Konstantin Zhuravlyov [Fri, 10 Mar 2017 19:39:07 +0000 (19:39 +0000)]
[AMDGPU] Split R600/SI getFrameIndexReference and emit stack object offsets for SI

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

llvm-svn: 297499

5 years agoRename PT_NOTE namespace name used in AMDGPUPTNote.h
Yaxun Liu [Fri, 10 Mar 2017 19:35:43 +0000 (19:35 +0000)]
Rename PT_NOTE namespace name used in AMDGPUPTNote.h

Patch by Guansong Zhang.

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

llvm-svn: 297498

5 years agoAttempt to fix Windows buildbot.
Galina Kistanova [Fri, 10 Mar 2017 19:34:15 +0000 (19:34 +0000)]
Attempt to fix Windows buildbot.

llvm-svn: 297497

5 years agoSimplify & correct the patch I wrote in r297441, after thinking
Jason Molenda [Fri, 10 Mar 2017 19:31:54 +0000 (19:31 +0000)]
Simplify & correct the patch I wrote in r297441, after thinking
about this more I realized I could make the change isolated to
whether we decide an empty accelerator table is valid or not.

llvm-svn: 297496

5 years ago[GlobalISel] Translate insertelement and extractelement
Volkan Keles [Fri, 10 Mar 2017 19:08:28 +0000 (19:08 +0000)]
[GlobalISel] Translate insertelement and extractelement

Reviewers: qcolombet, aditya_nandakumar, dsanders, ab, t.p.northover, javed.absar

Reviewed By: qcolombet

Subscribers: dberris, rovka, llvm-commits, kristof.beyls

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

llvm-svn: 297495

5 years agoNewGVN: Rename InitialClass to TOP, which is what most people would expect it to...
Daniel Berlin [Fri, 10 Mar 2017 19:05:04 +0000 (19:05 +0000)]
NewGVN: Rename InitialClass to TOP, which is what most people would expect it to be called

llvm-svn: 297494

5 years ago[SLP] Revert everything that has to do with memory access sorting.
Michael Kuperstein [Fri, 10 Mar 2017 18:59:07 +0000 (18:59 +0000)]
[SLP] Revert everything that has to do with memory access sorting.

This reverts r293386, r294027, r294029 and r296411.

Turns out the SLP tree isn't actually a "tree" and we don't handle
accessing the same packet of loads in several different orders well,
causing miscompiles.

Revert until we can fix this properly.

llvm-svn: 297493

5 years ago[SelectionDAG] Add support for BUILD_VECTOR to ComputeNumSignBits
Simon Pilgrim [Fri, 10 Mar 2017 18:36:46 +0000 (18:36 +0000)]
[SelectionDAG] Add support for BUILD_VECTOR to ComputeNumSignBits

llvm-svn: 297492

5 years ago[GlobalISel] Make LegalizerInfo accessible in LegalizerHelper
Volkan Keles [Fri, 10 Mar 2017 18:34:57 +0000 (18:34 +0000)]
[GlobalISel] Make LegalizerInfo accessible in LegalizerHelper

We don’t actually use LegalizerInfo in Legalizer pass, it’s just passed
as an argument.

In order to check if an instruction is legal or not, we need to get LegalizerInfo
by calling `MI.getParent()->getParent()->getSubtarget().getLegalizerInfo()`.
Instead, make LegalizerInfo accessible in LegalizerHelper.

Reviewers: qcolombet, aditya_nandakumar, dsanders, ab, t.p.northover, kristof.beyls

Reviewed By: qcolombet

Subscribers: dberris, llvm-commits, rovka

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

llvm-svn: 297491

5 years agoCODE_OWNERS: Take code ownership of instruction scheduling.
Matthias Braun [Fri, 10 Mar 2017 18:34:37 +0000 (18:34 +0000)]
CODE_OWNERS: Take code ownership of instruction scheduling.

llvm-svn: 297490

5 years agoCODE_OWNERS: Sort names
Matthias Braun [Fri, 10 Mar 2017 18:34:33 +0000 (18:34 +0000)]
CODE_OWNERS: Sort names

llvm-svn: 297489

5 years ago[Support] Don't return an error if realPath fails.
Zachary Turner [Fri, 10 Mar 2017 18:33:41 +0000 (18:33 +0000)]
[Support] Don't return an error if realPath fails.

In openFileForRead, we would not previously return an error
if real_path resolution failed.  After a recent patch, we
started propagating this error up.  This caused a failure
in clang when trying to call openFileForRead("nul").  This
patch restores the previous behavior of not propagating this
error up.

llvm-svn: 297488

5 years ago[Builtin][ARM] Fix test case for uldivmod
Weiming Zhao [Fri, 10 Mar 2017 18:21:34 +0000 (18:21 +0000)]
[Builtin][ARM] Fix test case for uldivmod

Summary: the inline asm should set those clobbered registers.

Reviewers: rengolin, compnerd, jroelofs

Reviewed By: jroelofs

Subscribers: aemerson, llvm-commits

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

llvm-svn: 297487

5 years ago[X86][SSE] Added tests showing missed truncations for sitofp conversion
Simon Pilgrim [Fri, 10 Mar 2017 18:01:53 +0000 (18:01 +0000)]
[X86][SSE] Added tests showing missed truncations for sitofp conversion

SelectionDAG::ComputeNumSignBits is poor at build_vector handling, meaning that we can't see that all the vXi64 sources are in fact sign extended i32 or smaller.

llvm-svn: 297486

5 years ago[mips][msa] Remove range checks for non-immediate sld.[bhwd] instructions
Petar Jovanovic [Fri, 10 Mar 2017 17:51:01 +0000 (17:51 +0000)]
[mips][msa] Remove range checks for non-immediate sld.[bhwd] instructions

Removes immediate range checks for these instructions, since they have GPR
rt as their input operand.

Patch by Stefan Maksimovic.

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

llvm-svn: 297485

5 years agoFix test failure when Home directory cannot be found.
Zachary Turner [Fri, 10 Mar 2017 17:47:13 +0000 (17:47 +0000)]
Fix test failure when Home directory cannot be found.

llvm-svn: 297484

5 years agoAdd llvm::sys::fs::real_path.
Zachary Turner [Fri, 10 Mar 2017 17:39:21 +0000 (17:39 +0000)]
Add llvm::sys::fs::real_path.

LLVM already has real_path like functionality, but it is
cumbersome to use and involves clean up after (e.g. you have
to call openFileForRead, then close the resulting FD).

Furthermore, on Windows it doesn't work for directories since
opening a directory and opening a file require slightly
different flags.

So I add a simple function `real_path` which works for all
paths on all platforms and has a simple to use interface.

In doing so, I add the ability to opt in to resolving tilde
expressions (e.g. ~/foo), which are normally handled by
the shell.

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

llvm-svn: 297483

5 years ago[SelectionDAG] Make SelectionDAG aware of the known bits in USUBO and SSUBO and SUBC.
Amaury Sechet [Fri, 10 Mar 2017 17:26:44 +0000 (17:26 +0000)]
[SelectionDAG] Make SelectionDAG aware of the known bits in USUBO and SSUBO and SUBC.

Depends on D30379

This improves the state of things for the sub class of operation.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

llvm-svn: 297482

5 years ago[X86][MMX] Add tests showing missed opportunities to use MMX sitofp conversions
Simon Pilgrim [Fri, 10 Mar 2017 17:23:55 +0000 (17:23 +0000)]
[X86][MMX] Add tests showing missed opportunities to use MMX sitofp conversions

If we are transferring MMX registers to XMM for conversion we could use the MMX equivalents (CVTPI2PD + CVTPI2PS) without affecting rounding/exceptions etc.

llvm-svn: 297481

5 years agoFix assertion failure when 'proclist' is used without 'explicit' in KMP_AFFINITY
Jonathan Peyton [Fri, 10 Mar 2017 17:22:47 +0000 (17:22 +0000)]
Fix assertion failure when 'proclist' is used without 'explicit' in KMP_AFFINITY

This change fixes an assertion failure the in case KMP_AFFINITY is set with
'proclist' specified but without 'explicit'
e.g., KMP_AFFINITY=verbose,proclist=[0-31]

Patch by Olga Malysheva

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

llvm-svn: 297480

5 years ago[SelectionDAG] Make SelectionDAG aware of the known bits in UADDO and SADDO.
Amaury Sechet [Fri, 10 Mar 2017 17:06:52 +0000 (17:06 +0000)]
[SelectionDAG] Make SelectionDAG aware of the known bits in UADDO and SADDO.

Summary: As per title. This is extracted from D29872 and I threw SADDO in.

Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

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

llvm-svn: 297479

5 years ago[isl++] Do not use enum prefix
Tobias Grosser [Fri, 10 Mar 2017 17:01:30 +0000 (17:01 +0000)]
[isl++] Do not use enum prefix

Instead of declaring a function as:

  inline val plain_get_val_if_fixed(enum dim type, unsigned int pos) const;

we use:

  inline isl::val plain_get_val_if_fixed(isl::dim type, unsigned int pos) const;

The first argument caused the following compile time error on windows:

  "error C3431: 'dim': a scoped enumeration cannot be redeclared as an
  unscoped enumeration"

In some cases it is sufficient to just drop the 'enum' prefix, but for example
for isl::set the 'enum class dim' type collides with the function name
isl::set::dim and can consequently not be referenced. To avoid such kind of
ambiguities in the future we add the isl:: prefix consistently to all types

Reported-by: Michael Kruse <llvm@meinersbur.de>
llvm-svn: 297478

5 years ago[X86][MMX] Add tests showing missed opportunities to use MMX fptosi conversions
Simon Pilgrim [Fri, 10 Mar 2017 16:59:43 +0000 (16:59 +0000)]
[X86][MMX] Add tests showing missed opportunities to use MMX fptosi conversions

If we are transferring XMM conversion results to MMX registers we could use the MMX equivalents (CVTPD2PI/CVTTPD2PI + CVTPS2PI/CVTTPS2PI) with affecting rounding/expections etc.

llvm-svn: 297476

5 years ago[X86][MMX] Updated bad stack spill shift value test to actually show the problem
Simon Pilgrim [Fri, 10 Mar 2017 16:18:50 +0000 (16:18 +0000)]
[X86][MMX] Updated bad stack spill shift value test to actually show the problem

Cleaning up the ir had stopped showing the issue.

llvm-svn: 297475

5 years ago[X86][MMX] Regenerate mmx bitcast tests
Simon Pilgrim [Fri, 10 Mar 2017 16:07:39 +0000 (16:07 +0000)]
[X86][MMX] Regenerate mmx bitcast tests

llvm-svn: 297474

5 years ago[Simplify] Add -polly-simplify pass.
Michael Kruse [Fri, 10 Mar 2017 16:05:24 +0000 (16:05 +0000)]
[Simplify] Add -polly-simplify pass.

This new pass removes unnecessary accesses and writes. It currently
supports 2 simplifications, but more are planned.

It removes write accesses that write a loaded value back to the location
it was loaded from. It is a typical artifact from DeLICM. Removing it
will get rid of bogus dependencies later in dependency analysis.

It also removes statements without side-effects. ScopInfo already
removes these, but the removal of unnecessary writes can result in
more side-effect free statements.

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

llvm-svn: 297473

5 years agoDon't pass Dot to every callback.
Rafael Espindola [Fri, 10 Mar 2017 16:04:26 +0000 (16:04 +0000)]
Don't pass Dot to every callback.

It is available from ScriptBase.

llvm-svn: 297472

5 years ago[X86][MMX] Add test showing bad stack spill of shift value
Simon Pilgrim [Fri, 10 Mar 2017 15:53:41 +0000 (15:53 +0000)]
[X86][MMX] Add test showing bad stack spill of shift value

i32 is spilled to stack but 64-bit mmx is reloaded - leaving garbage in the other half of the register

llvm-svn: 297471

5 years ago[X86][MMX] Regenerate mmx load folding tests
Simon Pilgrim [Fri, 10 Mar 2017 15:41:05 +0000 (15:41 +0000)]
[X86][MMX] Regenerate mmx load folding tests

llvm-svn: 297470

5 years ago[OpenCL] Fix type compatibility check and generic AS mangling.
Anastasia Stulova [Fri, 10 Mar 2017 15:23:07 +0000 (15:23 +0000)]
[OpenCL] Fix type compatibility check and generic AS mangling.

1. Reimplemented conditional operator so that it checks
compatibility of unqualified pointees of the 2nd and
the 3rd operands (C99, OpenCL v2.0 6.5.15).

Define QualTypes compatibility for OpenCL as following:

   - corresponding types are compatible (C99 6.7.3)
   - CVR-qualifiers are equal (C99 6.7.3)
   - address spaces are equal (implementation defined)

2. Added generic address space to Itanium mangling.

Review: D30037

Patch by Dmitry Borisenkov!

llvm-svn: 297468

5 years ago[clang-format] Add option to break before inheritance separation operator in class...
Andi-Bogdan Postelnicu [Fri, 10 Mar 2017 15:10:37 +0000 (15:10 +0000)]
[clang-format] Add option to break before inheritance separation operator in class declaration.

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

llvm-svn: 297467

5 years ago[DeadCodeElimination] Translate to C++ bindings
Tobias Grosser [Fri, 10 Mar 2017 15:05:38 +0000 (15:05 +0000)]
[DeadCodeElimination] Translate to C++ bindings

This pass is a small and self-contained example of a piece of code that was
written with the isl C interface. The diff of this change nicely shows how the
C++ bindings can improve the readability of the code by avoiding the long C
function names and by avoiding any need for memory management.

As you will see, no calls to isl_*_copy or isl_*_free are needed anymore.
Instead the C++ interface takes care of automatically managing the objects.
This may introduce internally additional copies, but due to the isl reference
counting, such copies are expected to be cheap. For performance critical
operations, we will later exploit move semantics to eliminate unnecessary
copies that have shown to be costly.

Below we give a set of examples that shows the benefit of the C++ interface vs.
the pure C interface.

Check properties


  if (isl_aff_is_zero(aff) ||  isl_aff_is_one(aff))
    return true;


  if (Aff.is_zero() || Aff.is_one())
    return true;

Type conversion


  isl_union_pw_multi_aff *UPMA = isl_union_pw_multi_aff_from_union_map(umap);


  isl::union_pw_multi_aff UPMA = UMap;

Type construction


  auto *Empty = isl_union_map_empty(space);


  auto Empty = isl::union_map::empty(Space);



  set = isl_union_set_intersect(set, set2);


  Set = Set.intersect(Set2);

The use of isl::boolean in return types also adds an increases the robustness
of Polly, as on conversion to true or false, we verify that no isl_bool_error
has been returned and assert in case an error was returned. Before this change
we would have just ignored the error and proceeded with (some) exection path.

Tags: #polly

Reviewed By: Meinersbur

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

llvm-svn: 297466

5 years agoPrint nested name specifiers for typedefs and type aliases
Alex Lorenz [Fri, 10 Mar 2017 15:04:58 +0000 (15:04 +0000)]
Print nested name specifiers for typedefs and type aliases

Printing typedefs or type aliases using clang_getTypeSpelling() is missing the
namespace they are defined in. This is in contrast to other types that always
yield the full typename including namespaces.

Patch by Michael Reiher!

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

llvm-svn: 297465

5 years ago[unittest] Translate isl tests to C++ bindings
Tobias Grosser [Fri, 10 Mar 2017 14:58:50 +0000 (14:58 +0000)]
[unittest] Translate isl tests to C++ bindings

For this translation we introduce two functions, valFromAPInt and APIntFromVal,
to convert between isl::val and APInt. For now these are just proxies, but in
the future they will replace the current isl_val* based conversion functions.

The isl unit test cases benefit most from the new isl::boolean (from Michael
Kruse), which can be explicitly casted to bool and which -- as part of this cast
-- emits a check that no error condition has been triggered so far. This allows
us to simplify

  EXPECT_EQ(isl_bool_true, isl_val_is_zero(IslZero));



This simplification also becomes very clear in operator==, which changes from

  auto IsEqual = isl_set_is_equal(LHS.keep(), RHS.keep());
  EXPECT_NE(isl_bool_error, IsEqual);
  return IsEqual;

to just

  return bool(LHS.is_equal(RHS));

Some background for non-isl users. The isl C interface has an isl_bool type,
which can be either true, false, or error. Hence, whenever a function returns
a value of type isl_bool, an explicit error check should be considered. By
using isl::boolean, we can just cast the isl::boolean to 'bool' or simply use
the isl::boolean in a context where it will automatically be casted to bool
(e.g., in an if-condition). When doing so, the C++ bindings automatically add
code that verifies that the return value is not an error code. If it is, the
program will warn about this and abort. For cases where errors are expected,
isl::boolean provides checks such as boolean::is_true_or_error() or
boolean::is_true_no_error() to explicitly control program behavior in case of
error conditions.

Thanks to the new automatic memory management, we also can avoid many calls to
isl_*_free. For code that had previously been managed by IslPtr<>, many calls
to give/take/copy are eliminated.

Tags: #polly

Reviewed By: Meinersbur

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

llvm-svn: 297464

5 years ago[FlattenAlgo] Translate to C++ bindings
Tobias Grosser [Fri, 10 Mar 2017 14:55:58 +0000 (14:55 +0000)]
[FlattenAlgo] Translate to C++ bindings

Translate the full algorithm to use the new isl C++ bindings

This is a large piece of code that has been written with the Polly IslPtr<>
memory management tool, which only performed memory management, but did not
provide a method interface. As such the code was littered with calls to
give(), copy(), keep(), and take(). The diff of this change should give a
good example how the new method interface simplifies the code by removing the
need for switching between managed types and C functions all the time
and consequently also the need to use the long C function names.

These are a couple of examples comparing the old IslPtr memory management
interface with the complete method interface.

Check properties


  if (isl_aff_is_zero(Aff.get()) ||  isl_aff_is_one(Aff.get()))
    return true;


  if (Aff.is_zero() || Aff.is_one())
    return true;

Type conversion


  isl_union_pw_multi_aff *UPMA =


  isl::union_pw_multi_aff UPMA = UMap;

Type construction


  auto Empty = give(isl_union_map_empty(Space.copy());


  auto Empty = isl::union_map::empty(Space);



  Set = give(isl_union_set_intersect(Set.copy(), Set2.copy());


  Set = Set.intersect(Set2);

Tags: #polly

Reviewed By: Meinersbur

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

llvm-svn: 297463

5 years agoAdd method interface to isl C++ bindings
Tobias Grosser [Fri, 10 Mar 2017 14:53:00 +0000 (14:53 +0000)]
Add method interface to isl C++ bindings

The isl C++ binding method interface introduces a thin C++ layer that allows
to call isl methods directly on the memory managed C++ objects. This makes the
relevant methods directly available via code-completion interfaces, allows for
the use of overloading, conversion constructors, and many other nice C++
features that make using isl a lot easier.

The individual features will be highlighted in the subsequent commits.

Tags: #polly

Reviewed By: Meinersbur

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

llvm-svn: 297462

5 years ago[analyzer] Extend block in critical section check with C11 and Pthread APIs.
Gabor Horvath [Fri, 10 Mar 2017 14:50:12 +0000 (14:50 +0000)]
[analyzer] Extend block in critical section check with C11 and Pthread APIs.

Patch by Zoltan Daniel Torok!

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

llvm-svn: 297461