platform/upstream/llvm.git
4 years ago[c++20] Fix crash when constant-evaluating an assignment with a
Richard Smith [Tue, 1 Oct 2019 00:07:14 +0000 (00:07 +0000)]
[c++20] Fix crash when constant-evaluating an assignment with a
reference member access on its left-hand side.

llvm-svn: 373276

4 years agoFix Driver/modules.cpp test to work when build directory name contains '.s'
Tom Stellard [Mon, 30 Sep 2019 23:42:17 +0000 (23:42 +0000)]
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

4 years ago[SimplifyLibCalls] Define the value of the Euler number
Evandro Menezes [Mon, 30 Sep 2019 23:21:02 +0000 (23:21 +0000)]
[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

4 years agoDebugInfo: Simplify section label caching/usage
David Blaikie [Mon, 30 Sep 2019 23:19:10 +0000 (23:19 +0000)]
DebugInfo: Simplify section label caching/usage

llvm-svn: 373273

4 years agoFix crash on value-dependent delete-expressions.
Richard Smith [Mon, 30 Sep 2019 22:55:27 +0000 (22:55 +0000)]
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

4 years agoAdd partial bswap test to the X86 backend. NFC
Amaury Sechet [Mon, 30 Sep 2019 22:52:28 +0000 (22:52 +0000)]
Add partial bswap test to the X86 backend. NFC

llvm-svn: 373271

4 years ago[DAGCombiner] Clang format MatchRotate. NFC
Amaury Sechet [Mon, 30 Sep 2019 21:41:52 +0000 (21:41 +0000)]
[DAGCombiner] Clang format MatchRotate. NFC

llvm-svn: 373269

4 years agoMake function static that didn't need linkage.
Erich Keane [Mon, 30 Sep 2019 21:24:04 +0000 (21:24 +0000)]
Make function static that didn't need linkage.

In r373247 I added a helper function, but neglected to make it static.

llvm-svn: 373268

4 years ago[StackFrameList][DFS] Turn a few raw pointers into references, NFC
Vedant Kumar [Mon, 30 Sep 2019 21:20:14 +0000 (21:20 +0000)]
[StackFrameList][DFS] Turn a few raw pointers into references, NFC

llvm-svn: 373267

4 years agoRemove else-after-return
David Blaikie [Mon, 30 Sep 2019 21:02:06 +0000 (21:02 +0000)]
Remove else-after-return

llvm-svn: 373266

4 years ago[bugpoint] Update runPasses to take ArrayRef instead of a pointer (NFC)
Florian Hahn [Mon, 30 Sep 2019 21:00:50 +0000 (21:00 +0000)]
[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

4 years ago[globalisel][knownbits] Allow targets to call GISelKnownBits::computeKnownBitsImpl()
Daniel Sanders [Mon, 30 Sep 2019 20:55:53 +0000 (20:55 +0000)]
[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

4 years agoRefactor default constructor SFINAE in pair and tuple.
Eric Fiselier [Mon, 30 Sep 2019 20:55:30 +0000 (20:55 +0000)]
Refactor default constructor SFINAE in pair and tuple.

Refactor the  recent implicit default constructor changes to match the
existing SFINAE style.

llvm-svn: 373263

4 years ago[ConstantFolding] Fold constant calls to log2()
Evandro Menezes [Mon, 30 Sep 2019 20:53:23 +0000 (20:53 +0000)]
[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

4 years ago[InstCombine] Expand the simplification of log()
Evandro Menezes [Mon, 30 Sep 2019 20:52:21 +0000 (20:52 +0000)]
[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

4 years ago[DAGCombiner] Update MatchRotate so that it returns an SDValue. NFC
Amaury Sechet [Mon, 30 Sep 2019 20:47:23 +0000 (20:47 +0000)]
[DAGCombiner] Update MatchRotate so that it returns an SDValue. NFC

llvm-svn: 373260

4 years agoFix failure caused by r373247
Erich Keane [Mon, 30 Sep 2019 20:45:12 +0000 (20:45 +0000)]
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

4 years ago[NFC] Fix tests, second try
David Bolvansky [Mon, 30 Sep 2019 20:41:56 +0000 (20:41 +0000)]
[NFC] Fix tests, second try

llvm-svn: 373258

4 years ago[OPENMP50]Mark declare variant attribute as inheritable.
Alexey Bataev [Mon, 30 Sep 2019 20:39:29 +0000 (20:39 +0000)]
[OPENMP50]Mark declare variant attribute as inheritable.

Attribute must be inherited by the redeclarations.

llvm-svn: 373257

4 years ago[NFCI] Updated broken test
David Bolvansky [Mon, 30 Sep 2019 20:23:22 +0000 (20:23 +0000)]
[NFCI] Updated broken test

llvm-svn: 373256

4 years agoELF: Don't merge SHF_LINK_ORDER sections for different output sections in relocatable...
Peter Collingbourne [Mon, 30 Sep 2019 20:23:00 +0000 (20:23 +0000)]
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

4 years ago[LegacyPassManager] Deprecate the BasicBlockPass/Manager.
Alina Sbirlea [Mon, 30 Sep 2019 20:17:23 +0000 (20:17 +0000)]
[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

4 years agobuild: serialise `LLVM_ENABLE_UNWIND_TABLES` into LLVMConfig
Saleem Abdulrasool [Mon, 30 Sep 2019 20:03:59 +0000 (20:03 +0000)]
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

4 years ago[Diagnostics] Warn if enumeration type mismatch in conditional expression
David Bolvansky [Mon, 30 Sep 2019 19:55:50 +0000 (19:55 +0000)]
[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

4 years ago[FunctionAttrs] Added noalias for memccpy/mempcpy arguments
David Bolvansky [Mon, 30 Sep 2019 19:43:48 +0000 (19:43 +0000)]
[FunctionAttrs] Added noalias for memccpy/mempcpy arguments

llvm-svn: 373251

4 years agoTry to update Windows unit test for API change.
Adrian Prantl [Mon, 30 Sep 2019 19:38:52 +0000 (19:38 +0000)]
Try to update Windows unit test for API change.

llvm-svn: 373250

4 years ago[InstCombine][NFC] visitShl(): call SimplifyQuery::getWithInstruction() once
Roman Lebedev [Mon, 30 Sep 2019 19:16:00 +0000 (19:16 +0000)]
[InstCombine][NFC] visitShl(): call SimplifyQuery::getWithInstruction() once

llvm-svn: 373249

4 years ago[NFC][InstCombine] Redundant-left-shift-input-masking: add some more undef tests
Roman Lebedev [Mon, 30 Sep 2019 19:15:51 +0000 (19:15 +0000)]
[NFC][InstCombine] Redundant-left-shift-input-masking: add some more undef tests

llvm-svn: 373248

4 years agoTeach CallGraph to look into Generic Lambdas.
Erich Keane [Mon, 30 Sep 2019 19:12:29 +0000 (19:12 +0000)]
Teach CallGraph to look into Generic Lambdas.

CallGraph visited LambdaExpr by getting the Call Operator from
CXXRecordDecl (LambdaExpr::getCallOperator calls
CXXRecordDecl::getLambdaCallOperator), which replaced generic lambda
call operators with the non-instantiated FunctionDecl.  The result was
that the CallGraph would only pick up non-dependent calls.

This patch does a few things:
1- Extend CXXRecordDecl to have a getDependentLambdaCallOperator, which
will get the FunctionTemplateDecl, rather than immediately getting the
TemplateDecl.
2- Define getLambdaCallOperator and getDependentLambdaCallOperator in
terms of a common function.
3- Extend LambdaExpr with a getDependentCallOperator, which just calls
the above function.
4- Changes CallGraph to handle Generic LambdaExprs.

llvm-svn: 373247

4 years ago[X86] Mask off upper bits of splat element in LowerBUILD_VECTORvXi1 when forming...
Craig Topper [Mon, 30 Sep 2019 18:43:44 +0000 (18:43 +0000)]
[X86] Mask off upper bits of splat element in LowerBUILD_VECTORvXi1 when forming a SELECT.

The i1 scalar would have been type legalized to i8, but that
doesn't guarantee anything about the upper bits. If we're going
to use it as condition we need to make sure the upper bits are 0.

I've special cased ISD::SETCC conditions since that should
guarantee zero upper bits. We could go further and use
computeKnownBits, but we have no tests that would need that.

Fixes PR43507.

llvm-svn: 373246

4 years ago[X86] Address post-commit review from code I accidentally commited in r373136.
Craig Topper [Mon, 30 Sep 2019 18:43:27 +0000 (18:43 +0000)]
[X86] Address post-commit review from code I accidentally commited in r373136.

See https://reviews.llvm.org/D68167

llvm-svn: 373245

4 years agoFix build warning for r373240.
Yuanfang Chen [Mon, 30 Sep 2019 18:32:38 +0000 (18:32 +0000)]
Fix build warning for r373240.

llvm-svn: 373244

4 years ago[OPENMP50]Do not emit warning for the function with the currently
Alexey Bataev [Mon, 30 Sep 2019 18:24:35 +0000 (18:24 +0000)]
[OPENMP50]Do not emit warning for the function with the currently
defined body.

If the function is currently defined, we should not emit a warning that
it might be emitted already because it was not really emitted.

llvm-svn: 373243

4 years agoRevert "[MC] Emit unused undefined symbol even if its binding is not set"
Nico Weber [Mon, 30 Sep 2019 18:13:48 +0000 (18:13 +0000)]
Revert "[MC] Emit unused undefined symbol even if its binding is not set"

This reverts r373168. It caused PR43511.

llvm-svn: 373242

4 years ago[PGO] Don't group COMDAT variables for compiler generated profile variables in ELF
Rong Xu [Mon, 30 Sep 2019 18:11:22 +0000 (18:11 +0000)]
[PGO] Don't group COMDAT variables for compiler generated profile variables in ELF

With this patch, compiler generated profile variables will have its own COMDAT
name for ELF format, which syncs the behavior with COFF. Tested with clang
PGO bootstrap. This shows a modest reduction in object sizes in ELF format.

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

llvm-svn: 373241

4 years ago[NewPM] Port MachineModuleInfo to the new pass manager.
Yuanfang Chen [Mon, 30 Sep 2019 17:54:50 +0000 (17:54 +0000)]
[NewPM] Port MachineModuleInfo to the new pass manager.

Existing clients are converted to use MachineModuleInfoWrapperPass. The
new interface is for defining a new pass manager API in CodeGen.

Reviewers: fedor.sergeev, philip.pfaffe, chandlerc, arsenm

Reviewed By: arsenm, fedor.sergeev

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

llvm-svn: 373240

4 years ago[msan] Intercept __getrlimit.
Evgeniy Stepanov [Mon, 30 Sep 2019 17:49:48 +0000 (17:49 +0000)]
[msan] Intercept __getrlimit.

Summary:
This interceptor is useful on its own, but the main purpose of this
change is to intercept libpthread initialization on linux/glibc in
order to run __msan_init before any .preinit_array constructors.

We used to trigger on pthread_initialize_minimal -> getrlimit(), but
that call has changed to __getrlimit at some point.

Reviewers: vitalybuka, pcc

Subscribers: jfb, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373239

4 years agoFix buildbot failure from r373217 (don't match metadata id exactly)
Teresa Johnson [Mon, 30 Sep 2019 17:26:48 +0000 (17:26 +0000)]
Fix buildbot failure from r373217 (don't match metadata id exactly)

Fix this failure by ignoring the id of the metadata being checked:
    http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/3046/consoleFull#-21332887158254eaf0-7326-4999-85b0-388101f2d404

llvm-svn: 373237

4 years ago[MCA] Use references to LSUnitBase in class Scheduler and add helper methods to acqui...
Andrea Di Biagio [Mon, 30 Sep 2019 17:24:25 +0000 (17:24 +0000)]
[MCA] Use references to LSUnitBase in class Scheduler and add helper methods to acquire/release LS queue entries. NFCI

llvm-svn: 373236

4 years ago[LegacyPassManager] Attempt to fix BasicBlockManager
Alina Sbirlea [Mon, 30 Sep 2019 17:23:49 +0000 (17:23 +0000)]
[LegacyPassManager] Attempt to fix BasicBlockManager

Temporarily fix BaiscBlockManager based on the code in the other
managers.
Replacement of all uses of the BasicBlockPass to follow.

Resolves PR42264.

llvm-svn: 373235

4 years ago[X86] Add ANY_EXTEND to switch in ReplaceNodeResults, but just fall back to default...
Craig Topper [Mon, 30 Sep 2019 17:14:22 +0000 (17:14 +0000)]
[X86] Add ANY_EXTEND to switch in ReplaceNodeResults, but just fall back to default handling.

ANY_EXTEND of v8i8 is marked Custom on AVX512 for handling extends
from v8i8. But the type legalization infrastructure will call
ReplaceNodeResults for v8i8 results. We should just defer it the
default handling instead of asserting in the default of the switch.

Fixes PR43509.

llvm-svn: 373234

4 years ago[test] Make TestBasicEntryValuesX86_64 run on Linux as well as Darwin
Vedant Kumar [Mon, 30 Sep 2019 17:11:46 +0000 (17:11 +0000)]
[test] Make TestBasicEntryValuesX86_64 run on Linux as well as Darwin

I think a reasonable plan here is to add support for OSes following the
SysV ABI one by one, watching the bots as we go.

llvm-svn: 373233

4 years ago[AArch64][SVE] Implement punpk[hi|lo] intrinsics
Kerry McLaughlin [Mon, 30 Sep 2019 17:10:21 +0000 (17:10 +0000)]
[AArch64][SVE] Implement punpk[hi|lo] intrinsics

Summary:
Adds the following two intrinsics:
  - int_aarch64_sve_punpkhi
  - int_aarch64_sve_punpklo

This patch also contains a fix which allows LLVMHalfElementsVectorType
to forward reference overloadable arguments.

Reviewers: sdesmalen, rovka, rengolin

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, greened, cfe-commits, llvm-commits

Tags: #llvm

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

llvm-svn: 373232

4 years ago[EarlyCSE] Pass preserves AA.
Alina Sbirlea [Mon, 30 Sep 2019 17:08:40 +0000 (17:08 +0000)]
[EarlyCSE] Pass preserves AA.

llvm-svn: 373231

4 years ago[InstCombine] fold negate disguised as select+mul
Sanjay Patel [Mon, 30 Sep 2019 17:02:26 +0000 (17:02 +0000)]
[InstCombine] fold negate disguised as select+mul

  Name: negate if true
  %sel = select i1 %cond, i32 -1, i32 1
  %r = mul i32 %sel, %x
  =>
  %m = sub i32 0, %x
  %r = select i1 %cond, i32 %m, i32 %x

  Name: negate if false
  %sel = select i1 %cond, i32 1, i32 -1
  %r = mul i32 %sel, %x
  =>
  %m = sub i32 0, %x
  %r = select i1 %cond, i32 %x, i32 %m

https://rise4fun.com/Alive/Nlh

llvm-svn: 373230

4 years ago[lldb][NFC] Updating test to reflect made by D67966
Shafik Yaghmour [Mon, 30 Sep 2019 16:57:35 +0000 (16:57 +0000)]
[lldb][NFC] Updating test to reflect made by D67966

Summary:
D67966 changes the output when dumping DWARF expressions and this updates basic_entry_values_x86_64 test to reflect this change.

llvm-svn: 373229

4 years agoFix doc for t inline asm constraints for ARM/Thumb
Pablo Barrio [Mon, 30 Sep 2019 16:55:10 +0000 (16:55 +0000)]
Fix doc for t inline asm constraints for ARM/Thumb

Summary: The constraint goes up to regs d15 and q7, not d16 and q8.

Subscribers: kristof.beyls, llvm-commits

Tags: #llvm

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

llvm-svn: 373228

4 years ago[AArch64][GlobalISel] Support lowering variadic musttail calls
Jessica Paquette [Mon, 30 Sep 2019 16:49:13 +0000 (16:49 +0000)]
[AArch64][GlobalISel] Support lowering variadic musttail calls

This adds support for lowering variadic musttail calls. To do this, we have
to...

- Detect a musttail call in a variadic function before attempting to lower the
  call's formal arguments. This is done in the IRTranslator.
- Compute forwarded registers in `lowerFormalArguments`, and add copies for
  those registers.
- Restore the forwarded registers in `lowerTailCall`.

Because there doesn't seem to be any nice way to wrap these up into the outgoing
argument handler, the restore code in `lowerTailCall` is done separately.

Also, irritatingly, you have to make sure that the registers don't overlap with
any passed parameters. Otherwise, the scheduler doesn't know what to do with the
extra copies and asserts.

Add call-translator-variadic-musttail.ll to test this. This is pretty much the
same as the X86 musttail-varargs.ll test. We didn't have as nice of a test to
base this off of, but the idea is the same.

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

llvm-svn: 373226

4 years ago[mips] Fix code indentation. NFC
Simon Atanasyan [Mon, 30 Sep 2019 16:47:21 +0000 (16:47 +0000)]
[mips] Fix code indentation. NFC

llvm-svn: 373225

4 years agoRemove unused "append" parameter from FindTypes API
Adrian Prantl [Mon, 30 Sep 2019 16:42:28 +0000 (16:42 +0000)]
Remove unused "append" parameter from FindTypes API

I noticed that SymbolFileDWARFDebugMap::FindTypes was implementing it
incorrectly (passing append=false in a for-loop to recursive calls to
FindTypes would yield only the very last set of results), but instead
of fixing it, removing it seemed like an even better option.

rdar://problem/54412692

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

llvm-svn: 373224

4 years agoAdd tests for rotate with demanded bits. NFC
Amaury Sechet [Mon, 30 Sep 2019 16:26:09 +0000 (16:26 +0000)]
Add tests for rotate with demanded bits. NFC

llvm-svn: 373223

4 years ago[InstCombine] add tests for negate disguised as mul; NFC
Sanjay Patel [Mon, 30 Sep 2019 15:43:27 +0000 (15:43 +0000)]
[InstCombine] add tests for negate disguised as mul; NFC

llvm-svn: 373222

4 years ago [AMDGPU] SIFoldOperands should not fold register acrocc the EXEC definition
Alexander Timofeev [Mon, 30 Sep 2019 15:31:17 +0000 (15:31 +0000)]
   [AMDGPU] SIFoldOperands should not fold register acrocc the EXEC definition

      Reviewers: rampitec

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

llvm-svn: 373221

4 years ago[SSP] [3/3] cmpxchg and addrspacecast instructions can now
Paul Robinson [Mon, 30 Sep 2019 15:11:23 +0000 (15:11 +0000)]
[SSP] [3/3] cmpxchg and addrspacecast instructions can now
trigger stack protectors.  Fixes PR42238.

Add test coverage for llvm.memset, as proxy for all llvm.mem*
intrinsics. There are two issues here: (1) they could be lowered to a
libc call, which could be intercepted, and do Bad Stuff; (2) with a
non-constant size, they could overwrite the current stack frame.

The test was mostly written by Matt Arsenault in r363169, which was
later reverted; I tweaked what he had and added the llvm.memset part.

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

llvm-svn: 373220

4 years ago[SSP] [2/3] Refactor an if/dyn_cast chain to switch on opcode. NFC
Paul Robinson [Mon, 30 Sep 2019 15:08:38 +0000 (15:08 +0000)]
[SSP] [2/3] Refactor an if/dyn_cast chain to switch on opcode. NFC

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

llvm-svn: 373219

4 years ago[Clang] Use -main-file-name for source filename if not set
Teresa Johnson [Mon, 30 Sep 2019 15:05:35 +0000 (15:05 +0000)]
[Clang] Use -main-file-name for source filename if not set

-main-file-name is currently used to set the source name used in debug
information.

If the source filename is "-" and -main-file-name is set, then use the
filename also for source_filename and ModuleID of the output.

The argument is generally used outside the internal clang calls when
running clang in a wrapper like icecc which gives the source via stdin
but still wants to get a object file with the original source filename
both in debug info and IR code.

Patch by: the_jk (Joel Klinghed)

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

llvm-svn: 373217

4 years ago[SSP] [1/3] Revert "StackProtector: Use PointerMayBeCaptured"
Paul Robinson [Mon, 30 Sep 2019 15:01:35 +0000 (15:01 +0000)]
[SSP] [1/3] Revert "StackProtector: Use PointerMayBeCaptured"
"Captured" and "relevant to Stack Protector" are not the same thing.

This reverts commit f29366b1f594f48465c5a2754bcffac6d70fd0b1.
aka r363169.

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

llvm-svn: 373216

4 years agoFix breakage of sphinx builders. Sorry for leaving this broken over the
Kevin P. Neal [Mon, 30 Sep 2019 14:51:59 +0000 (14:51 +0000)]
Fix breakage of sphinx builders. Sorry for leaving this broken over the
weekend!

llvm-svn: 373215

4 years agoSupport MemoryLocation::UnknownSize in TargetLowering::IntrinsicInfo
Tamas Berghammer [Mon, 30 Sep 2019 14:44:24 +0000 (14:44 +0000)]
Support MemoryLocation::UnknownSize in TargetLowering::IntrinsicInfo

Summary:
Previously IntrinsicInfo::size was an unsigned what can't represent the
64 bit value used by MemoryLocation::UnknownSize.

Reviewers: jmolloy

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373214

4 years agoCorrect function declarations; NFC.
Aaron Ballman [Mon, 30 Sep 2019 14:43:52 +0000 (14:43 +0000)]
Correct function declarations; NFC.

This header is included by C code so the functions need to have a prototype. Also, fix the function definitions so that they have C linkage rather than C++ linkage.

llvm-svn: 373213

4 years ago[FileCheck] Remove implementation types from API
Thomas Preud'homme [Mon, 30 Sep 2019 14:12:03 +0000 (14:12 +0000)]
[FileCheck] Remove implementation types from API

Summary:
Remove use of FileCheckPatternContext and FileCheckString concrete types
from FileCheck API to allow moving it and the other implementation only
only declarations into a private header file.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373211

4 years ago[OPENMP] Fix comment, NFC.
Alexey Bataev [Mon, 30 Sep 2019 14:05:26 +0000 (14:05 +0000)]
[OPENMP] Fix comment, NFC.

llvm-svn: 373210

4 years ago[llvm-exegesis][NFC] Move BenchmarkFailure to own file.
Clement Courbet [Mon, 30 Sep 2019 13:53:50 +0000 (13:53 +0000)]
[llvm-exegesis][NFC] Move BenchmarkFailure to own file.

Summary: And rename to exegesis::Failure, as it's used everytwhere.

Reviewers: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 373209

4 years agoUse llvm for dumping DWARF expressions
Pavel Labath [Mon, 30 Sep 2019 13:44:17 +0000 (13:44 +0000)]
Use llvm for dumping DWARF expressions

Summary:
It uses the new ability of ABI plugins to vend llvm::MCRegisterInfo
structs (which is what is needed to turn dwarf register numbers into
strings).

Reviewers: JDevlieghere, aprantl, jasonmolenda

Subscribers: tatyana-krasnukha, lldb-commits

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

llvm-svn: 373208

4 years ago[Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)
Guillaume Chatelet [Mon, 30 Sep 2019 13:34:44 +0000 (13:34 +0000)]
[Alignment][NFC] Remove AllocaInst::setAlignment(unsigned)

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: jholewinski, arsenm, jvesely, nhaehnle, eraman, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 373207

4 years ago[lldb][NFC][modern-type-lookup] Remove while(false) behind if() {}
Raphael Isemann [Mon, 30 Sep 2019 13:08:08 +0000 (13:08 +0000)]
[lldb][NFC][modern-type-lookup] Remove while(false) behind if() {}

This was originally a 'do { ... } while (false);' like in the rest
of the function, but the do was refactored into an 'if' without
also removing the trailing 'while(false);'

llvm-svn: 373206

4 years ago[ConstantRange] add helper function addWithNoWrap().
Chen Zheng [Mon, 30 Sep 2019 12:57:53 +0000 (12:57 +0000)]
[ConstantRange] add helper function addWithNoWrap().
Differential Revision: https://reviews.llvm.org/D67339

llvm-svn: 373205

4 years agogn build: Merge r373202
GN Sync Bot [Mon, 30 Sep 2019 12:57:04 +0000 (12:57 +0000)]
gn build: Merge r373202

llvm-svn: 373204

4 years ago[llvm-exegesis][NFC] Refactor snippet file reading out of tool main.
Clement Courbet [Mon, 30 Sep 2019 12:50:25 +0000 (12:50 +0000)]
[llvm-exegesis][NFC] Refactor snippet file reading out of tool main.

Summary: Add unit tests.

Reviewers: gchatelet

Subscribers: mgorny, tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 373202

4 years ago[lldb] Reland 370734: Test 'frame select -r' and fix that INT32_MIN breaks the option...
Raphael Isemann [Mon, 30 Sep 2019 12:49:32 +0000 (12:49 +0000)]
[lldb] Reland 370734: Test 'frame select -r' and fix that INT32_MIN breaks the option parser

The problem with r370734 was that it removed the code for resetting the options in
OptionParsingStarting. This caused that once a 'frame select -r ...' command was executed,
we kept the relative index argument for all following 'frame select ...' invocations (even
the ones with an absolute index as they are the same command object). See rdar://55791276.

This relands the patch but keeps the code that resets the command options before execution.

llvm-svn: 373201

4 years agoRevert "Reland "[utils] Implement the llvm-locstats tool""
Djordje Todorovic [Mon, 30 Sep 2019 11:19:11 +0000 (11:19 +0000)]
Revert "Reland "[utils] Implement the llvm-locstats tool""

This reverts commit rL373183.

llvm-svn: 373200

4 years ago[Alignment] Fix polly build
Guillaume Chatelet [Mon, 30 Sep 2019 11:14:00 +0000 (11:14 +0000)]
[Alignment] Fix polly build

llvm-svn: 373199

4 years agoDeclCXX/ExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Mon, 30 Sep 2019 11:04:12 +0000 (11:04 +0000)]
DeclCXX/ExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373198

4 years ago[clangd] Implement a smart version of HeaderSource switch.
Haojian Wu [Mon, 30 Sep 2019 10:48:02 +0000 (10:48 +0000)]
[clangd] Implement a smart version of HeaderSource switch.

Summary:
This patch implements another version header-source switch by incorporating the
AST and index, it will be used:
  - to improve the current header-source switch feature (layer with the
    existing file heuristic);
  - by the incoming define-outline code action;

Reviewers: kadircet

Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

llvm-svn: 373197

4 years ago[Alignment][NFC] Adding a max function.
Guillaume Chatelet [Mon, 30 Sep 2019 09:59:31 +0000 (09:59 +0000)]
[Alignment][NFC] Adding a max function.

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 373196

4 years ago[Alignment][NFC] Remove LoadInst::setAlignment(unsigned)
Guillaume Chatelet [Mon, 30 Sep 2019 09:37:05 +0000 (09:37 +0000)]
[Alignment][NFC] Remove LoadInst::setAlignment(unsigned)

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, jdoerfert

Subscribers: hiraditya, asbirlea, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 373195

4 years ago[lldb] Partly revert 370734: Test 'frame select -r' and fix that INT32_MIN breaks...
Raphael Isemann [Mon, 30 Sep 2019 09:00:23 +0000 (09:00 +0000)]
[lldb] Partly revert 370734: Test 'frame select -r' and fix that INT32_MIN breaks the option parser

This somehow caused that 'frame select X' ends up being interpreted as 'frame select -r 1' when 'up' or 'down'
were run before 'frame select X'. See rdar://55791276.
Partly reverting to unbreak master. The changes that aren't reverted are the generic 'frame select -r' tests
that are obviously NFC and test existing behavior.

llvm-svn: 373194

4 years ago[lldb][clang][modern-type-lookup] Use ASTImporterSharedState in ExternalASTMerger
Raphael Isemann [Mon, 30 Sep 2019 08:52:16 +0000 (08:52 +0000)]
[lldb][clang][modern-type-lookup] Use ASTImporterSharedState in ExternalASTMerger

Summary:
The ExternalASTMerger should use the ASTImporterSharedState. This allows it to
handle std::pair in LLDB (but the rest of libc++ is still work in progress).

Reviewers: martong, shafik, a.sidorin

Subscribers: rnkovacs, christof, JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 373193

4 years ago[NFC][ARM][MVE] More tests
Sam Parker [Mon, 30 Sep 2019 08:49:42 +0000 (08:49 +0000)]
[NFC][ARM][MVE] More tests

Add some loop tests that cover different float operations and types.

llvm-svn: 373192

4 years agoNFC changes to SelectionDAGBuilder::visitBitTestHeader(), preparing for PR43129
Hans Wennborg [Mon, 30 Sep 2019 08:47:53 +0000 (08:47 +0000)]
NFC changes to SelectionDAGBuilder::visitBitTestHeader(), preparing for PR43129

llvm-svn: 373191

4 years agoPre-commit a test case for PR43129.
Hans Wennborg [Mon, 30 Sep 2019 08:47:46 +0000 (08:47 +0000)]
Pre-commit a test case for PR43129.

llvm-svn: 373190

4 years ago[llvm-locstats] Fix the test for the Hexagon target
Djordje Todorovic [Mon, 30 Sep 2019 08:43:00 +0000 (08:43 +0000)]
[llvm-locstats] Fix the test for the Hexagon target

llvm-svn: 373189

4 years ago[ARM][MVE] Change VCTP operand
Sam Parker [Mon, 30 Sep 2019 08:03:23 +0000 (08:03 +0000)]
[ARM][MVE] Change VCTP operand

The VCTP instruction will calculate the predicate masked based upon
the number of elements that need to be processed. I had inserted the
sub before the vctp intrinsic and supplied it as the operand, but
this is incorrect as the phi should directly feed the vctp. The sub
is calculating the value for the next iteration.

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

llvm-svn: 373188

4 years ago[TargetLowering] Simplify expansion of S{ADD,SUB}O
Roger Ferrer Ibanez [Mon, 30 Sep 2019 07:58:50 +0000 (07:58 +0000)]
[TargetLowering] Simplify expansion of S{ADD,SUB}O

ISD::SADDO uses the suggested sequence described in the section ยง2.4 of
the RISCV Spec v2.2. ISD::SSUBO uses the dual approach but checking for
(non-zero) positive.

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

llvm-svn: 373187

4 years ago[ARM][CGP] Allow signext arguments
Sam Parker [Mon, 30 Sep 2019 07:52:10 +0000 (07:52 +0000)]
[ARM][CGP] Allow signext arguments

As we perform a zext on any arguments used in the promoted tree, it
doesn't matter if they're marked as signext. The only permitted
user(s) in the tree which would interpret the sign bits are signed
icmps. For these instructions, their promoted operands are truncated
before the icmp uses them.

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

llvm-svn: 373186

4 years agoRevert "Update polly test for SCEV change."
Tim Northover [Mon, 30 Sep 2019 07:47:08 +0000 (07:47 +0000)]
Revert "Update polly test for SCEV change."

The motivating SCEV change was reverted as incorrect.

llvm-svn: 373185

4 years agoRevert "[SCEV] add no wrap flag for SCEVAddExpr."
Tim Northover [Mon, 30 Sep 2019 07:46:52 +0000 (07:46 +0000)]
Revert "[SCEV] add no wrap flag for SCEVAddExpr."

This reverts r366419 because the analysis performed is within the context of
the loop and it's only valid to add wrapping flags to "global" expressions if
they're always correct.

llvm-svn: 373184

4 years agoReland "[utils] Implement the llvm-locstats tool"
Djordje Todorovic [Mon, 30 Sep 2019 07:35:17 +0000 (07:35 +0000)]
Reland "[utils] Implement the llvm-locstats tool"

The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

llvm-svn: 373183

4 years ago[SystemZ] Add SystemZPostRewrite in addPostRegAlloc() instead at -O0.
Jonas Paulsson [Mon, 30 Sep 2019 07:29:54 +0000 (07:29 +0000)]
[SystemZ]  Add SystemZPostRewrite in addPostRegAlloc() instead at -O0.

SystemZPostRewrite needs to be run before (it may emit COPYs) the Post-RA
pseudo pass also at -O0, so it should be added in addPostRegAlloc().

Review: Ulrich Weigand
llvm-svn: 373182

4 years ago[X86] Remove some redundant isel patterns. NFCI
Craig Topper [Mon, 30 Sep 2019 06:47:03 +0000 (06:47 +0000)]
[X86] Remove some redundant isel patterns. NFCI

These are all also implemented in avx512_logical_lowering_types
with support for masking.

llvm-svn: 373181

4 years agoAMDGPU/GlobalISel: Fix select for v2s16 and/or/xor
Matt Arsenault [Mon, 30 Sep 2019 06:31:30 +0000 (06:31 +0000)]
AMDGPU/GlobalISel: Fix select for v2s16 and/or/xor

llvm-svn: 373180

4 years ago[test] Change llvm-readobj --arm-attributes to --arch-specific after r373125
Fangrui Song [Mon, 30 Sep 2019 04:45:14 +0000 (04:45 +0000)]
[test] Change llvm-readobj --arm-attributes to --arch-specific after r373125

llvm-svn: 373179

4 years ago[ELF][test] Change llvm-readobj --arm-attributes to --arch-specific after r373125
Fangrui Song [Mon, 30 Sep 2019 04:24:35 +0000 (04:24 +0000)]
[ELF][test] Change llvm-readobj --arm-attributes to --arch-specific after r373125

llvm-svn: 373178

4 years ago[X86] Split v16i32/v8i64 bitreverse on avx512f targets without avx512bw to enable...
Craig Topper [Mon, 30 Sep 2019 03:14:38 +0000 (03:14 +0000)]
[X86] Split v16i32/v8i64 bitreverse on avx512f targets without avx512bw to enable the use of vpshufb on the 256-bit halves.

llvm-svn: 373177

4 years agoUndef the macros after their use
Aditya Kumar [Mon, 30 Sep 2019 02:46:56 +0000 (02:46 +0000)]
Undef the macros after their use

Summary:

Reviewers:
t.p.northover

Subscribers:

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

llvm-svn: 373176

4 years ago[X86] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r373174
Fangrui Song [Mon, 30 Sep 2019 02:06:23 +0000 (02:06 +0000)]
[X86] Fix -Wunused-variable in -DLLVM_ENABLE_ASSERTIONS=off builds after r373174

llvm-svn: 373175

4 years ago[X86] Remove -x86-experimental-vector-widening-legalization command line flag
Craig Topper [Sun, 29 Sep 2019 23:32:37 +0000 (23:32 +0000)]
[X86] Remove -x86-experimental-vector-widening-legalization command line flag

This was added back to allow some performance regressions to be
investigated. The main perf issue was fixed shortly after adding
this back and no other major issues have been reported. So I
think its safe to remove this again.

llvm-svn: 373174

4 years agoDon't crash if a variable with a constexpr destructor has a
Richard Smith [Sun, 29 Sep 2019 20:30:13 +0000 (20:30 +0000)]
Don't crash if a variable with a constexpr destructor has a
value-dependent initializer.

llvm-svn: 373173

4 years ago[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops.
Craig Topper [Sun, 29 Sep 2019 18:43:08 +0000 (18:43 +0000)]
[X86] Add custom isel logic to match VPTERNLOG from 2 logic ops.

There's room from improvement here, but this is a decent
starting point.

There are a few minor regressions in the vector-rotate tests,
where we are now forming a vpternlog from an and before we get
a chance to form it for a bitselect that we were matching
previously. This results in an AND and an ANDN feeding the
vpternlog where previously we just had an AND after the
vpternlog. I think we can probably DAG combine the AND with
the bitselect to get back to similar codegen.

llvm-svn: 373172

4 years agoAdd test case peeking through vector concat when combining insert into shuffles. NFC
Amaury Sechet [Sun, 29 Sep 2019 17:54:03 +0000 (17:54 +0000)]
Add test case peeking through vector concat when combining insert into shuffles. NFC

llvm-svn: 373171