platform/upstream/llvm.git
4 years ago[X86] Add calculation for elements in structures in getting uniform base for the...
Wang, Pengfei [Fri, 13 Dec 2019 00:17:41 +0000 (08:17 +0800)]
[X86] Add calculation for elements in structures in getting uniform base for the Gather/Scatter intrinsic.

Summary: Add calculation for elements in structures in getting uniform
base for the Gather/Scatter intrinsic.

Reviewers: craig.topper, c-rhodes, RKSimon

Subscribers: hiraditya, llvm-commits, annita.zhang, LuoYuanke

Tags: #llvm

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

4 years ago[X86] Add strict fma support
Wang, Pengfei [Tue, 17 Dec 2019 13:27:46 +0000 (21:27 +0800)]
[X86] Add strict fma support

Summary: Add strict fma support

Reviewers: craig.topper, RKSimon, LiuChen3

Subscribers: hiraditya, llvm-commits, LuoYuanke

Tags: #llvm

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

4 years ago[CFG] Add an option to expand CXXDefaultInitExpr into aggregate initialization
Gabor Horvath [Wed, 18 Dec 2019 01:53:26 +0000 (17:53 -0800)]
[CFG] Add an option to expand CXXDefaultInitExpr into aggregate initialization

This is useful for clients that are relying on linearized CFGs for evaluating
subexpressions and want the default initializer to be evaluated properly.

The upcoming lifetime analysis is using this but it might also be useful
for the static analyzer at some point.

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

4 years ago[unwind] Don't link libpthread and libdl on Fuchsia
Petr Hosek [Wed, 18 Dec 2019 01:18:24 +0000 (17:18 -0800)]
[unwind] Don't link libpthread and libdl on Fuchsia

This is a follow up to D71135.

4 years ago[ELF] Fix a comment. NFC
Fangrui Song [Wed, 18 Dec 2019 01:17:33 +0000 (17:17 -0800)]
[ELF] Fix a comment. NFC

4 years ago[docs] Remove `git llvm push` and `git llvm revert` from GettingStarted
Justin Bogner [Wed, 18 Dec 2019 01:10:48 +0000 (17:10 -0800)]
[docs] Remove `git llvm push` and `git llvm revert` from GettingStarted

These sections aren't accurate since the github move.

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

4 years ago[PowerPC] Add missing legalization for vector BSWAP
Nemanja Ivanovic [Wed, 18 Dec 2019 01:07:18 +0000 (19:07 -0600)]
[PowerPC] Add missing legalization for vector BSWAP

We somehow missed doing this when we were working on Power9 exploitation.
This just adds the missing legalization and cost for producing the vector
intrinsics.

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

4 years agogn build: Merge e62e760f295
LLVM GN Syncbot [Wed, 18 Dec 2019 00:29:06 +0000 (00:29 +0000)]
gn build: Merge e62e760f295

4 years agoTemporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction...
Eric Christopher [Wed, 18 Dec 2019 00:22:31 +0000 (16:22 -0800)]
Temporarily Revert "[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input"
and follow-on patches.

This is breaking a few build bots and local builds with follow-up already
on the patch thread.

This reverts commits 390c8baa5440dda8907688d9ef860f6982bd925f and
520e3d66e7257c77f1226185504bbe1cb90afcfa.

4 years ago[X86] Manually format some setOperationAction calls to line up arguments to improve...
Craig Topper [Wed, 18 Dec 2019 00:04:26 +0000 (16:04 -0800)]
[X86] Manually format some setOperationAction calls to line up arguments to improve readability. NFC

4 years ago[AArch64][GlobalISel]: Fix a crash in GlobalIsel in dealing with 16bit uadd.with...
Xiaoqing Wu [Tue, 17 Dec 2019 23:41:06 +0000 (15:41 -0800)]
[AArch64][GlobalISel]: Fix a crash in GlobalIsel in dealing with 16bit uadd.with.overflow.

Summary: AArch64 doesn't support uadd.with.overflow.i16 natively. This change adds a legalization rule to convert the 32bit add result to 16bit. This should fix PR43981.

Reviewers: arsenm, qcolombet, paquette, aemerson

Reviewed By: paquette

Subscribers: wdng, rovka, kristof.beyls, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

4 years ago[FPEnv][LegalizeTypes] Make ScalarizeVecOp_STRICT_FP_ROUND do its own replacements...
Craig Topper [Tue, 17 Dec 2019 23:14:44 +0000 (15:14 -0800)]
[FPEnv][LegalizeTypes] Make ScalarizeVecOp_STRICT_FP_ROUND do its own replacements and return SDValue()

The caller will assert for nodes with more than 2 results unless
we return a null SDValue.

I tried to test this by copying an AArch64 test for ScalarizeVecOp_FP_ROUND.
While it did hit the assert and this commited fixed that. It also
hit a later problem that couldn't be fixed without adding strict
FP support to AArch64.

4 years ago[AMDGPU] Fixed cost model for packed 16 bit ops
Stanislav Mekhanoshin [Tue, 17 Dec 2019 19:16:06 +0000 (11:16 -0800)]
[AMDGPU] Fixed cost model for packed 16 bit ops

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

4 years ago[WebAssembly] Implement SIMD {i8x16,i16x8}.avgr_u instructions
Thomas Lively [Tue, 17 Dec 2019 21:58:39 +0000 (13:58 -0800)]
[WebAssembly] Implement SIMD {i8x16,i16x8}.avgr_u instructions

Summary:
These instructions were added to the spec proposal in
https://github.com/WebAssembly/simd/pull/126. Their semantics are
equivalent to `(a + b + 1) / 2`. The opcode for the experimental
i32x4.dot_i16x8_s is also bumped due to a collision with the
i8x16.avgr_u opcode.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

4 years agoRevert "[ MC ] Match labels to existing fragments even when switching sections."
Mitch Phillips [Tue, 17 Dec 2019 23:03:10 +0000 (15:03 -0800)]
Revert "[ MC ] Match labels to existing fragments even when switching sections."

This reverts commit 4272372c571cd33edc77a8844b0a224ad7339138.

Caused an MSan buildbot failure. More information available in the patch
that introduced the bug: https://reviews.llvm.org/D71368

4 years ago[analysis] Discard type qualifiers when casting values retrieved from the Store.
Artem Dergachev [Tue, 17 Dec 2019 22:49:53 +0000 (14:49 -0800)]
[analysis] Discard type qualifiers when casting values retrieved from the Store.

This canonicalizes the representation of unknown pointer symbols,
which reduces the overall confusion in pointer cast representation.

Patch by Vince Bridgers!

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

4 years ago[FPEnv][LegalizeTypes][LegalizeDAG][AArch64] Few fixes/improvements for legalizing...
Craig Topper [Tue, 17 Dec 2019 22:32:21 +0000 (14:32 -0800)]
[FPEnv][LegalizeTypes][LegalizeDAG][AArch64] Few fixes/improvements for legalizing fp<->int conversion nodes.

This started with adding a test to support get code coverage on
ScalarizeVecOp_UnaryOp_StrictFP by copying an existing AArch64 test
and using constrained sitofp/uitofp intrinsics.

This found 3 separate issues:
-ScalarizeVecOp_UnaryOp_StrictFP needs to do its own replacement
 because the caller can't handle replacing multiple results.
-Missing integer promotion support for sitofp/uitofp
-Chain result not always assigned in ExpandLegalINT_TO_FP.

Committing them together so I can add the test case.

4 years ago[driver][darwin] Use explicit -mlinker-version in the -platform_version tests
Alex Lorenz [Tue, 17 Dec 2019 22:24:23 +0000 (14:24 -0800)]
[driver][darwin] Use explicit -mlinker-version in the -platform_version tests

The driver actually adds a default -mlinker-version, based on HOST_LINK_VERSION
cmake variable. The tests should be explicit about which version they're using to
trigger the right behavior.

4 years ago[LoopFusion] Move instructions from FC0.Latch to FC1.Latch.
Whitney Tsang [Tue, 17 Dec 2019 21:44:06 +0000 (21:44 +0000)]
[LoopFusion] Move instructions from FC0.Latch to FC1.Latch.

Summary:This PR move instructions from FC0.Latch bottom up to the
beginning of FC1.Latch as long as they are proven safe.

To illustrate why this is beneficial, let's consider the following
example:
Before Fusion:
header1:
  br header2
header2:
  br header2, latch1
latch1:
  br header1, preheader3
preheader3:
  br header3
header3:
  br header4
header4:
  br header4, latch3
latch3:
  br header3, exit3

After Fusion (before this PR):
header1:
  br header2
header2:
  br header2, latch1
latch1:
  br header3
header3:
  br header4
header4:
  br header4, latch3
latch3:
  br header1, exit3

Note that preheader3 is removed during fusion before this PR.
Notice that we cannot fuse loop2 with loop4 as there exists block latch1
in between.
This PR move instructions from latch1 to beginning of latch3, and remove
block latch1. LoopFusion is now able to fuse loop nest recursively.

After Fusion (after this PR):
header1:
  br header2
header2:
  br header3
header3:
  br header4
header4:
  br header2, latch3
latch3:
  br header1, exit3

Reviewer: kbarton, jdoerfert, Meinersbur, dmgreen, fhahn, hfinkel,
bmahjour, etiotto
Reviewed By: kbarton, Meinersbur
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D71165

4 years ago[AIX] Avoid unset csect assert for functions defined after their use in TOC
David Tenty [Tue, 17 Dec 2019 21:56:59 +0000 (16:56 -0500)]
[AIX] Avoid unset csect assert for functions defined after their use in TOC

Summary:
If a function is defined after it appears in a TOC expression, we may
try to access an unset containing csect when returning a symbol for the
expression.

Reviewers: Xiangling_L, DiggerLin, jasonliu, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: hubert.reinterpretcast, wuzish, nemanjai, hiraditya, kbarton, jsji, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/SILoadStoreOptimillzer: Refactor CombineInfo struct
Tom Stellard [Tue, 17 Dec 2019 04:37:39 +0000 (20:37 -0800)]
AMDGPU/SILoadStoreOptimillzer: Refactor CombineInfo struct

Summary:
Modify CombineInfo to only store information about a single instruction.
This is a little easier to work with and removes a lot of duplicate
initialization code.

Reviewers: arsenm, nhaehnle

Reviewed By: arsenm, nhaehnle

Subscribers: merge_guards_bot, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoFix buildbot failures after removing REQUIRES-ANY
Nemanja Ivanovic [Tue, 17 Dec 2019 21:24:51 +0000 (15:24 -0600)]
Fix buildbot failures after removing REQUIRES-ANY

It would appear that the removal of this lit feature was incomplete
and there is a test case that still tests for this. This patch removes
the remaining tests to bring the bots back to green. I would encourage the
author to do a post-commit review on this in case there is a more desirable fix.

4 years ago[IR] Use a reference in a range-based for
Mark de Wever [Tue, 17 Dec 2019 20:57:58 +0000 (21:57 +0100)]
[IR] Use a reference in a range-based for

This avoids unneeded copies when using a range-based for loops.

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[Driver] Avoid copies in range-based for loops
Mark de Wever [Tue, 17 Dec 2019 20:56:04 +0000 (21:56 +0100)]
[Driver] Avoid copies in range-based for loops

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[Sema] Fixes -Wrange-loop-analysis warnings
Mark de Wever [Tue, 17 Dec 2019 20:54:32 +0000 (21:54 +0100)]
[Sema] Fixes -Wrange-loop-analysis warnings

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years ago[Frontend] Fixes -Wrange-loop-analysis warnings
Mark de Wever [Tue, 17 Dec 2019 20:52:47 +0000 (21:52 +0100)]
[Frontend] Fixes -Wrange-loop-analysis warnings

This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

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

4 years agoRecommit "[DebugInfo] Refactored macro related generation,
Sourabh Singh Tomar [Wed, 4 Dec 2019 13:02:39 +0000 (18:32 +0530)]
Recommit "[DebugInfo] Refactored macro related generation,
added a test case for macinfo.dwo emission."

This was reverted in caa412090666c10f854322cdc701c1cbf8ed726e,
since it was causing an assertion failure on Windows bots.
This revision is revised to fix that.

Original commit message -

[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission.

Reviewers: dblaikie, aprantl, jini.susan.george

Tags: #debug-info #llvm

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

4 years ago[perf-training] Change profile file pattern string to use %4m instead of %p
Xin-Xin Wang [Tue, 17 Dec 2019 19:05:35 +0000 (11:05 -0800)]
[perf-training] Change profile file pattern string to use %4m instead of %p

Summary: With %p, each test file that we're using to generate profile data will make its own profraw file which is around 60 MB in size. If we have a lot of test files, that quickly uses a lot of space. Use %4m instead to share the profraw files used to store the profile data. We use 4 here based on the default value in https://reviews.llvm.org/source/llvm-github/browse/master/llvm/CMakeLists.txt$604

Reviewers: beanz, phosek, xiaobai, smeenai, vsk

Reviewed By: vsk

Subscribers: vsk, cfe-commits

Tags: #clang

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

4 years ago[FPEnv] Remove unnecessary rounding mode argument for constrained intrinsics
Ulrich Weigand [Tue, 17 Dec 2019 20:08:18 +0000 (21:08 +0100)]
[FPEnv] Remove unnecessary rounding mode argument for constrained intrinsics

The following intrinsics currently carry a rounding mode metadata argument:

    llvm.experimental.constrained.minnum
    llvm.experimental.constrained.maxnum
    llvm.experimental.constrained.ceil
    llvm.experimental.constrained.floor
    llvm.experimental.constrained.round
    llvm.experimental.constrained.trunc

This is not useful since the semantics of those intrinsics do not in any way
depend on the rounding mode. In similar cases, other constrained intrinsics
do not have the rounding mode argument. Remove it here as well.

Reviewed By: craig.topper

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

4 years ago[OPENMP50]Add parsing/sema analysis for nontemporal clause.
Alexey Bataev [Mon, 16 Dec 2019 20:54:17 +0000 (15:54 -0500)]
[OPENMP50]Add parsing/sema analysis for nontemporal clause.

Add basic support for parsing/sema analysis of the nontemporal clause in
simd-based directives.

4 years ago[LIBOPENMP][NVPTX]Fix the build error in the runtime.
Alexey Bataev [Tue, 17 Dec 2019 19:33:03 +0000 (14:33 -0500)]
[LIBOPENMP][NVPTX]Fix the build error in the runtime.

4 years ago[Attributor] H2S fix.
Stefan Stipanovic [Tue, 17 Dec 2019 19:41:09 +0000 (20:41 +0100)]
[Attributor] H2S fix.

Summary: Fixing issues that were noticed in D71521

Reviewers: jdoerfert, lebedev.ri, uenoku

Subscribers:

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

4 years ago[Attributor][NFC] Add test for sle comparison in h2s.
Stefan Stipanovic [Tue, 17 Dec 2019 19:36:10 +0000 (20:36 +0100)]
[Attributor][NFC] Add test for sle comparison in h2s.

4 years ago[WebAssembly] Convert MC tests to from bitcode to asm
Sam Clegg [Fri, 13 Dec 2019 23:12:56 +0000 (15:12 -0800)]
[WebAssembly] Convert MC tests to from bitcode to asm

Now that our `.s` format is stable(ish) and useable we should really
convert all our MC and lld tests over to .s format to match other
targets.

This is a test PR that just converts 2 of our MC tests to see what
it might look like.

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

4 years ago[Clang FE, SystemZ] Recognize -mpacked-stack CL option
Jonas Paulsson [Thu, 12 Dec 2019 20:40:26 +0000 (21:40 +0100)]
[Clang FE, SystemZ]  Recognize -mpacked-stack CL option

Recognize -mpacked-stack from the command line and add a function attribute
"mpacked-stack" when passed. This is needed for building the Linux kernel.

If this option is passed for any other target than SystemZ, an error is
generated.

Review: Ulrich Weigand
https://reviews.llvm.org/D71441

4 years agollvm-diff: Perform structural comparison on GlobalVariables, if possible
Dominic Chen [Tue, 17 Dec 2019 00:01:26 +0000 (19:01 -0500)]
llvm-diff: Perform structural comparison on GlobalVariables, if possible

Summary: Names of GlobalVariables may not be preserved depending on compilation options, so prefer a structural diff

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[objc_direct] fix uniquing when re-declaring a readwrite-direct property
Pierre Habouzit [Tue, 17 Dec 2019 19:06:17 +0000 (11:06 -0800)]
[objc_direct] fix uniquing when re-declaring a readwrite-direct property

ObjCMethodDecl::getCanonicalDecl() for re-declared readwrite properties,
only looks in the ObjCInterface for the declaration of the setter
method, which it won't find.

When the method is a property accessor, we must look in extensions for a
possible redeclaration.

Radar-Id: rdar://problem/57991337

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

4 years ago[AMDGPU] Fix typo in SIInstrInfo::memOpsHaveSameBasePtr
Jay Foad [Tue, 17 Dec 2019 16:09:02 +0000 (16:09 +0000)]
[AMDGPU] Fix typo in SIInstrInfo::memOpsHaveSameBasePtr

Summary:
The typo has been present since memOpsHaveSameBasePtr was introduced in
r313208.

It caused SIInstrInfo::shouldClusterMemOps to cluster more mem ops than
it was supposed to.

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SDAG] adjust isNegatibleForFree calculation to avoid crashing
Sanjay Patel [Tue, 17 Dec 2019 18:49:15 +0000 (13:49 -0500)]
[SDAG] adjust isNegatibleForFree calculation to avoid crashing

This is an alternate fix for the bug discussed in D70595.
This also includes minimal tests for other in-tree targets to show the problem more
generally.

We check the number of uses as a predicate for whether some value is free to negate,
but that use count can change as we rewrite the expression in getNegatedExpression().
So something that was marked free to negate during the cost evaluation phase becomes
not free to negate during the rewrite phase (or the inverse - something that was not
free becomes free). This can lead to a crash/assert because we expect that everything
in an expression that is negatible to be handled in the corresponding code within
getNegatedExpression().

This patch adds a hack to work-around the case where we probably no longer detect
that either multiply operand of an FMA isNegatibleForFree which is assumed to be
true when we started rewriting the expression.

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

4 years agoRevert "[SDAG] remove use restriction in isNegatibleForFree() when called from getNeg...
Sanjay Patel [Tue, 17 Dec 2019 18:47:59 +0000 (13:47 -0500)]
Revert "[SDAG] remove use restriction in isNegatibleForFree() when called from getNegatedExpression()"

This reverts commit 36b1232ec5f370ab9fe8fcff0458d2fca5ca9b7f.
Need to adjust commit message - that was a leftover from the earlier version.

4 years ago[SDAG] remove use restriction in isNegatibleForFree() when called from getNegatedExpr...
Sanjay Patel [Tue, 17 Dec 2019 17:07:28 +0000 (12:07 -0500)]
[SDAG] remove use restriction in isNegatibleForFree() when called from getNegatedExpression()

This is an alternate fix for the bug discussed in D70595.
This also includes minimal tests for other in-tree targets to show the problem more
generally.

We check the number of uses as a predicate for whether some value is free to negate,
but that use count can change as we rewrite the expression in getNegatedExpression().
So something that was marked free to negate during the cost evaluation phase becomes
not free to negate during the rewrite phase (or the inverse - something that was not
free becomes free). This can lead to a crash/assert because we expect that everything
in an expression that is negatible to be handled in the corresponding code within
getNegatedExpression().

This patch adds a hack to work-around the case where we probably no longer detect
that either multiply operand of an FMA isNegatibleForFree which is assumed to be
true when we started rewriting the expression.

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

4 years agoRevert "[ASTImporter] Friend class decl should not be visible in its context"
Nico Weber [Tue, 17 Dec 2019 18:43:50 +0000 (13:43 -0500)]
Revert "[ASTImporter] Friend class decl should not be visible in its context"

This reverts commit 4becf68c6f17fe143539ceac954b21175914e1c1.
Breaks building on Windows, see comments on D71020

4 years ago[driver][darwin] Pass -platform_version flag to the linker instead of the -<platform...
Alex Lorenz [Tue, 17 Dec 2019 00:46:41 +0000 (16:46 -0800)]
[driver][darwin] Pass -platform_version flag to the linker instead of the -<platform>_version_min flag

In Xcode 11, ld added a new flag called -platform_version that can be used instead of the old -<platform>_version_min flags.
The new flag allows Clang to pass the SDK version from the driver to the linker.
This patch adopts the new -platform_version flag in Clang, and starts using it by default,
unless a linker version < 520 is passed to the driver.

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

4 years ago[libomptarget][nfc] Move three files under common, build them for amdgcn
JonChesterfield [Tue, 17 Dec 2019 18:02:48 +0000 (18:02 +0000)]
[libomptarget][nfc] Move three files under common, build them for amdgcn

Summary:
[libomptarget][nfc] Move three files under common, build them for amdgcn

Change to reduction.cu to remove two dead includes, otherwise no code change.

Reviewers: jdoerfert, ABataev, grokos

Reviewed By: jdoerfert

Subscribers: jvesely, mgorny, openmp-commits

Tags: #openmp

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

4 years ago[RISCV] Add subtargets initialized with target feature
Zakk Chen [Thu, 28 Nov 2019 16:33:55 +0000 (08:33 -0800)]
[RISCV] Add subtargets initialized with target feature

expected failed test (RV32IF-ILP32F) will be fixed in a subsequent patch.

Reviewers: efriedma, lenary, asb

Reviewed By: efriedma, lenary

Tags: #llvm

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

4 years ago[FPEnv] IRBuilder support for constrained sitofp/uitofp.
Kevin P. Neal [Tue, 17 Dec 2019 17:30:41 +0000 (12:30 -0500)]
[FPEnv] IRBuilder support for constrained sitofp/uitofp.

4 years ago[DAGCombiner] Add node back in the worklist in topological order in CommitTargetLower...
Amaury Séchet [Mon, 2 Dec 2019 18:13:38 +0000 (19:13 +0100)]
[DAGCombiner] Add node back in the worklist in topological order in CommitTargetLoweringOpt

Summary:
Right now, DAGCombiner process the nodes in an iplementation defined order. This tends to be fragile as optimisation may or may not kick in depending on the traversal order.

This is part of a larger effort to get the DAGCombiner to process its node in topological order.

Reviewers: craig.topper, efriedma, RKSimon, lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SystemZ][FPEnv] Back-end support for STRICT_[SU]INT_TO_FP
Ulrich Weigand [Tue, 17 Dec 2019 17:20:14 +0000 (18:20 +0100)]
[SystemZ][FPEnv] Back-end support for STRICT_[SU]INT_TO_FP

As of b1d8576 there is middle-end support for STRICT_[SU]INT_TO_FP,
so this patch adds SystemZ back-end support as well.

The patch is SystemZ target specific except for adding SD patterns
strict_[su]int_to_fp and any_[su]int_to_fp to TargetSelectionDAG.td
as usual.

4 years ago[gicombiner] Process the MatchDag such that every node is reachable from the roots
Daniel Sanders [Tue, 17 Dec 2019 15:43:58 +0000 (15:43 +0000)]
[gicombiner] Process the MatchDag such that every node is reachable from the roots

Summary:
When we build the walk across these DAG's we need to be able to reach every node
from the roots. Flip and traversal edges (so that use->def becomes def->uses)
that make nodes unreachable. Note that early on we'll just error out on these
flipped edges as def->uses edges are more complicated to match due to their
one->many nature.

Depends on D69077

Reviewers: volkan, bogner

Subscribers: llvm-commits

4 years ago[InstCombine][AMDGPU] Trim more components of *buffer_load
Piotr Sobczak [Fri, 15 Nov 2019 14:07:41 +0000 (15:07 +0100)]
[InstCombine][AMDGPU] Trim more components of *buffer_load

Summary:
Add trimming of unused components of s_buffer_load.

Extend trimming of *buffer_load to also include
unused components at the beginning of vectors and update offset.

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[ MC ] Match labels to existing fragments even when switching sections.
Michael Trent [Wed, 11 Dec 2019 18:42:37 +0000 (10:42 -0800)]
[ MC ] Match labels to existing fragments even when switching sections.

Summary:
This commit builds upon Derek Schuff's 2014 commit for attaching labels to
existing fragments ( Diff Revision: http://reviews.llvm.org/D5915 )

When temporary labels appear ahead of a fragment, MCObjectStreamer will
track the temporary label symbol in a "Pending Labels" list. Labels are
associated with fragments when a real fragment arrives; otherwise, an empty
data fragment will be created if the streamer's section changes or if the
stream finishes.

This commit moves the "Pending Labels" list into each MCStream, so that
this label-fragment matching process is resilient to section changes. If
the streamer emits a label in a new section, switches to another section to
do other work, then switches back to the first section and emits a
fragment, that initial label will be associated with this new fragment.
Labels will only receive empty data fragments in the case where no other
fragment exists for that section.

The downstream effects of this can be seen in Mach-O relocations. The
previous approach could produce local section relocations and external
symbol relocations for the same data in an object file, and this mix of
relocation types resulted in problems in the ld64 Mach-O linker. This
commit ensures relocations triggered by temporary labels are consistent.

Reviewers: pete, ab, dschuff

Reviewed By: pete, dschuff

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AMDGPU] Update autogenerated checks
Jay Foad [Tue, 17 Dec 2019 16:48:02 +0000 (16:48 +0000)]
[AMDGPU] Update autogenerated checks

4 years ago[lit] Fix internal diff newlines for -w/-b
Joel E. Denny [Tue, 17 Dec 2019 15:23:11 +0000 (10:23 -0500)]
[lit] Fix internal diff newlines for -w/-b

For example, without this patch:

```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
  1! 2--- 1,2 ----
  1! 20
```

With this patch:

```
$ python $LIT_BUILTINS/diff.py -b foo.txt bar.txt
*** /tmp/foo.txt
--- /tmp/bar.txt
***************
*** 1,2 ****
  1
! 2
--- 1,2 ----
  1
! 20
```

Reviewed By: rnk

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

4 years ago[AArch64] add tests for fcvtl2; NFC
Sanjay Patel [Tue, 17 Dec 2019 15:21:32 +0000 (10:21 -0500)]
[AArch64] add tests for fcvtl2; NFC

4 years agoRevert "Honor -fuse-init-array when os is not specified on x86"
Mitch Phillips [Tue, 17 Dec 2019 15:31:31 +0000 (07:31 -0800)]
Revert "Honor  -fuse-init-array when os is not specified on x86"

This reverts commit aa5ee8f244441a8ea103a7e0ed8b6f3e74454516.

This change broke the sanitizer buildbots. See comments at the patchset
(https://reviews.llvm.org/D71360) for more information.

4 years ago[clangd] Fix handling of inline/anon namespaces and names of deduced types in hover
Kadir Cetinkaya [Mon, 16 Dec 2019 13:22:48 +0000 (14:22 +0100)]
[clangd] Fix handling of inline/anon namespaces and names of deduced types in hover

Summary:
Clangd normally skips inline and anon namespaces while printing nested name
specifiers. It also drops any tag specifiers since we make use of `HoverInfo::Kind`
instead of some text in `HoverInfo::Name`

There was a bug causing us to print innermost inline/anon namespace, this patch
fixes that by skipping those.
Also changes printing and kind detection of deduced types to be similar to decl
case.

Also improves printing for lambdas, currently clangd prints lambdas as
`(anonymous class)`, we can improve it by at least printing `(lambda)`
instead.

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

Tags: #clang

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

4 years ago[clangd][NFC] Make use of TagDecl inside type for hover on auto
Kadir Cetinkaya [Tue, 17 Dec 2019 12:00:12 +0000 (13:00 +0100)]
[clangd][NFC] Make use of TagDecl inside type for hover on auto

Summary:
We were traversing AST twice to get the Decl in case of sugared
types(auto, decltype). They seem to be same in practice, so this patch gets rid
of the second traversal and makes use of TagDecl inside QualType instead.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years agogn build: Merge 390c8baa544
LLVM GN Syncbot [Tue, 17 Dec 2019 15:28:35 +0000 (15:28 +0000)]
gn build: Merge 390c8baa544

4 years ago[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input
Daniel Sanders [Tue, 17 Dec 2019 14:29:14 +0000 (14:29 +0000)]
[gicombiner] Add the MatchDag structure and parse instruction DAG's from the input

Summary:
The MatchDag structure is a representation of the checks that need to be
performed and the dependencies that limit when they can happen.

There are two kinds of node in the MatchDag:
* Instrs - Represent a MachineInstr
* Predicates - Represent a check that needs to be performed (i.e. opcode, is register, same machine operand, etc.)
and two kinds of edges:
* (Traversal) Edges - Represent a register that can be traversed to find one instr from another
* Predicate Dependency Edges - Indicate that a predicate requires a piece of information to be tested.

For example, the matcher:
 (match (MOV $t, $s),
        (MOV $d, $t))
with MOV declared as an instruction of the form:
  %dst = MOV %src1
becomes the following MatchDag with the following instruction nodes:
  __anon0_0 // $t=getOperand(0), $s=getOperand(1)
  __anon0_1 // $d=getOperand(0), $t=getOperand(1)
traversal edges:
  __anon0_1[src1] --[t]--> __anon0_0[dst]
predicate nodes:
  <<$mi.getOpcode() == MOV>>:$__anonpred0_2
  <<$mi.getOpcode() == MOV>>:$__anonpred0_3
and predicate dependencies:
  __anon0_0 ==> __anonpred0_2[mi]
  __anon0_0 ==> __anonpred0_3[mi]

The result of this parse is currently unused but can be tested
using -gicombiner-stop-after-parse as done in parse-match-pattern.td. The
dump for testing includes a graphviz format dump to allow the rule to be
viewed visually.

Later on, these MatchDag's will be used to generate code and to build an
efficient decision tree.

Reviewers: volkan, bogner

Reviewed By: volkan

Subscribers: arsenm, mgorny, mgrang, llvm-commits

Tags: #llvm

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

4 years ago[lldb][NFC] Use StringRef in CreateRecordType and CreateObjCClass
Raphael Isemann [Tue, 17 Dec 2019 15:00:51 +0000 (16:00 +0100)]
[lldb][NFC] Use StringRef in CreateRecordType and CreateObjCClass

4 years agoThis adds constrained intrinsics for the signed and unsigned conversions
Kevin P. Neal [Wed, 16 Oct 2019 19:24:47 +0000 (15:24 -0400)]
This adds constrained intrinsics for the signed and unsigned conversions
of integers to floating point.

This includes some of Craig Topper's changes for promotion support from
D71130.

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

4 years agoReland [NFC-I] Remove hack for fp-classification builtins
Erich Keane [Mon, 16 Dec 2019 19:15:48 +0000 (11:15 -0800)]
Reland [NFC-I] Remove hack for fp-classification builtins

The FP-classification builtins (__builtin_isfinite, etc) use variadic
packs in the definition file to mean an overload set.  Because of that,
floats were converted to doubles, which is incorrect. There WAS a patch
to remove the cast after the fact.

THis patch switches these builtins to just be custom type checking,
calls the implicit conversions for the integer members, and makes sure
the correct L->R casts are put into place, then does type checking like
normal.

A future direction (that wouldn't be NFC) would consider making
conversions for the floating point parameter legal.

Note: The initial patch for this missed that certain systems need to
still convert half to float, since they dont' support that type.

4 years ago[lldb][NFC] Rename ClangASTImporter::InsertRecordDecl to SetRecordLayout and document it
Raphael Isemann [Tue, 17 Dec 2019 13:34:17 +0000 (14:34 +0100)]
[lldb][NFC] Rename ClangASTImporter::InsertRecordDecl to SetRecordLayout and document it

This function is just setting the layout for the given RecordDecl so
the current name is not very descriptive. Also add some documentation for it.

4 years ago[ASTImporter] Friend class decl should not be visible in its context
Gabor Marton [Wed, 4 Dec 2019 16:12:08 +0000 (17:12 +0100)]
[ASTImporter] Friend class decl should not be visible in its context

Summary:
In the past we had to use DeclContext::makeDeclVisibleInContext to make
friend declarations available for subsequent lookup calls and this way
we could chain (redecl) the structurally equivalent decls.
By doing this we created an AST that improperly made declarations
visible in some contexts, so the AST was malformed.
Since we use the importer specific lookup this is no longer necessary,
because with that we can find every previous nodes.

Reviewers: balazske, a_sidorin, a.sidorin, shafik

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, teemperor, cfe-commits

Tags: #clang

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

4 years ago[lldb][NFC] Allow creating ClangExpressionDeclMap and ClangASTSource without a Target...
Raphael Isemann [Tue, 17 Dec 2019 12:38:07 +0000 (13:38 +0100)]
[lldb][NFC] Allow creating ClangExpressionDeclMap and ClangASTSource without a Target and add basic unit test

The ClangExpressionDeclMap should be testable from a unit test. This is currently
impossible as they have both dependencies on Target/ExecutionContext from their
constructor. This patch allows constructing these classes without an active Target
and adds the missing tests for running without a target that we can do at least
a basic lookup test without crashing.

4 years agoPostRA Machine Sink should take care of COPY defining register that is a sub-register...
alex-t [Tue, 17 Dec 2019 12:20:32 +0000 (15:20 +0300)]
PostRA Machine Sink should take care of COPY defining register that is a sub-register by another COPY source operand

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

4 years ago[libomptarget][nfc] Move omp locks under target_impl
JonChesterfield [Tue, 17 Dec 2019 12:18:55 +0000 (12:18 +0000)]
[libomptarget][nfc] Move omp locks under target_impl

Summary:
[libomptarget][nfc] Move omp locks under target_impl

These are likely to be target specific, even down to the lock_t which is
correspondingly moved out of interface.h. The alternative is to include
interface.h in target_impl which substantiatially increases the scope of
those symbols.

The current nvptx implementation deadlocks on amdgcn. The preferred
implementation for that arch is still under discussion - this change
leaves declarations in target_impl.

The functions could be inline for nvptx. I'd prefer to keep the internals
hidden in the target_impl translation unit, but will add the (possibly renamed)
macros to target_impl.h if preferred.

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: jdoerfert

Subscribers: jvesely, mgorny, jfb, openmp-commits

Tags: #openmp

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

4 years ago[DebugInfo] Only print a single blank line after an empty line table
James Henderson [Tue, 17 Dec 2019 12:02:54 +0000 (12:02 +0000)]
[DebugInfo] Only print a single blank line after an empty line table

Commit 84a9756 added an extra blank line at the end of any line table.
However, a blank line is also printed after the line table header, which
meant that two blank lines in a row were being printed after a header,
if there were no rows. This patch defers the post-header blank line
printing until it has been determined that there are rows to print.

Reviewed by: dblaikie

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

4 years ago[libcxx] Fix include paths in fuzzing/partial_sort.pass.cpp
Mikhail Maltsev [Tue, 17 Dec 2019 11:45:22 +0000 (11:45 +0000)]
[libcxx] Fix include paths in fuzzing/partial_sort.pass.cpp

Summary:
When testing an installed (out-of-tree) version of libc++, the
"libcxx/fuzzing/partial_sort.pass.cpp" test fails because of missing
include files "../fuzzing/fuzzing.{h,cpp}". This happens because in
the source tree "../fuzzing" can be accessed as
"libcxx/include/../fuzzing", but with the installed library this does
not work.

This patch fixes the issue by changing the path to be relative from
the `libcxx/test/fuzzing" directory.

Reviewers: mclow.lists, EricWF, christof, michaelplatings

Reviewed By: michaelplatings

Subscribers: merge_guards_bot, ldionne, libcxx-commits

Tags: #libc

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

4 years ago[RISCV][NFC] Trivial cleanup
Luís Marques [Tue, 17 Dec 2019 11:42:32 +0000 (11:42 +0000)]
[RISCV][NFC] Trivial cleanup

Fix a typo. Remove two seemingly out-of-date TODO comments.

4 years ago[lldb] Remove modern-type-lookup
Raphael Isemann [Tue, 17 Dec 2019 11:22:34 +0000 (12:22 +0100)]
[lldb] Remove modern-type-lookup

Summary:
As discussed on the mailing list [1] we have to make a decision for how to proceed with the modern-type-lookup.

This patch removes modern-type-lookup from LLDB. This just removes all the code behind the modern-type-lookup
setting but it does *not* remove any code from Clang (i.e., the ExternalASTMerger and the clang-import-test stay around
for now).

The motivation for this is that I don't think that the current approach of implementing modern-type-lookup
will work out. Especially creating a completely new lookup system behind some setting that is never turned on by anyone
and then one day make one big switch to the new system seems wrong. It doesn't fit into the way LLVM is developed and has
so far made the transition work much more complicated than it has to be.

A lot of the benefits that were supposed to come with the modern-type-lookup are related to having a better organization
in the way types move across LLDB and having less dependencies on unrelated LLDB code. By just looking at the current code (mostly
the ClangASTImporter) I think we can reach the same goals by just incrementally cleaning up, documenting, refactoring
and actually testing the existing code we have.

[1] http://lists.llvm.org/pipermail/lldb-dev/2019-December/015831.html

Reviewers: shafik, martong

Subscribers: rnkovacs, christof, arphaman, JDevlieghere, usaxena95, lldb-commits, friss

Tags: #lldb

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

4 years ago[OpenCL] Add ExtVectorElementExpr constant evaluation (PR42387)
Sven van Haastregt [Tue, 17 Dec 2019 11:10:06 +0000 (11:10 +0000)]
[OpenCL] Add ExtVectorElementExpr constant evaluation (PR42387)

Add constexpr evaluation for ExtVectorElementExpr nodes by evaluating
the underlying vector expression.  Add basic folding for the case that
Evaluate does not return an LValue.

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

4 years agoFix assertion failure in getMemOperandWithOffsetWidth
Kristof Beyls [Wed, 11 Dec 2019 14:45:48 +0000 (14:45 +0000)]
Fix assertion failure in getMemOperandWithOffsetWidth

This fixes an assertion failure that triggers inside
getMemOperandWithOffset when Machine Sinking calls it on a MachineInstr
that is not a memory operation.

Different backends implement getMemOperandWithOffset differently: some
return false on non-memory MachineInstrs, others assert.

The Machine Sinking pass in at least SinkingPreventsImplicitNullCheck
relies on getMemOperandWithOffset to return false on non-memory
MachineInstrs, instead of asserting.

This patch updates the documentation on getMemOperandWithOffset that it
should return false on any MachineInstr it cannot handle, instead of
asserting. It also adapts the in-tree backends accordingly where
necessary.

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

4 years ago[lit] Remove lit's REQUIRES-ANY directive
Thomas Preud'homme [Thu, 12 Dec 2019 11:39:57 +0000 (11:39 +0000)]
[lit] Remove lit's REQUIRES-ANY directive

Summary:
Remove REQUIRES-ANY alias lit directive since it is hardly used and can
be easily implemented using an OR expression using REQUIRES. Fixup
remaining testcases still using REQUIRES-ANY.

Reviewers: probinson, jdenny, gparker42

Reviewed By: gparker42

Subscribers: eugenis, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, delcypher, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, cfe-commits, #sanitizers, llvm-commits

Tags: #llvm, #clang, #sanitizers

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

4 years ago[lldb][NFC] Remove all unnecessary includes for ClangASTSourceCommon.h
Raphael Isemann [Tue, 17 Dec 2019 10:06:01 +0000 (11:06 +0100)]
[lldb][NFC] Remove all unnecessary includes for ClangASTSourceCommon.h

These files only need the definition of ClangASTMetadata (which was
previously in the ClangASTSourceCommon.h) or don't need the include at all.

4 years ago[lldb-vscode] Centrally skip debug info variants for vscode tests
Pavel Labath [Mon, 16 Dec 2019 13:15:11 +0000 (14:15 +0100)]
[lldb-vscode] Centrally skip debug info variants for vscode tests

Previously each test was annotated manually. This does the same thing.

4 years ago[lldb][NFC] Remove implementation of GetOriginalDecl and just call GetDeclOrigin...
Raphael Isemann [Tue, 17 Dec 2019 08:55:51 +0000 (09:55 +0100)]
[lldb][NFC] Remove implementation of GetOriginalDecl and just call GetDeclOrigin instead

Those functions have the same semantics beside some small optimization of not creating
a new empty ASTContextMetadataSP value in the metadata map. We never actually hit this
optimization according to test coverage so let's just call GetDeclOrigin instead.

4 years ago[lldb] Add support for calling objc_direct methods from LLDB's expression evaluator.
Raphael Isemann [Tue, 17 Dec 2019 08:48:54 +0000 (09:48 +0100)]
[lldb] Add support for calling objc_direct methods from LLDB's expression evaluator.

Summary:
D69991 introduced `__attribute__((objc_direct))` that allows directly calling methods without message passing.
This patch adds support for calling methods with this attribute to LLDB's expression evaluator.

The patch can be summarised in that LLDB just adds the same attribute to our module AST when we find a
method with `__attribute__((objc_direct))` in our debug information.

Reviewers: aprantl, shafik

Reviewed By: shafik

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

4 years agoResubmit "[Alignment][NFC] Deprecate CreateMemCpy/CreateMemMove"
Guillaume Chatelet [Mon, 16 Dec 2019 14:24:13 +0000 (15:24 +0100)]
Resubmit "[Alignment][NFC] Deprecate CreateMemCpy/CreateMemMove"

Summary:
This is a resubmit of D71473.

This patch introduces a set of functions to enable deprecation of IRBuilder functions without breaking out of tree clients.
Functions will be deprecated one by one and as in tree code is cleaned up.

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: aaron.ballman, courbet

Subscribers: llvm-commits

Tags: #llvm

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

4 years agoRevert "[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS...
Russell Gallop [Tue, 17 Dec 2019 08:59:05 +0000 (08:59 +0000)]
Revert "[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF"

This reverts commit 2bbcf156acc157377e814fbb1828a9fe89367ea2.

This was failing on systems which use __thread such as
http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/30851

4 years ago[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF
Russell Gallop [Mon, 16 Dec 2019 15:01:22 +0000 (15:01 +0000)]
[Support] Fix time trace multi threaded support with LLVM_ENABLE_THREADS=OFF

Following on from 8ddcd1dc26ba, which added the support. As pointed out
on D71059 this does not build on some systems with LLVM_ENABLE_THREADS=OFF.

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

4 years ago[ObjC][DWARF] Emit DW_AT_APPLE_objc_direct for methods marked as __attribute__((objc_...
Raphael Isemann [Tue, 17 Dec 2019 08:36:57 +0000 (09:36 +0100)]
[ObjC][DWARF] Emit DW_AT_APPLE_objc_direct for methods marked as __attribute__((objc_direct))

Summary:
With DWARF5 it is no longer possible to distinguish normal methods and methods with `__attribute__((objc_direct))` by just looking at the debug information
as they are both now children of the of the DW_TAG_structure_type that defines them (before only the `__attribute__((objc_direct))` methods were children).

This means that in LLDB we are no longer able to create a correct Clang AST of a module by just looking at the debug information. Instead we would
need to call the Objective-C runtime to see which of the methods have a `__attribute__((objc_direct))` and then add the attribute to our own Clang AST
depending on what the runtime returns. This would mean that we either let the module AST be dependent on the Objective-C runtime (which doesn't
seem right) or we retroactively add the missing attribute to the imported AST in our expressions.

A third option is to annotate methods with `__attribute__((objc_direct))` as `DW_AT_APPLE_objc_direct` which is what this patch implements. This way
LLDB doesn't have to call the runtime for any `__attribute__((objc_direct))` method and the AST in our module will already be correct when we create it.

Reviewers: aprantl, SouraVX

Reviewed By: aprantl

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm, #debug-info

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

4 years ago[ELF] Rename .plt to .iplt and decrease EM_PPC{,64} alignment of .glink to 4
Fangrui Song [Sun, 15 Dec 2019 00:19:03 +0000 (16:19 -0800)]
[ELF] Rename .plt to .iplt and decrease EM_PPC{,64} alignment of .glink to 4

GNU ld creates the synthetic section .iplt, and has a built-in linker
script that assigns .iplt to the output section .plt . There is no
output section named .iplt .

Making .iplt an output section actually has a benefit that makes the
tricky toolchain feature stand out. Symbolizers don't have to deal with
mixed PLT entries (e.g. llvm-objdump -d incorrectly annotates such jump
targets).

On EM_PPC{,64}, .glink contains a PLT resolver and a series of jump
instructions. The 4-byte entry size makes it unnecessary to have an
alignment of 16.

Mark ppc32-gnu-ifunc.s and ppc32-gnu-ifunc-nonpreemptable.s as `XFAIL: *`.
They test IPLT on EM_PPC, which never works.

Reviewed By: peter.smith

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

4 years ago[lldb][NFC] Make clang-format happy by removing trailing space in ArchSpec.cpp
Raphael Isemann [Tue, 17 Dec 2019 08:13:23 +0000 (09:13 +0100)]
[lldb][NFC] Make clang-format happy by removing trailing space in ArchSpec.cpp

4 years ago[lit] [windows] Make sure to convert all path separators to backslashes in NT style...
Martin Storsjö [Fri, 13 Dec 2019 21:28:19 +0000 (21:28 +0000)]
[lit] [windows] Make sure to convert all path separators to backslashes in NT style \\?\... paths

E.g. the mingw python distributed in msys2 (the mingw one, which is a
normal win32 application and doesn't use the msys2 runtime itself),
despite being a normal win32 python, still uses forward slashes. This
works fine for other cases (many, but not all), but when constructing a
raw NT path, all path separators must be backslashes.

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

4 years ago[MinGW] Implicitly add .exe suffix if not provided
Martin Storsjö [Thu, 12 Dec 2019 09:08:18 +0000 (11:08 +0200)]
[MinGW] Implicitly add .exe suffix if not provided

GCC implicitly adds an .exe suffix if it is given an output file name,
but the file name doesn't contain a suffix, and there are certain
users of GCC that rely on this behaviour (and run into issues when
trying to use Clang instead of GCC). And MSVC's cl.exe also does the
same (but not link.exe).

However, GCC only does this when actually running on windows, not when
operating as a cross compiler.

As GCC doesn't have this behaviour when cross compiling, we definitely
shouldn't introduce the behaviour in such cases (as it would break
at least as many cases as this fixes).

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

4 years ago[ELF] Add IpltSection
Fangrui Song [Sat, 14 Dec 2019 22:17:35 +0000 (14:17 -0800)]
[ELF] Add IpltSection

PltSection is used by both PLT and IPLT. The PLT section may have a
header while the IPLT section does not. Split off IpltSection from
PltSection to be clearer.

Unlike other targets, PPC64 cannot use the same code sequence for PLT
and IPLT. This helps make a future PPC64 patch (D71509) more isolated.

On EM_386 and EM_X86_64, when PLT is empty while IPLT is not, currently
we are inconsistent whether the PLT header is conceptually attached to
in.plt or in.iplt .  Consistently attach the header to in.plt can make
the -z retpolineplt logic simpler. It also makes `jmp` point to an
aesthetically better place for non-retpolineplt cases.

Reviewed By: grimar, ruiu

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

4 years ago[sanitizer] Construct InternalMmapVector without memory allocation.
Igor Kudrin [Wed, 11 Dec 2019 10:37:24 +0000 (17:37 +0700)]
[sanitizer] Construct InternalMmapVector without memory allocation.

Construction of InternalMmapVector is often followed by a call to
reserve(), which may result in immediate reallocation of the memory
for the internal storage. This patch delays that allocation until
it is really needed.

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

4 years ago[MachO] Fix detecting malformed DWARF.
Igor Kudrin [Mon, 16 Dec 2019 14:16:14 +0000 (21:16 +0700)]
[MachO] Fix detecting malformed DWARF.

This fixes an invalid constant used to detect the reserved range when
reading the compilation unit header. See also: D64622 and D65039.

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

4 years ago[lldb] Fix unused variable warning in ThreadPlanStepRange.cpp
Raphael Isemann [Tue, 17 Dec 2019 07:53:00 +0000 (08:53 +0100)]
[lldb] Fix unused variable warning in ThreadPlanStepRange.cpp

This was added in 434905b97d961531286d4b49c7ee1969f7cbea0e.
Remove it to fix the compiler warnings for this.

4 years ago[LegalizeTypes] Pre-size the SmallVectors in ScalarizeVecRes_StrictFPOp and SplitVecR...
Craig Topper [Tue, 17 Dec 2019 07:35:29 +0000 (23:35 -0800)]
[LegalizeTypes] Pre-size the SmallVectors in ScalarizeVecRes_StrictFPOp and SplitVecRes_StrictFPOp so we don't have to call push_back. NFCI

This avoids grow checking/handling in each iteration of the loop.

4 years ago[LegalizeTypes] Remove ScalarizeVecRes_STRICT_FP_ROUND in favor of just using Scalari...
Craig Topper [Tue, 17 Dec 2019 07:24:22 +0000 (23:24 -0800)]
[LegalizeTypes] Remove ScalarizeVecRes_STRICT_FP_ROUND in favor of just using ScalarizeVecRes_StrictFPOp. NFCI

It looks like ScalarizeVecRes_StrictFPOp can handle a variable
number of arguments with scalar and vector types so it should
be sufficient.

4 years ago[LegalizeTypes] Remove the call to SplitVecRes_UnaryOp from SplitVecRes_StrictFPOp...
Craig Topper [Tue, 17 Dec 2019 04:52:02 +0000 (20:52 -0800)]
[LegalizeTypes] Remove the call to SplitVecRes_UnaryOp from SplitVecRes_StrictFPOp. NFCI

It doesn't seem to do anything that SplitVecRes_StrictFPOp can't
do. SplitVecRes_StrictFPOp already handles nodes with a variable
number of arguments and a mix of scalar and vector arguments.

4 years ago[MC] Delete redundant alignment update from MCELFStreamer::EmitCommonSymbol. NFC
Fangrui Song [Tue, 17 Dec 2019 07:05:23 +0000 (23:05 -0800)]
[MC] Delete redundant alignment update from MCELFStreamer::EmitCommonSymbol. NFC

EmitValueToAlignment() updates the maximum alignment.

4 years ago[NFC][Test][PowerPC] Add the test to verify the mask with constant
QingShan Zhang [Tue, 17 Dec 2019 07:04:19 +0000 (07:04 +0000)]
[NFC][Test][PowerPC] Add the test to verify the mask with constant

4 years agogn build: Merge ec4749e3b8d
LLVM GN Syncbot [Tue, 17 Dec 2019 03:51:59 +0000 (03:51 +0000)]
gn build: Merge ec4749e3b8d

4 years agoRevert "[LoopUtils] Updated deleteDeadLoop() to handle loop nest."
Whitney Tsang [Tue, 17 Dec 2019 03:50:03 +0000 (03:50 +0000)]
Revert "[LoopUtils] Updated deleteDeadLoop() to handle loop nest."

This reverts commit cd09fee3d63296dd2df0bbb1fae363ca9f311d44.
This reverts commit c066ff11d84a7797503ad5a44c4129136926dc85.

4 years ago[Attributor][NFC] Clang format the Attributor
Johannes Doerfert [Tue, 17 Dec 2019 03:03:18 +0000 (21:03 -0600)]
[Attributor][NFC] Clang format the Attributor

The Attributor is always kept formatted so diffs are cleaner.

Sometime we get out of sync for various reasons so we need to format the
file once in a while.

4 years agoCheck whether the destination is a complete type in a static_cast (or
Richard Smith [Tue, 17 Dec 2019 02:26:19 +0000 (18:26 -0800)]
Check whether the destination is a complete type in a static_cast (or
C-style cast) to an enumeration type.

We previously forgot to check this, and happened to get away with it
(with bad diagnostics) only because we misclassified incomplete
enumeration types as not being unscoped enumeration types. This also
fixes the misclassification.

4 years ago[libomptarget][nfc] Move timer functions behind target_impl
Jon Chesterfield [Tue, 17 Dec 2019 02:22:28 +0000 (02:22 +0000)]
[libomptarget][nfc] Move timer functions behind target_impl

Summary: [libomptarget][nfc] Move timer functions behind target_impl

Reviewers: jdoerfert, ABataev, grokos

Reviewed By: jdoerfert

Subscribers: jvesely, openmp-commits

Tags: #openmp

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