platform/upstream/llvm.git
4 years ago[MLIR] Add Async dialect with trivial async.region operation
Eugene Zhulenev [Tue, 29 Sep 2020 05:47:00 +0000 (22:47 -0700)]
[MLIR] Add Async dialect with trivial async.region operation

Start Async dialect for modeling asynchronous execution.

Reviewed By: mehdi_amini, herhut

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

4 years ago[gn build] Port 6d193ba3337
LLVM GN Syncbot [Tue, 29 Sep 2020 17:50:16 +0000 (17:50 +0000)]
[gn build] Port 6d193ba3337

4 years agoAdds MLIR C-API for marshaling Python capsules.
Stella Laurenzo [Mon, 28 Sep 2020 16:08:09 +0000 (09:08 -0700)]
Adds MLIR C-API for marshaling Python capsules.

* Providing stable, C-accessible definitions for bridging MLIR Python<->C APIs, we eliminate inter-extension dependencies (i.e. they can all share a diamond dependency on the MLIR C-API).
* Just provides accessors for context and module right now.
* Needed in NPComp in ~a week or so for high level Torch APIs.

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

4 years ago[NFC][regalloc] Unit test for AllocationOrder iteration.
Mircea Trofin [Mon, 28 Sep 2020 23:41:28 +0000 (16:41 -0700)]
[NFC][regalloc] Unit test for AllocationOrder iteration.

Added unittests. In the process, separated core construction - which just
needs the hits, order, and 'HardHints' values - from construction from
current register allocation state, to simplify testing.

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

4 years agoAdd -fprofile-update={atomic,prefer-atomic,single}
Fangrui Song [Tue, 29 Sep 2020 17:38:51 +0000 (10:38 -0700)]
Add -fprofile-update={atomic,prefer-atomic,single}

GCC 7 introduced -fprofile-update={atomic,prefer-atomic} (prefer-atomic is for
best efforts (some targets do not support atomics)) to increment counters
atomically, which is exactly what we have done with -fprofile-instr-generate
(D50867) and -fprofile-arcs (b5ef137c11b1cc6ae839ee75b49233825772bdd0).
This patch adds the option to clang to surface the internal options at driver level.

GCC 7 also turned on -fprofile-update=prefer-atomic when -pthread is specified,
but it has performance regression
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89307). So we don't follow suit.

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

4 years ago[InstCombine] adjust duplicate test for masked load; NFC
Sanjay Patel [Tue, 29 Sep 2020 17:29:34 +0000 (13:29 -0400)]
[InstCombine] adjust duplicate test for masked load; NFC

The test after the changed test was checking exactly the same dereferenceable bytes.

4 years ago[InstCombine] visitTrunc - trunc (*shr (trunc A), C) --> trunc(*shr A, C)
Simon Pilgrim [Tue, 29 Sep 2020 17:27:28 +0000 (18:27 +0100)]
[InstCombine] visitTrunc - trunc (*shr (trunc A), C) --> trunc(*shr A, C)

Attempt to fold trunc (*shr (trunc A), C) --> trunc(*shr A, C) iff the shift amount if small enough that all zero/sign bits created by the shift are removed by the last trunc.

Helps fix the regressions encountered in D88316.

I've tweaked a couple of shift values as suggested by @lebedev.ri to ensure we have coverage of shift values close (above/below) to the max limit.

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

4 years ago[ELF] Fix multiple -mllvm after D70378
Fangrui Song [Tue, 29 Sep 2020 17:25:16 +0000 (10:25 -0700)]
[ELF] Fix multiple -mllvm after D70378

Fixes https://reviews.llvm.org/D70378#2299569 Multiple -mllvm is intended to be supported.

We don't have a proper test for `-plugin-opt=-`. This patch adds the test as well.

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

4 years ago[InstCombine] fix weird formatting in test file; NFC
Sanjay Patel [Tue, 29 Sep 2020 17:20:28 +0000 (13:20 -0400)]
[InstCombine] fix weird formatting in test file; NFC

It apparently didn't cause trouble for the parser or FileCheck,
but it was confusing to see a function def split by asserts.

4 years agoLanaiTargetMachine.h - remove unnecessary includes. NFCI.
Simon Pilgrim [Tue, 29 Sep 2020 17:14:43 +0000 (18:14 +0100)]
LanaiTargetMachine.h - remove unnecessary includes. NFCI.

4 years agoLanaiSubtarget.h - remove unnecessary includes. NFCI.
Simon Pilgrim [Tue, 29 Sep 2020 17:14:18 +0000 (18:14 +0100)]
LanaiSubtarget.h - remove unnecessary includes. NFCI.

TargetFrameLowering.h is guaranteed to be covered by LanaiFrameLowering.h

4 years ago[BuildLibCalls] Add noundef to the returned pointers of allocators and argument of...
Juneyoung Lee [Sun, 20 Sep 2020 09:08:27 +0000 (18:08 +0900)]
[BuildLibCalls] Add noundef to the returned pointers of allocators and argument of free

This patch adds noundef to the returned pointers of allocators (malloc, calloc, ...)
and the pointer argument of free.
The returned pointer of allocators cannot be poison or (partially) undef.
Since the pointer that is given to free should precisely have zero offset,
it cannot be poison or (partially) undef too.

For the size arguments of allocators, noundef wasn't attached simply because
I wasn't sure whether attaching it is okay or not.

Reviewed By: jdoerfert

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

4 years ago[mlir][openacc] Add shutdown operation
Valentin Clement [Tue, 29 Sep 2020 17:12:54 +0000 (13:12 -0400)]
[mlir][openacc] Add shutdown operation

This patch introduces the acc.shutdown operation that represents an OpenACC shutdown directive.
Clauses are derived from the spec 2.14.2

Reviewed By: ftynse

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

4 years ago[lldb] Remove redundant ctor call (NFC)
Jonas Devlieghere [Tue, 29 Sep 2020 17:04:15 +0000 (10:04 -0700)]
[lldb] Remove redundant ctor call (NFC)

As pointed out by Pavel in D88249.

4 years ago[clangd] findNearbyIdentifier(): guaranteed to give up after 2^N lines
Aleksandr Platonov [Tue, 29 Sep 2020 16:54:33 +0000 (19:54 +0300)]
[clangd] findNearbyIdentifier(): guaranteed to give up after 2^N lines

As @kadircet mentions in D84912#2184144, `findNearbyIdentifier()` traverses the whole file if there is no identifier for the word.
This patch ensures give up after 2^N lines in any case.

Reviewed By: sammccall

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

4 years ago[libc++][ci] Update how we build the Docker image
Louis Dionne [Tue, 29 Sep 2020 16:48:44 +0000 (12:48 -0400)]
[libc++][ci] Update how we build the Docker image

This fixes a couple of issues, such as failing filesystem tests (due to
running the tests as root), and not running with the GCC we downloaded.

4 years ago[COFF][CG Profile] set undefined symbol to external
Zequan Wu [Tue, 29 Sep 2020 00:17:23 +0000 (17:17 -0700)]
[COFF][CG Profile] set undefined symbol to external

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

4 years ago[flang][msvc] Avoid templated initializer list initialization of vector. NFC.
Michael Kruse [Tue, 29 Sep 2020 16:37:35 +0000 (11:37 -0500)]
[flang][msvc] Avoid templated initializer list initialization of vector. NFC.

The Microsoft compiler emits an error when populating the vector with a single element of a templated argument using the brace syntax. The error is:
```
constant.h(102,1): error C2664: 'std::vector<Fortran::evaluate::value::Complex<...>, ...>::vector(std::initializer_list<_Ty>,const _Alloc &)': cannot convert argument 1 from 'initializer list' to 'std::initializer_list<_Ty>'
```
To work around this error, we replace the templated constructor with one for the expected type. Conversion to the element type has to be done by the caller.

This patch is part of the series to make flang compilable with MS Visual Studio <http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html>.

Reviewed By: klausler

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

4 years ago[libc++] Add a regression test for erasing from a vector
Arthur O'Dwyer [Tue, 29 Sep 2020 16:17:26 +0000 (12:17 -0400)]
[libc++] Add a regression test for erasing from a vector

After rebasing my trivially-relocatable branch, this behavior was broken...
but no libc++ unit test caught it! Add a regression test specifically for
erasing out of a vector.

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

4 years ago[InstCombine] Fix the outofrange tests and add exact shift tests for D88429
Simon Pilgrim [Tue, 29 Sep 2020 16:15:00 +0000 (17:15 +0100)]
[InstCombine] Fix the outofrange tests and add exact shift tests for D88429

4 years ago[InstCombine] visitTrunc - remove dead trunc(lshr (zext A), C) combine. NFCI.
Simon Pilgrim [Tue, 29 Sep 2020 15:54:13 +0000 (16:54 +0100)]
[InstCombine] visitTrunc - remove dead trunc(lshr (zext A), C) combine. NFCI.

I added additional test coverage at rG7a55989dc4305 - but all are handled independently of this combine and http://lab.llvm.org:8080/coverage/coverage-reports/ indicates the code is never used.

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

4 years ago[lldb] Also configure lldb_framework_dir in the lit.site.cfg.py
Jonas Devlieghere [Tue, 29 Sep 2020 16:12:29 +0000 (09:12 -0700)]
[lldb] Also configure lldb_framework_dir in the lit.site.cfg.py

Configuring the variable in CMake isn't enought, because the build mode
can't be resolved until execution time, which requires the build mode to
be substituted by lit.

4 years ago[libc++] Fix tests on GCC 10
Louis Dionne [Tue, 29 Sep 2020 14:49:52 +0000 (10:49 -0400)]
[libc++] Fix tests on GCC 10

Also, remove workarounds for ancient Clangs from is_constructible tests.

4 years ago[lldb] Configure LLDB_FRAMEWORK_DIR in multi-generator builds
Jonas Devlieghere [Tue, 29 Sep 2020 15:56:27 +0000 (08:56 -0700)]
[lldb] Configure LLDB_FRAMEWORK_DIR in multi-generator builds

4 years agoNFC, add a missing stdlib include for the use of abort
Alex Lorenz [Tue, 29 Sep 2020 15:48:07 +0000 (08:48 -0700)]
NFC, add a missing stdlib include for the use of abort

The FatalErrorHandler.cpp file uses 'abort', but doesn't include
'stdlib.h'. This causes a build error when modules are used in clang.

4 years ago[clangd] Disable msan instrumentation for generated Evaluate().
Utkarsh Saxena [Tue, 29 Sep 2020 15:06:13 +0000 (17:06 +0200)]
[clangd] Disable msan instrumentation for generated Evaluate().

MSAN build times out for generated DecisionForest inference runtime.

A solution worth trying is splitting the function into 300 smaller
functions and then re-enable msan.

For now we are disabling instrumentation for the generated function.

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

4 years agoMSP430TargetMachine.h - remove unused includes. NFCI.
Simon Pilgrim [Tue, 29 Sep 2020 15:36:58 +0000 (16:36 +0100)]
MSP430TargetMachine.h - remove unused includes. NFCI.

4 years agoNVPTXTargetMachine.h - remove unused includes. NFCI.
Simon Pilgrim [Tue, 29 Sep 2020 15:29:51 +0000 (16:29 +0100)]
NVPTXTargetMachine.h - remove unused includes. NFCI.

4 years agoSparcSubtarget.h - cleanup include dependencies. NFCI.
Simon Pilgrim [Tue, 29 Sep 2020 15:15:35 +0000 (16:15 +0100)]
SparcSubtarget.h - cleanup include dependencies. NFCI.

TargetFrameLowering.h is guaranteed to be covered by SparcFrameLowering.h

Fix missing implicit Triple.h dependency.

4 years ago[OpenMP][VE plugin] Fixing failure to build VE plugin with consolidated error handlin...
Manoel Roemmer [Tue, 29 Sep 2020 14:21:09 +0000 (16:21 +0200)]
[OpenMP][VE plugin] Fixing failure to build VE plugin with consolidated error handling in libomptarget

The libomptarget VE plugin [[
http://lab.llvm.org:8014/builders/clang-ve-ninja/builds/8937/steps/build-unified-tree/logs/stdio
| fails zu build ]] after ae95ceeb8f98d81f615c69da02f73b5ee6b1519a .

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

4 years ago[scudo][standalone] Fix Primary's ReleaseToOS test
Kostya Kortchinsky [Tue, 29 Sep 2020 00:21:00 +0000 (17:21 -0700)]
[scudo][standalone] Fix Primary's ReleaseToOS test

Said test was flaking on Fuchsia for non-obvious reasons, and only
for ASan variants (the release was returning 0).

It turned out that the templating was off, `true` being promoted to
a `s32` and used as the minimum interval argument. This meant that in
some circumstances, the normal release would occur, and the forced
release would have nothing to release, hence the 0 byte released.

The symbols are giving it away (note the 1):
```
scudo::SizeClassAllocator64<scudo::FixedSizeClassMap<scudo::DefaultSizeClassConfig>,24ul,1,2147483647,false>::releaseToOS(void)
```

This also probably means that there was no MTE version of that test!

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

4 years ago[SVE] Fix typo in CHECK lines for sve-fixed-length-int-reduce.ll
Cameron McInally [Tue, 29 Sep 2020 15:12:58 +0000 (10:12 -0500)]
[SVE] Fix typo in CHECK lines for sve-fixed-length-int-reduce.ll

4 years ago[InstCombine] use redirect of input file in regression tests; NFC
Sanjay Patel [Tue, 29 Sep 2020 15:02:03 +0000 (11:02 -0400)]
[InstCombine] use redirect of input file in regression tests; NFC

This is a repeat of 1880092722 from 2009. We should have less risk
of hitting bugs at this point because we auto-generate positive CHECK
lines only, but this makes things consistent.

Copying the original commit msg:
"Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename."

4 years ago[mlir][openacc] Add init operation
Valentin Clement [Tue, 29 Sep 2020 14:58:46 +0000 (10:58 -0400)]
[mlir][openacc] Add init operation

This patch introduces the init operation that represents the init executable directive
from the OpenACC 3.0 specifications.

Reviewed By: ftynse

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

4 years ago[InstCombine] Add some basic trunc(lshr(zext(x),c)) tests
Simon Pilgrim [Tue, 29 Sep 2020 14:49:43 +0000 (15:49 +0100)]
[InstCombine] Add some basic trunc(lshr(zext(x),c)) tests

Copied from the sext equivalents

4 years ago[mlir][openacc] Add wait operation
Valentin Clement [Tue, 29 Sep 2020 14:39:13 +0000 (10:39 -0400)]
[mlir][openacc] Add wait operation

This patch introduce the wait operation that represent the OpenACC wait directive.

Reviewed By: ftynse

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

4 years ago[clangd] Improve PopulateSwitch tweak to work on non-empty switches
Tadeo Kondrak [Tue, 29 Sep 2020 14:29:22 +0000 (16:29 +0200)]
[clangd] Improve PopulateSwitch tweak to work on non-empty switches

Improve the recently-added PopulateSwitch tweak to work on non-empty switches.

Reviewed By: sammccall

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

4 years ago[InstCombine] Inherit exact flags on extended shifts in trunc (lshr (sext A), C)...
Simon Pilgrim [Tue, 29 Sep 2020 14:30:46 +0000 (15:30 +0100)]
[InstCombine] Inherit exact flags on extended shifts in trunc (lshr (sext A), C) --> (ashr A, C)

This was missed in D88475

4 years ago[mlir] Expose Dialect class and registration/loading to C API
Alex Zinenko [Tue, 29 Sep 2020 14:23:02 +0000 (16:23 +0200)]
[mlir] Expose Dialect class and registration/loading to C API

- Add a minimalist C API for mlir::Dialect.
- Allow one to query the context about registered and loaded dialects.
- Add API for loading dialects.
- Provide functions to register the Standard dialect.

When used naively, this will require to separately register each dialect. When
we have more than one exposed, we can add variadic macros that expand to
individual calls.

Reviewed By: mehdi_amini

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

4 years ago[InstCombine] Add exact shift tests missed in D88475
Simon Pilgrim [Tue, 29 Sep 2020 14:05:30 +0000 (15:05 +0100)]
[InstCombine] Add exact shift tests missed in D88475

I missed the post-LGTM comment from @lebedev.ri

4 years ago[Sema] Address-space sensitive check for unbounded arrays (v2)
Chris Hamilton [Tue, 29 Sep 2020 14:11:41 +0000 (16:11 +0200)]
[Sema] Address-space sensitive check for unbounded arrays (v2)

Check applied to unbounded (incomplete) arrays and pointers to spot
cases where the computed address is beyond the largest possible
addressable extent of the array, based on the address space in which the
array is delcared, or which the pointer refers to.

Check helps to avoid cases of nonsense pointer math and array indexing
which could lead to linker failures or runtime exceptions.  Of
particular interest when building for embedded systems with small
address spaces.

This is version 2 of this patch -- version 1 had some testing issues
due to a sign error in existing code.  That error is corrected and
lit test for this chagne is extended to verify the fix.

Originally reviewed/accepted by: aaron.ballman
Original revision: https://reviews.llvm.org/D86796

Reviewed By: ebevhan

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

4 years ago[SDAG] Do not convert undef to 0 when folding CONCAT/BUILD_VECTOR
Krzysztof Parzyszek [Thu, 24 Sep 2020 23:59:02 +0000 (18:59 -0500)]
[SDAG] Do not convert undef to 0 when folding CONCAT/BUILD_VECTOR

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

4 years ago[InstCombine] visitTrunc - trunc (lshr (sext A), C) --> (ashr A, C) non-uniform support
Simon Pilgrim [Tue, 29 Sep 2020 13:45:30 +0000 (14:45 +0100)]
[InstCombine] visitTrunc - trunc (lshr (sext A), C) --> (ashr A, C) non-uniform support

This came from @lebedev.ri's suggestion to use m_SpecificInt_ICMP for D88429 - since I was going to change the m_APInt to m_Constant for that patch I thought I would do it for the only other user of the APInt first.

I've added a ConstantExpr::getUMin helper - its trivial to add UMAX/SMIN/SMAX but thought I'd wait until we have use cases.

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

4 years ago[mlir][openacc] Add update operation
Valentin Clement [Tue, 29 Sep 2020 13:56:54 +0000 (09:56 -0400)]
[mlir][openacc] Add update operation

This patch introduce the update operation that represent the OpenACC update directive.

Reviewed By: ftynse

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

4 years ago[mlir][Linalg] Refactor Linalg op initTensors support - NFC
Nicolas Vasilache [Tue, 29 Sep 2020 12:23:37 +0000 (08:23 -0400)]
[mlir][Linalg] Refactor Linalg op initTensors support - NFC

Manually-defined named ops do not currently support `init_tensors` or return values and may never support them. Add extra interface to the StructuredOpInterface so that we can still write op-agnostic transformations based on StructuredOpInterface.

This is an NFC extension in preparation for tiling on tensors.

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

4 years ago[GlobalISel] fix widenScalarUnmerge if widen type is not a multiple of destination...
Dominik Montada [Mon, 28 Sep 2020 14:38:35 +0000 (16:38 +0200)]
[GlobalISel] fix widenScalarUnmerge if widen type is not a multiple of destination type

Fix creation of illegal unmerge when widen was requested to a type which
is not a multiple of the destination type. E.g. when trying to widen
an s48 unmerge to s64 the existing code would create an illegal unmerge
from s64 to s48.

Instead, create further unmerges to a GCD type, then use this to remerge
these intermediate results to the actual destinations.

Reviewed By: arsenm

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

4 years ago[mlir][Linalg] Refactor Linalg creation of loops to allow passing iterArgs - NFC
Nicolas Vasilache [Tue, 29 Sep 2020 12:07:08 +0000 (08:07 -0400)]
[mlir][Linalg] Refactor Linalg creation of loops to allow passing iterArgs - NFC

This revision changes the signatures of helper function that Linalg uses to create loops so that they can also take iterArgs.
iterArgs are asserted empty to ensure no functional change.
This is a mechanical change in preparation of tiling on linalg on tensors to avoid  polluting the implementation with an NFC change.

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

4 years ago[AArch64] Add v8.5 Branch Target Identification support.
Daniel Kiss [Tue, 29 Sep 2020 13:50:19 +0000 (15:50 +0200)]
[AArch64] Add v8.5 Branch Target Identification support.

The .note.gnu.property must be in the assembly file to indicate the
support for BTI otherwise BTI will be disabled for the whole library.
__unw_getcontext and libunwind::Registers_arm64::jumpto() may be called
indirectly therefore they should start with a landing pad.

Reviewed By: tamas.petz, #libunwind, compnerd

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

4 years agoRevert "[AMDGPU] Reorganize GCN subtarget features for unaligned access"
Mirko Brkusanin [Tue, 29 Sep 2020 13:29:26 +0000 (15:29 +0200)]
Revert "[AMDGPU] Reorganize GCN subtarget features for unaligned access"

This reverts commit f5cd7ec9f3fc969ff5e1feed961996844333de3b.

Certain rocPRIM/rocThrust/hipCUB tests were failing because of this change.

4 years ago[mlir] Fix shared libs build
Andrzej Warzynski [Tue, 29 Sep 2020 13:20:35 +0000 (14:20 +0100)]
[mlir] Fix shared libs build

The following change causes the shared libraries build
(BUILD_SHARED_LIBS=On) to fail:
  * https://reviews.llvm.org/D88351
This patch will fix that.

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

4 years ago[SDag] Verify DAG divergence after dumping. NFC.
Jay Foad [Mon, 28 Sep 2020 12:37:49 +0000 (13:37 +0100)]
[SDag] Verify DAG divergence after dumping. NFC.

When debugging, it's useful to be able to see the DAG that has just
failed divergence verification.

4 years ago[SDag] Refactor and simplify divergence calculation and checking. NFC.
Jay Foad [Mon, 28 Sep 2020 11:44:43 +0000 (12:44 +0100)]
[SDag] Refactor and simplify divergence calculation and checking. NFC.

4 years ago[SystemZ] Don't emit PC-relative memory accesses to unaligned symbols.
Jonas Paulsson [Thu, 10 Sep 2020 13:59:36 +0000 (15:59 +0200)]
[SystemZ] Don't emit PC-relative memory accesses to unaligned symbols.

In the presence of packed structures (#pragma pack(1)) where elements are
referenced through pointers, there will be stores/loads with alignment values
matching the default alignments for the element types while the elements are
in fact unaligned. Strictly speaking this is incorrect source code, but is
unfortunately part of existing code and therefore now addressed.

This patch improves the pattern predicate for PC-relative loads and stores by
not only checking the alignment value of the instruction, but also making
sure that the symbol (and element) itself is aligned.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44405

Review: Ulrich Weigand

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

4 years ago[mlir][GPU] Improve constant sinking in kernel outlining
Stephan Herhut [Tue, 29 Sep 2020 11:20:37 +0000 (13:20 +0200)]
[mlir][GPU] Improve constant sinking in kernel outlining

The previous implementation did not support sinking simple expressions. In particular,
it is often beneficial to sink dim operations.

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

4 years ago[LoopUtils] Only verify SE in builds with assertions.
Florian Hahn [Tue, 29 Sep 2020 12:37:24 +0000 (13:37 +0100)]
[LoopUtils] Only verify SE in builds with assertions.

Follow up to 60b852092c98.

4 years ago[sanitizer] Don't build gmock for tests (follow-up to 82827244).
Hans Wennborg [Tue, 29 Sep 2020 12:29:58 +0000 (14:29 +0200)]
[sanitizer] Don't build gmock for tests (follow-up to 82827244).

A use of gmock was briefly added in a90229d6, but was soon removed in
82827244. This also removes it from the cmake files.

4 years ago[SYCL] Assume SYCL device functions are convergent
Alexey Bader [Tue, 25 Aug 2020 14:05:19 +0000 (17:05 +0300)]
[SYCL] Assume SYCL device functions are convergent

SYCL device compiler (similar to other SPMD compilers) assumes that
functions are convergent by default to avoid invalid transformations.
This attribute can be removed if compiler can prove that function does
not have convergent operations.

Reviewed By: Naghasan

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

4 years ago[AArch64] Add BTI to CFI jumptables.
Daniel Kiss [Tue, 29 Sep 2020 11:35:25 +0000 (13:35 +0200)]
[AArch64] Add BTI to CFI jumptables.

With branch protection the jump to the jump table entries requires a landing pad.

Reviewed By: eugenis, tamas.petz

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

4 years ago[IndVarSimplify] Fix Modified status for removal of overflow intrinsics
David Stenberg [Tue, 29 Sep 2020 09:04:13 +0000 (11:04 +0200)]
[IndVarSimplify] Fix Modified status for removal of overflow intrinsics

When removing an overflow intrinsic the Changed status in SimplifyIndvar
was not set, leading to the IndVarSimplify pass returning an incorrect
status.

This was caught using the check introduced by D80916.

As pointed out in the code review, a similar bug may exist for
eliminateTrunc().

Reviewed By: reames

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

4 years ago[msan] Fix llvm.abs.v intrinsic
Vitaly Buka [Tue, 29 Sep 2020 10:15:37 +0000 (03:15 -0700)]
[msan] Fix llvm.abs.v intrinsic

The last argument of the intrinsic is a boolean
flag to control INT_MIN handling and does
not affect msan metadata.

4 years ago[msan] Add test for vector abs intrinsic
Vitaly Buka [Tue, 29 Sep 2020 10:08:24 +0000 (03:08 -0700)]
[msan] Add test for vector abs intrinsic

4 years ago[OpenMPOpt][Fix] Only initialize ICV initial values once.
sstefan1 [Tue, 29 Sep 2020 09:51:36 +0000 (11:51 +0200)]
[OpenMPOpt][Fix] Only initialize ICV initial values once.

Reviewers: jdoerfert, ggeorgakoudis

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

4 years ago[InstCombine] Add trunc(lshr(sext(x),c)) non-uniform vector tests
Simon Pilgrim [Tue, 29 Sep 2020 09:56:00 +0000 (10:56 +0100)]
[InstCombine] Add trunc(lshr(sext(x),c)) non-uniform vector tests

4 years ago[LoopDeletion] Forget loop before setting values to undef
Florian Hahn [Tue, 29 Sep 2020 09:38:44 +0000 (10:38 +0100)]
[LoopDeletion] Forget loop before setting values to undef

After D71539, we need to forget the loop before setting the incoming
values of phi nodes in exit blocks, because we are looking through those
phi nodes now and the SCEV expression could depend on the loop phi. If
we update the phi nodes before forgetting the loop, we miss those users
during invalidation.

Reviewed By: reames

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

4 years ago[SCEV][NFC] Introduce isBasicBlockEntryGuardedByCond
Max Kazantsev [Tue, 29 Sep 2020 08:32:53 +0000 (15:32 +0700)]
[SCEV][NFC] Introduce isBasicBlockEntryGuardedByCond

Currently, we have `isLoopEntryGuardedByCond` method in SCEV, which
checks that some fact is true if we enter the loop. In fact, this is just a
particular case of more general concept `isBasicBlockEntryGuardedByCond`
applied to given loop's header. In fact, the logic if this code is largely
independent on the given loop and only cares code above it.

This patch makes this generalization. Now we can query it for any block,
and `isBasicBlockEntryGuardedByCond` is just a particular case.

Differential Revision: https://reviews.llvm.org/D87828
Reviewed By: fhahn

4 years agoRevert "OpaquePtr: Add type to sret attribute"
Tres Popp [Tue, 29 Sep 2020 08:24:54 +0000 (10:24 +0200)]
Revert "OpaquePtr: Add type to sret attribute"

This reverts commit 55c4ff91bd820d72014f63dcf7f3d5a0d3397986.

Issues were introduced as discussed in https://reviews.llvm.org/D88241
where this change made previous bugs in the linker and BitCodeWriter
visible.

4 years ago[IsKnownNonZero] Handle the case with non-constant phi nodes
Serguei Katkov [Thu, 24 Sep 2020 17:45:15 +0000 (00:45 +0700)]
[IsKnownNonZero] Handle the case with non-constant phi nodes

Handle the case when all inputs of phi are proven to be non zero.

Constants are checked in beginning of this method before check for depth of recursion,
so it is a partial case of non-constant phi.

Recursion depth is already handled by the function.

Reviewers: aqjune, nikic, efriedma
Reviewed By: nikic
Subscribers: dantrushin, hiraditya, jdoerfert, llvm-commits
Differential Revision: https://reviews.llvm.org/D88276

4 years agoRevert "Recommit "[SCCP] Do not replace deref'able ptr with un-deref'able one.""
Florian Hahn [Tue, 29 Sep 2020 08:18:19 +0000 (09:18 +0100)]
Revert "Recommit "[SCCP] Do not replace deref'able ptr with un-deref'able one.""

Looks like there is still another remaining issue:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/22273/steps/build%20libcxx%2Fmsan/logs/stdio

This reverts commit 86a20d9e34f5a9989da72097f23f3b0a44157e73.

4 years agoRecommit "[SCCP] Do not replace deref'able ptr with un-deref'able one."
Florian Hahn [Mon, 28 Sep 2020 15:08:30 +0000 (16:08 +0100)]
Recommit "[SCCP] Do not replace deref'able ptr with un-deref'able one."

This version includes an small fix allowing function pointers to be
unconditionally replaced for now.

This reverts commit 4c5e4aa89b11ec3253258b8df5125833773d1b1e.

4 years ago[NFC][ARM] Comments and lambdas
Sam Parker [Tue, 29 Sep 2020 07:41:53 +0000 (08:41 +0100)]
[NFC][ARM] Comments and lambdas

Add some comments in LowOverheadLoops and make some lambda variables
explicit arguments instead of capturing.

4 years agoThis reduces code duplication between CGObjCMac.cpp and Mangle.cpp
Ellis Hoag [Tue, 29 Sep 2020 06:25:24 +0000 (02:25 -0400)]
This reduces code duplication between CGObjCMac.cpp and Mangle.cpp
for generating the mangled name of an Objective-C method.

This has no intended functionality change.

https://reviews.llvm.org/D88329

4 years ago[Driver] Filter out <libdir>/gcc and <libdir>/gcc-cross if they do not exists
Dmitry Antipov [Tue, 29 Sep 2020 03:32:51 +0000 (06:32 +0300)]
[Driver] Filter out <libdir>/gcc and <libdir>/gcc-cross if they do not exists

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

4 years ago[X86] Add computeKnownBits support for PEXT.
Craig Topper [Tue, 29 Sep 2020 05:52:31 +0000 (22:52 -0700)]
[X86] Add computeKnownBits support for PEXT.

The number of zeros in the mask provides a lower bound on the number
of leading zeros in the result.

4 years ago[X86] Add known bits test for PEXT. NFC
Craig Topper [Tue, 29 Sep 2020 05:46:27 +0000 (22:46 -0700)]
[X86] Add known bits test for PEXT. NFC

4 years agoRevert "[OpenMP][FIX] Verify compatible types for declare variant calls"
Johannes Doerfert [Tue, 29 Sep 2020 05:36:45 +0000 (00:36 -0500)]
Revert "[OpenMP][FIX] Verify compatible types for declare variant calls"

This reverts commit c942095790decf525a445f3bd68fb9bcc9aa43c6.

One of the tests broke, revert to investigate.

4 years ago[Docs][NewPM] Add note about required passes
Arthur Eubanks [Fri, 25 Sep 2020 22:21:54 +0000 (15:21 -0700)]
[Docs][NewPM] Add note about required passes

Reviewed By: ychen

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

4 years ago[NFC] Use assert instead of checking the guaranteed condition
Max Kazantsev [Tue, 29 Sep 2020 04:37:17 +0000 (11:37 +0700)]
[NFC] Use assert instead of checking the guaranteed condition

From preconditions it is known that either A dominates B or
B dominates A. If A does not dominate B, we do not really need
to check it. Assert should be enough. Should save some compile
time.

4 years ago[IndVars] Remove exiting conditions that are trivially true/false
Max Kazantsev [Tue, 29 Sep 2020 04:34:15 +0000 (11:34 +0700)]
[IndVars] Remove exiting conditions that are trivially true/false

When removing exiting loop conditions, we only consider checks for
which we know the exact exit count. We could also eliminate checks for
which the condition is always true/false.

Differential Revision: https://reviews.llvm.org/D87344
Reviewed By: lebedev.ri, reames

4 years ago[OpenMP][FIX] Verify compatible types for declare variant calls
Johannes Doerfert [Sun, 27 Sep 2020 20:52:52 +0000 (15:52 -0500)]
[OpenMP][FIX] Verify compatible types for declare variant calls

Especially for templates we need to check at some point if the base
function matches the specialization we might call instead. Before this
lead to the replacement of `std::sqrt(int(2))` calls with one that
converts the argument to a `std::complex<int>`, clearly not the desired
behavior.

Reported as PR47655

Reviewed By: JonChesterfield

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

4 years ago[MLIR][OpenMP] Removed the ambiguity in flush op assembly syntax
Kiran Kumar T P [Tue, 29 Sep 2020 04:11:46 +0000 (09:41 +0530)]
[MLIR][OpenMP] Removed the ambiguity in flush op assembly syntax

Summary:
========
Bugzilla Ticket No: Bug 46884 [https://bugs.llvm.org/show_bug.cgi?id=46884]

Flush op assembly syntax was ambiguous:

Consider the below test case:
flush operation is not having any arguments.
But the next statement token i.e "%2" is read as the argument for flush operation and then translator issues an error.
***************************************************************
$ cat -n flush.mlir
     1  llvm.func @_QQmain(%arg0: !llvm.i32) {
     2    %0 = llvm.mlir.constant(1 : i64) : !llvm.i64
     3    %1 = llvm.alloca %0 x !llvm.i32 {in_type = i32, name = "a"} : (!llvm.i64) -> !llvm.ptr<i32>
     4    omp.flush
     5    %2 = llvm.load %1 : !llvm.ptr<i32>
     6    llvm.return
     7  }

$ mlir-translate -mlir-to-llvmir flush.mlir
flush.mlir:5:6: error: expected ':'
  %2 = llvm.load %1 : !llvm.ptr<i32>
     ^
***************************************************************

Solution:
=========
Introduced begin ( `(` ) and end token ( `)` ) to determince the begin and end of variadic arguments.

The patch includes code changes and testcase modifications.

Reviewed By: Valentin Clement, Mehdi AMINI

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

4 years agoBPF: explicitly specify bpfel triple for certain tests
Yonghong Song [Tue, 29 Sep 2020 03:15:05 +0000 (20:15 -0700)]
BPF: explicitly specify bpfel triple for certain tests

Commit 54d9f743c8b0 ("BPF: move AbstractMemberAccess and
PreserveDIType passes to EP_EarlyAsPossible") changed most
of CORE tests with opt run followed by llc and opt requires
the target triple specified in the IR.

There are few tests where little endian and big endian will
report different result and for little endian versions of
tests, "target triple = "bpf"" will produce wrong results
if the test executed in a big endian machine, e.g.
PowerPC big endian machine, since target "bpf" represents
host endian and will resolve to "bpfeb".
The builtbot reported such failures when build-and-run
on a PowerPC big endian machine.

To fix the issue, using "target triple = "bpfel"" instead.

4 years ago[HIP] Return non-zero value for invalid target ID
Yaxun (Sam) Liu [Sun, 27 Sep 2020 03:29:57 +0000 (23:29 -0400)]
[HIP] Return non-zero value for invalid target ID

This is part of https://reviews.llvm.org/D60620

4 years agoRecommit "[HIP] Change default --gpu-max-threads-per-block value to 1024"
Yaxun (Sam) Liu [Tue, 29 Sep 2020 02:39:21 +0000 (22:39 -0400)]
Recommit "[HIP] Change default --gpu-max-threads-per-block value to 1024"

Recommit 04abbb3a78186aa92809866b43217c32cba90b71

4 years ago[AArch64][GlobalISel] Scalarize <2 x s64> G_MUL since we don't have native support...
Amara Emerson [Mon, 28 Sep 2020 16:46:26 +0000 (09:46 -0700)]
[AArch64][GlobalISel] Scalarize <2 x s64> G_MUL since we don't have native support for it.

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

4 years agoSkip -fPIE for AMDGPU and HIP toolchain
Yaxun (Sam) Liu [Mon, 28 Sep 2020 16:07:06 +0000 (12:07 -0400)]
Skip -fPIE for AMDGPU and HIP toolchain

AMDGPU toolchain does not support -fPIE, therefore skip it if specified by driver.

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

4 years ago[mlir][openacc] Add acc.data operation verifier
Valentin Clement [Tue, 29 Sep 2020 01:22:07 +0000 (21:22 -0400)]
[mlir][openacc] Add acc.data operation verifier

Add a basic verifier for the data operation following the restriction from the standard.

Reviewed By: kiranchandramohan

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

4 years ago[clangd] When finding refs for a renaming alias, do not return refs to underlying...
Nathan Ridge [Mon, 7 Sep 2020 06:28:46 +0000 (02:28 -0400)]
[clangd] When finding refs for a renaming alias, do not return refs to underlying decls

Fixes https://github.com/clangd/clangd/issues/515

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

4 years agoRemove dependency from LLVM Dialect on the OpenMP dialect
Mehdi Amini [Mon, 28 Sep 2020 22:16:12 +0000 (22:16 +0000)]
Remove dependency from LLVM Dialect on the OpenMP dialect

The OmpDialect is in practice optional during translation to LLVM IR: the code is tolerant
to have a "nullptr" when not present / needed.

The dependency still exists on the export to LLVMIR.

Reviewed By: ftynse

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

4 years ago[gn build] Port 54d9f743c8b
LLVM GN Syncbot [Tue, 29 Sep 2020 00:24:06 +0000 (00:24 +0000)]
[gn build] Port 54d9f743c8b

4 years agoEnsure that we don't compute linkage for an anonymous class too early if
Richard Smith [Tue, 29 Sep 2020 00:21:42 +0000 (17:21 -0700)]
Ensure that we don't compute linkage for an anonymous class too early if
it has a member whose name is the same as a builtin.

Fixes a regression from the introduction of BuiltinAttr.

4 years ago[clang] Update warning-wall.c test
Jan Korous [Tue, 29 Sep 2020 00:19:31 +0000 (17:19 -0700)]
[clang] Update warning-wall.c test

Follow-up to 1e86d637eb4f:
[clang] Selectively ena/disa-ble format-insufficient-args warning

4 years ago[RegisterCoalescer] Pass Undefs to extendToIndices()
Ruiling Song [Tue, 15 Sep 2020 00:06:57 +0000 (08:06 +0800)]
[RegisterCoalescer] Pass Undefs to extendToIndices()

When extending the subranges, the reaching-def may be an undefs. When
extending such kind of subrange, it will try to search for the reaching
def first. If the reaching def is an undef and we did not provide 'Undefs',
The findReachingDefs() will fail with message:
"Use of $noreg does not have a corresponding definition on every path:
 LLVM ERROR: Use not jointly dominated by defs."
So we computeSubRangeUndefs() and pass the result to extendToIndices().

Reviewed By: arsenm

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

4 years agoBuildVectorType with a dependent (array) type is crashing the compiler - Fix for...
Zahira Ammarguellat [Mon, 28 Sep 2020 23:54:40 +0000 (16:54 -0700)]
BuildVectorType with a dependent (array) type is crashing the compiler  - Fix for PR-47542

Reviewed By: rnk

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

4 years agoBPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible
Yonghong Song [Thu, 3 Sep 2020 05:56:41 +0000 (22:56 -0700)]
BPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible

Move abstractMemberAccess and PreserveDIType passes as early as
possible, right after clang code generation.

Currently, compiler may transform the above code
  p1 = llvm.bpf.builtin.preserve.struct.access(base, 0, 0);
  p2 = llvm.bpf.builtin.preserve.struct.access(p1, 1, 2);
  a = llvm.bpf.builtin.preserve_field_info(p2, EXIST);
  if (a) {
    p1 = llvm.bpf.builtin.preserve.struct.access(base, 0, 0);
    p2 = llvm.bpf.builtin.preserve.struct.access(p1, 1, 2);
    bpf_probe_read(buf, buf_size, p2);
  }
to
  p1 = llvm.bpf.builtin.preserve.struct.access(base, 0, 0);
  p2 = llvm.bpf.builtin.preserve.struct.access(p1, 1, 2);
  a = llvm.bpf.builtin.preserve_field_info(p2, EXIST);
  if (a) {
    bpf_probe_read(buf, buf_size, p2);
  }
and eventually assembly code looks like
  reloc_exist = 1;
  reloc_member_offset = 10; //calculate member offset from base
  p2 = base + reloc_member_offset;
  if (reloc_exist) {
    bpf_probe_read(bpf, buf_size, p2);
  }
if during libbpf relocation resolution, reloc_exist is actually
resolved to 0 (not exist), reloc_member_offset relocation cannot
be resolved and will be patched with illegal instruction.
This will cause verifier failure.

This patch attempts to address this issue by do chaining
analysis and replace chains with special globals right
after clang code gen. This will remove the cse possibility
described in the above. The IR typically looks like
  %6 = load @llvm.sk_buff:0:50$0:0:0:2:0
  %7 = bitcast %struct.sk_buff* %2 to i8*
  %8 = getelementptr i8, i8* %7, %6
for a particular address computation relocation.

But this transformation has another consequence, code sinking
may happen like below:
  PHI = <possibly different @preserve_*_access_globals>
  %7 = bitcast %struct.sk_buff* %2 to i8*
  %8 = getelementptr i8, i8* %7, %6

For such cases, we will not able to generate relocations since
multiple relocations are merged into one.

This patch introduced a passthrough builtin
to prevent such optimization. Looks like inline assembly has more
impact for optimizaiton, e.g., inlining. Using passthrough has
less impact on optimizations.

A new IR pass is introduced at the beginning of target-dependent
IR optimization, which does:
  - report fatal error if any reloc global in PHI nodes
  - remove all bpf passthrough builtin functions

Changes for existing CORE tests:
  - for clang tests, add "-Xclang -disable-llvm-passes" flags to
    avoid builtin->reloc_global transformation so the test is still
    able to check correctness for clang generated IR.
  - for llvm CodeGen/BPF tests, add "opt -O2 <ir_file> | llvm-dis" command
    before "llc" command since "opt" is needed to call newly-placed
    builtin->reloc_global transformation. Add target triple in the IR
    file since "opt" requires it.
  - Since target triple is added in IR file, if a test may produce
    different results for different endianness, two tests will be
    created, one for bpfeb and another for bpfel, e.g., some tests
    for relocation of lshift/rshift of bitfields.
  - field-reloc-bitfield-1.ll has different relocations compared to
    old codes. This is because for the structure in the test,
    new code returns struct layout alignment 4 while old code
    is 8. Align 8 is more precise and permits double load. With align 4,
    the new mechanism uses 4-byte load, so generating different
    relocations.
  - test intrinsic-transforms.ll is removed. This is used to test
    cse on intrinsics so we do not lose metadata. Now metadata is attached
    to global and not instruction, it won't get lost with cse.

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

4 years ago[clang][driver][AIX] Set compiler-rt as default rtlib
David Tenty [Thu, 3 Sep 2020 22:34:57 +0000 (18:34 -0400)]
[clang][driver][AIX] Set compiler-rt as default rtlib

Reviewed By: hubert.reinterpretcast

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

4 years agoAttempt to clear some msan errors in the libcxx atomic tests.
ogiroux [Mon, 28 Sep 2020 23:34:41 +0000 (16:34 -0700)]
Attempt to clear some msan errors in the libcxx atomic tests.

4 years ago[mlir][Affine][VectorOps] Fix super vectorizer utility (D85869)
Diego Caballero [Mon, 28 Sep 2020 23:15:13 +0000 (16:15 -0700)]
[mlir][Affine][VectorOps] Fix super vectorizer utility (D85869)

Adding missing code that should have been part of "D85869: Utility to
vectorize loop nest using strategy."

Reviewed By: nicolasvasilache

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

4 years ago[scudo][standalone] Remove unused atomic_compare_exchange_weak
Kostya Kortchinsky [Mon, 28 Sep 2020 20:07:33 +0000 (13:07 -0700)]
[scudo][standalone] Remove unused atomic_compare_exchange_weak

`atomic_compare_exchange_weak` is unused in Scudo, and its associated
test is actually wrong since the weak variant is allowed to fail
spuriously (thanks Roland).

This lead to flakes such as:
```
[ RUN      ] ScudoAtomicTest.AtomicCompareExchangeTest
../../zircon/third_party/scudo/src/tests/atomic_test.cpp:98: Failure: Expected atomic_compare_exchange_weak(reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) is true.
    Expected: true
    Which is: 01
    Actual  : atomic_compare_exchange_weak(reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed)
    Which is: 00
../../zircon/third_party/scudo/src/tests/atomic_test.cpp:100: Failure: Expected atomic_compare_exchange_weak( reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) is false.
    Expected: false
    Which is: 00
    Actual  : atomic_compare_exchange_weak( reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed)
    Which is: 01
../../zircon/third_party/scudo/src/tests/atomic_test.cpp:101: Failure: Expected OldVal == NewVal.
    Expected: NewVal
    Which is: 24
    Actual  : OldVal
    Which is: 42
[  FAILED  ] ScudoAtomicTest.AtomicCompareExchangeTest (0 ms)
[----------] 2 tests from ScudoAtomicTest (1 ms total)
```

So I am removing this, if someone ever needs the weak variant, feel
free to add it back with a test that is not as terrible. This test was
initially ported from sanitizer_common, but their weak version calls
the strong version, so it works for them.

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

4 years ago[clang] Selectively ena/disa-ble format-insufficient-args warning
Jan Korous [Wed, 16 Sep 2020 16:52:51 +0000 (09:52 -0700)]
[clang] Selectively ena/disa-ble format-insufficient-args warning

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

4 years agoGuard `find_library(tensorflow_c_api ...)` by checking for TENSORFLOW_C_LIB_PATH...
Mehdi Amini [Mon, 28 Sep 2020 20:46:22 +0000 (20:46 +0000)]
Guard `find_library(tensorflow_c_api ...)` by checking for TENSORFLOW_C_LIB_PATH to be set by the user

Also have CMake fails if the user provides a TENSORFLOW_C_LIB_PATH but
we can't find TensorFlow at this path.

At the moment the CMake script tries to figure if TensorFlow is
available on the system and enables support for it. This is in general
not desirable to customize build features this way and instead it is
preferable to let the user opt-in explicitly into the features they want
to enable. This is in line with other optional external dependencies
like Z3.
There are a few reasons to this but amongst others:
- reproducibility: making features "magically" enabled based on whether
  we find a package on the system or not makes it harder to handle bug
  reports from users.
- user control: they can't have TensorFlow on the system and build LLVM
  without TensorFlow right now. They also would suddenly distribute LLVM
  with a different set of features unknowingly just because their build
  machine environment would change subtly.

Right now this is motivated by a user reporting build failures on their system:

.../mesa-git/llvm-git/src/llvm-project/llvm/lib/Analysis/TFUtils.cpp:23:10: fatal error: tensorflow/c/c_api.h: No such file or directory
   23 | #include "tensorflow/c/c_api.h"
      |          ^~~~~~

It looks like we detected TensorFlow at configure time but couldn't set all the paths correctly.

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