Commit Graph

328184 Commits

Author SHA1 Message Date
Matt Arsenault fdea5e02ce AMDGPU/GlobalISel: Select s1 src G_SITOFP/G_UITOFP
llvm-svn: 373298
2019-10-01 02:23:20 +00:00
Yuanfang Chen b169ee2eca Remove a undefined constructor introduced by r373244.
llvm-svn: 373297
2019-10-01 02:08:14 +00:00
Matt Arsenault 59b91aa93e AMDGPU/GlobalISel: Add support for init.exec intrinsics
TThe existing wave32 behavior seems broken and incomplete, but this
reproduces it.

llvm-svn: 373296
2019-10-01 02:07:25 +00:00
Matt Arsenault 5823a28270 AMDGPU/GlobalISel: Allow scc/vcc alternative mappings for s1 constants
llvm-svn: 373295
2019-10-01 02:07:19 +00:00
Matt Arsenault bdcc6d3d26 GlobalISel: Handle llvm.read_register
SelectionDAG has a bunch of machinery to defer this to selection time
for some reason. Just directly emit a copy during IRTranslator. The
x86 usage does somewhat questionably check hasFP, which could depend
on the whole function being at minimum translated.

This does lose the convergent bit if the callsite had it, which may be
a problem. We also lose that in general for intrinsics, which may also
be a problem.

llvm-svn: 373294
2019-10-01 02:07:16 +00:00
Matt Arsenault 8f6bdb7668 AMDGPU/GlobalISel: Avoid creating shift of 0 in arg lowering
This is sort of papering over the fact that we don't run a combiner
anywhere, but avoiding creating 2 instructions in the first place is
easy.

llvm-svn: 373293
2019-10-01 01:44:46 +00:00
Matt Arsenault f24ac13aaa TLI: Remove DAG argument from getRegisterByName
Replace with the MachineFunction. X86 is the only user, and only uses
it for the function. This removes one obstacle from using this in
GlobalISel. The other is the more tolerable EVT argument.

The X86 use of the function seems questionable to me. It checks hasFP,
before frame lowering.

llvm-svn: 373292
2019-10-01 01:44:39 +00:00
Fangrui Song 2d92c8844e [llvm-readobj/llvm-readelf] Delete --arm-attributes (alias for --arch-specific)
D68110 added --arch-specific (supported by GNU readelf) and made
--arm-attributes an alias for it. The tests were later migrated to use
--arch-specific.

Note, llvm-readelf --arch-specific currently just uses llvm-readobj
style output for ARM attributes. The readelf-style output is not
implemented.

Reviewed By: compnerd, kongyi, rupprecht

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

llvm-svn: 373291
2019-10-01 01:31:15 +00:00
Craig Topper 5dc49a8374 [X86] Add test case to show missed opportunity to shrink a constant index to a gather in order to avoid splitting.
Also add a test case for an index that could be shrunk, but
would create a narrow type. We can go ahead and do it we just
need to be before type legalization.

Similar test cases for scatter as well.

llvm-svn: 373290
2019-10-01 01:27:52 +00:00
Richard Smith 8ac5c746fc Don't elide the use of the thread wrapper for a thread_local constinit
variable with non-trivial destruction.

We still need to invoke the thread wrapper to trigger registration of
the destructor call on thread shutdown.

llvm-svn: 373289
2019-10-01 01:23:23 +00:00
Matt Arsenault 54167ea316 AMDGPU/GlobalISel: Select G_UADDO/G_USUBO
llvm-svn: 373288
2019-10-01 01:23:13 +00:00
Matt Arsenault ed85b0cee6 GlobalISel: Implement widenScalar for G_SITOFP/G_UITOFP sources
Legalize 16-bit G_SITOFP/G_UITOFP for AMDGPU.

llvm-svn: 373287
2019-10-01 01:06:48 +00:00
Matt Arsenault 77ac400117 AMDGPU/GlobalISel: Legalize G_GLOBAL_VALUE
Handle other cases besides LDS. Mostly a straight port of the existing
handling, without the intermediate custom nodes.

llvm-svn: 373286
2019-10-01 01:06:43 +00:00
Lawrence D'Anna 4d536bfbea File::Clear() -> File::TakeStreamAndClear()
Summary:
File::Clear() is an ugly function.  It's only used in one place,
which is the swig typemaps for FILE*.   This patch refactors and
renames that function to make it clear what it's really for and
why nobody else should use it.

Both File::TakeStreamAndClear() and the FILE* typemaps will be
removed in later patches after a suitable replacement is in place.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 373285
2019-10-01 01:05:02 +00:00
Vitaly Buka 7a6461fcc2 compiler-rt: use __GLIBC_PREREQ for SANITIZER_INTERCEPT_GETRANDOM
Summary: Fixes https://github.com/google/oss-fuzz/issues/2836

Reviewers: eugenis

Subscribers: dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373284
2019-10-01 00:58:29 +00:00
Vitaly Buka 2d75ee9373 compiler-rt: move all __GLIBC_PREREQ into own header file
Reviewers: eugenis

Subscribers: dberris, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373283
2019-10-01 00:58:28 +00:00
Vitaly Buka f74f5f2568 Rename tsan_interceptors.cpp into tsan_interceptors_posix.cpp
Summary:
It's needed to use __GLIBC_PREREQ from <features.h>

tsan didn't let us to include <features.h> by using --sysroot=. to disable system includes on
anything that is not named as "tsan*posix*", "tsan*mac*", "tsan*linux*".
See compiler-rt/lib/tsan/CMakeLists.txt

Reviewers: eugenis, dvyukov, kcc

Reviewed By: kcc

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373282
2019-10-01 00:58:26 +00:00
Richard Smith 9f42a1231e [c++20] Add a C++20 version of the existing turing machine test.
Unlike the C++11 version, this one uese mutable state and dynamic
allocation instead of a carefully balanced and ever-accumulating pile of
temporaries.

llvm-svn: 373281
2019-10-01 00:47:41 +00:00
Jim Ingham 58c3235ee9 Allow the internal-state-thread free access to the TargetAPI mutex.
It is always doing work on behalf of another thread that presumably
has the mutex, so if it is calling SB API's it should have free access
to the mutex.  This is the same decision as we made earlier with the
process RunLock.

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

llvm-svn: 373280
2019-10-01 00:47:25 +00:00
Richard Smith 3b69bcc363 During constant evaluation, handle CXXBindTemporaryExprs for
array-of-class types, not just for class types.

llvm-svn: 373279
2019-10-01 00:41:16 +00:00
David Blaikie 5ca306666c DebugInfo: Add parsing support for debug_loc base address specifiers
llvm-svn: 373278
2019-10-01 00:29:13 +00:00
Jonas Devlieghere d0727ec211 [Docs] Document lldb-instr
This adds some information on how to instrument the API classes.

llvm-svn: 373277
2019-10-01 00:12:47 +00:00
Richard Smith 9a84dc0b36 [c++20] Fix crash when constant-evaluating an assignment with a
reference member access on its left-hand side.

llvm-svn: 373276
2019-10-01 00:07:14 +00:00
Tom Stellard f18d747107 Fix Driver/modules.cpp test to work when build directory name contains '.s'
Reviewers: dyung, rsmith, hansw

Subscribers: mati865, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 373275
2019-09-30 23:42:17 +00:00
Evandro Menezes 41ead4281f [SimplifyLibCalls] Define the value of the Euler number
This patch fixes the build break on Windows hosts.

There must be a better way of accessing the equivalent POSIX math constant
`M_E`.

llvm-svn: 373274
2019-09-30 23:21:02 +00:00
David Blaikie 38456776b3 DebugInfo: Simplify section label caching/usage
llvm-svn: 373273
2019-09-30 23:19:10 +00:00
Richard Smith 63e8a0f55f Fix crash on value-dependent delete-expressions.
We used to miscompute the 'value-dependent' bit, and would crash if we
tried to evaluate a delete expression that should be value-dependent.

llvm-svn: 373272
2019-09-30 22:55:27 +00:00
Amaury Sechet d60c297d1d Add partial bswap test to the X86 backend. NFC
llvm-svn: 373271
2019-09-30 22:52:28 +00:00
Amaury Sechet e6f98c0073 [DAGCombiner] Clang format MatchRotate. NFC
llvm-svn: 373269
2019-09-30 21:41:52 +00:00
Erich Keane 98f0899942 Make function static that didn't need linkage.
In r373247 I added a helper function, but neglected to make it static.

llvm-svn: 373268
2019-09-30 21:24:04 +00:00
Vedant Kumar c03c2e886e [StackFrameList][DFS] Turn a few raw pointers into references, NFC
llvm-svn: 373267
2019-09-30 21:20:14 +00:00
David Blaikie d072cd059d Remove else-after-return
llvm-svn: 373266
2019-09-30 21:02:06 +00:00
Florian Hahn f341f8015b [bugpoint] Update runPasses to take ArrayRef instead of a pointer (NFC)
This makes it slightly easier to pass extra arguments to runPasses
and simplifies the code slightly.

Reviewers: efriedma, bogner, dblaikie, diegotf, hiraditya

Reviewed By: dblaikie, hiraditya

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

llvm-svn: 373265
2019-09-30 21:00:50 +00:00
Daniel Sanders cbe13a1461 [globalisel][knownbits] Allow targets to call GISelKnownBits::computeKnownBitsImpl()
Summary:
It seems we missed that the target hook can't query the known-bits for the
inputs to a target instruction. Fix that oversight

Reviewers: aditya_nandakumar

Subscribers: rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 373264
2019-09-30 20:55:53 +00:00
Eric Fiselier c8ad8686ac Refactor default constructor SFINAE in pair and tuple.
Refactor the  recent implicit default constructor changes to match the
existing SFINAE style.

llvm-svn: 373263
2019-09-30 20:55:30 +00:00
Evandro Menezes 22cb3d2e58 [ConstantFolding] Fold constant calls to log2()
Somehow, folding calls to `log2()` with a constant was missing.

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

llvm-svn: 373262
2019-09-30 20:53:23 +00:00
Evandro Menezes 110b1138ba [InstCombine] Expand the simplification of log()
Expand the simplification of special cases of `log()` to include `log2()`
and `log10()` as well as intrinsics and more types.

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

llvm-svn: 373261
2019-09-30 20:52:21 +00:00
Amaury Sechet 496c0564f1 [DAGCombiner] Update MatchRotate so that it returns an SDValue. NFC
llvm-svn: 373260
2019-09-30 20:47:23 +00:00
Erich Keane a60ef724b4 Fix failure caused by r373247
I incorrectly thought that the 'isLambda' check never fired, so when
splitting up a helper function, I lost the 'nullptr' return value.
ClangD Hover functionality apparently uses this, so the Unittest caught
that.

This patch correctly propogates the nullptr from the helper function.

llvm-svn: 373259
2019-09-30 20:45:12 +00:00
David Bolvansky 24703284ea [NFC] Fix tests, second try
llvm-svn: 373258
2019-09-30 20:41:56 +00:00
Alexey Bataev 6db441930d [OPENMP50]Mark declare variant attribute as inheritable.
Attribute must be inherited by the redeclarations.

llvm-svn: 373257
2019-09-30 20:39:29 +00:00
David Bolvansky d2697e8388 [NFCI] Updated broken test
llvm-svn: 373256
2019-09-30 20:23:22 +00:00
Peter Collingbourne 97e251e05a ELF: Don't merge SHF_LINK_ORDER sections for different output sections in relocatable links.
Merging SHF_LINK_ORDER sections can affect semantics if the sh_link
fields point to different sections.

Specifically, for SHF_LINK_ORDER sections, the sh_link field acts as a reverse
dependency from the linked section, causing the SHF_LINK_ORDER section to
be included if the linked section is included. Merging sections with different
sh_link fields will cause the entire contents of the SHF_LINK_ORDER section
to be associated with a single (arbitrarily chosen) output section, whereas the
correct semantics are for the individual pieces of the SHF_LINK_ORDER section
to be associated with their linked output sections. As a result we can end up
incorrectly dropping SHF_LINK_ORDER section contents or including the wrong
section contents, depending on which linked sections were chosen.

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

llvm-svn: 373255
2019-09-30 20:23:00 +00:00
Alina Sbirlea 0fa07f4276 [LegacyPassManager] Deprecate the BasicBlockPass/Manager.
Summary:
The BasicBlockManager is potentially broken and should not be used.
Replace all uses of the BasicBlockPass with a FunctionBlockPass+loop on
blocks.

Reviewers: chandlerc

Subscribers: jholewinski, sanjoy.google, llvm-commits

Tags: #llvm

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

llvm-svn: 373254
2019-09-30 20:17:23 +00:00
Saleem Abdulrasool 9567940904 build: serialise `LLVM_ENABLE_UNWIND_TABLES` into LLVMConfig
Serialize the value of the configuration option into the configuration so that
builds which integrate LLVM can identify the value of the flag that was used to
build the libraries.  This is intended to be used by Swift to control tests
which rely on the unwind information.

llvm-svn: 373253
2019-09-30 20:03:59 +00:00
David Bolvansky 471910d754 [Diagnostics] Warn if enumeration type mismatch in conditional expression
Summary:
- Useful warning
- GCC compatibility (GCC warns in C++ mode)

Reviewers: rsmith, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373252
2019-09-30 19:55:50 +00:00
David Bolvansky a05e671c7e [FunctionAttrs] Added noalias for memccpy/mempcpy arguments
llvm-svn: 373251
2019-09-30 19:43:48 +00:00
Adrian Prantl b0ccef143a Try to update Windows unit test for API change.
llvm-svn: 373250
2019-09-30 19:38:52 +00:00
Roman Lebedev faa90eca63 [InstCombine][NFC] visitShl(): call SimplifyQuery::getWithInstruction() once
llvm-svn: 373249
2019-09-30 19:16:00 +00:00
Roman Lebedev 0205be8f12 [NFC][InstCombine] Redundant-left-shift-input-masking: add some more undef tests
llvm-svn: 373248
2019-09-30 19:15:51 +00:00