OSDN Git Service

android-x86/external-llvm-project.git
4 years agoPR46648: Do not eagerly instantiate default arguments for a generic
Richard Smith [Thu, 9 Jul 2020 21:11:21 +0000 (14:11 -0700)]
PR46648: Do not eagerly instantiate default arguments for a generic
lambda when instantiating a call operator specialization.

We previously incorrectly thought that such substitution was happening
in the context of substitution into a local scope, which is a context
where we should perform eager default argument instantiation.

4 years agoPush parameters into the local instantiation scope before instantiating
Richard Smith [Thu, 9 Jul 2020 21:57:30 +0000 (14:57 -0700)]
Push parameters into the local instantiation scope before instantiating
a default argument.

Default arguments can (after recent language changes) refer to
parameters of the same function. Make sure they're added to the local
instantiation scope before transforming a default argument so that we
can remap such references to them properly.

4 years agoMove default argument instantiation to SemaTemplateInstantiateDecl.cpp.
Richard Smith [Thu, 9 Jul 2020 21:31:19 +0000 (14:31 -0700)]
Move default argument instantiation to SemaTemplateInstantiateDecl.cpp.

No functionality change intended.

4 years ago[MLIR][SPIRV] Support two memory access attributes in OpCopyMemory.
ergawy [Thu, 9 Jul 2020 23:08:51 +0000 (19:08 -0400)]
[MLIR][SPIRV] Support two memory access attributes in OpCopyMemory.

This commit augments spv.CopyMemory's implementation to support 2 memory
access operands. Hence, more closely following the spec. The following
changes are introduces:

- Customize logic for spv.CopyMemory serialization and deserialization.
- Add 2 additional attributes for source memory access operand.

Reviewed By: antiagainst

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

4 years ago[AArch64][GlobalISel] Add more specific debug info tests for 613f12dd8e2403f5630ab299...
Amara Emerson [Fri, 10 Jul 2020 00:04:09 +0000 (17:04 -0700)]
[AArch64][GlobalISel] Add more specific debug info tests for 613f12dd8e2403f5630ab299d2a1bb2cb111ead1.

As requested, these tests check for specific debug locs on the output of the
legalizer. The only one that I couldn't write was for moreElementsVector, which
AFAICT we don't trigger on AArch64.

4 years ago[NFC] Derive from PassInfoMixin for no-op/printing passes
Arthur Eubanks [Thu, 9 Jul 2020 23:49:48 +0000 (16:49 -0700)]
[NFC] Derive from PassInfoMixin for no-op/printing passes

PassInfoMixin should be used for all NPM passes, rater than a custom
`name()`.

This caused ambiguous references in LegacyPassManager.cpp, so had to
remove "using namespace llvm::legacy" and move some things around.

The passes had to be moved to the llvm namespace, or else they would get
printed as "(anonymous namespace)::FooPass".

Reviewed By: ychen, asbirlea

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

4 years ago[NFC] Change getEntryForPercentile to be a static function in ProfileSummaryBuilder.
Wei Mi [Wed, 8 Jul 2020 18:19:59 +0000 (11:19 -0700)]
[NFC] Change getEntryForPercentile to be a static function in ProfileSummaryBuilder.

Change file static function getEntryForPercentile to be a static member function
in ProfileSummaryBuilder so it can be used by other files.

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

4 years ago[NFC] Extract the code to write instr profile into function writeInstrProfile
Wei Mi [Thu, 9 Jul 2020 23:12:43 +0000 (16:12 -0700)]
[NFC] Extract the code to write instr profile into function writeInstrProfile

So that the function writeInstrProfile can be used in other places.

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

4 years agoInitial boiler-plate for python bindings.
Stella Laurenzo [Tue, 7 Jul 2020 06:05:46 +0000 (23:05 -0700)]
Initial boiler-plate for python bindings.

Summary:
* Native '_mlir' extension module.
* Python mlir/__init__.py trampoline module.
* Lit test that checks a message.
* Uses some cmake configurations that have worked for me in the past but likely needs further elaboration.

Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, stephenneuendorffer, Joonsoo, grosul1, Kayjukh, jurahul, msifontes

Tags: #mlir

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

4 years ago[AArch64][SVE] Add lowering for llvm.fma.
Eli Friedman [Thu, 9 Jul 2020 00:05:56 +0000 (17:05 -0700)]
[AArch64][SVE] Add lowering for llvm.fma.

This is currently bare-bones; we aren't taking advantage of any of the
FMA variant instructions.  But it's enough to at least generate
code.

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

4 years ago[flang] ifdef to avoid warning about supposedly dead function
Eric Schweitz [Thu, 9 Jul 2020 23:08:45 +0000 (16:08 -0700)]
[flang] ifdef to avoid warning about supposedly dead function

4 years ago[flang] Fix frontend build with -DBUILD_SHARED_LIBS=On
peter klausler [Thu, 9 Jul 2020 18:08:41 +0000 (11:08 -0700)]
[flang] Fix frontend build with -DBUILD_SHARED_LIBS=On

Fix fronted shared library builds by eliminating dependences of
the parser on other component libraries, moving some code around that
wasn't in the right library, and making some dependences
explicit in the CMakeLists.txt files.  The lowering library
does not yet build as a shared library due to some undefined
names.

Reviewed By: tskeith

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

4 years agoRevert "[Lexer] Fix missing coverage line after #endif"
Zequan Wu [Thu, 9 Jul 2020 22:49:56 +0000 (15:49 -0700)]
Revert "[Lexer] Fix missing coverage line after #endif"

This reverts commit 672ae621e91ff5cdefb2535bdd530641536685ea.

4 years ago[flang] Fix a crash when creating generics from a copy
Pete Steinfeld [Thu, 9 Jul 2020 16:38:22 +0000 (09:38 -0700)]
[flang] Fix a crash when creating generics from a copy

Summary:
When a program unit creates a generic based on one defined in a module, the
function `CopyFrom()` is called to create the `GenericDetails`.  This function
copied the `specificProcs_` but failed to copy the `bindingNames_`.  If the
function `CheckGeneric()` then gets called, it tries to index into the empty
binding names and causes the crash.

I fixed this by adding code to `CopyFrom()` to copy the binding names.

I also added a test that causes the crash.

Reviewers: klausler, tskeith, DavidTruby

Subscribers: llvm-commits

Tags: #llvm, #flang

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

4 years agoSwitch to using -debug-info-kind=constructor as default (from =limited)
Amy Huang [Wed, 29 Apr 2020 23:21:05 +0000 (16:21 -0700)]
Switch to using -debug-info-kind=constructor as default (from =limited)

Summary:
-debug-info-kind=constructor reduces the amount of class debug info that
is emitted; this patch switches to using this as the default.

Constructor homing emits the complete type info for a class only when the
constructor is emitted, so it is expected that there will be some classes that
are not defined in the debug info anymore because they are never constructed,
and we shouldn't need debug info for these classes.

I compared the PDB files for clang, and there are 273 class types that are defined with `=limited`
but not with `=constructor` (out of ~60,000 total class types).
We've looked at a number of the types that are no longer defined with =constructor. The vast
majority of cases are something like class A is used as a parameter in a member function of
some other class B, which is emitted. But the function that uses class A is never called, and class A
is never constructed, and therefore isn't emitted in the debug info.

Bug: https://bugs.llvm.org/show_bug.cgi?id=46537

Subscribers: aprantl, cfe-commits, lldb-commits

Tags: #clang, #lldb

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

4 years ago[Lexer] Fix missing coverage line after #endif
Zequan Wu [Thu, 9 Jul 2020 21:56:06 +0000 (14:56 -0700)]
[Lexer] Fix missing coverage line after #endif

Summary: bug reported here: https://bugs.llvm.org/show_bug.cgi?id=46660

Reviewers: vsk, efriedma, arphaman

Reviewed By: vsk

Subscribers: dexonsmith, cfe-commits

Tags: #clang

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

4 years ago[PowerPC][Power10] Add Instruction definition/MC Tests for Load/Store Rightmost VSX...
Albion Fung [Thu, 9 Jul 2020 22:03:41 +0000 (17:03 -0500)]
[PowerPC][Power10] Add Instruction definition/MC Tests for Load/Store Rightmost VSX Vector

This patch adds the instruction definitions and the assembly/disassembly
tests for the Load/Store VSX Vector Rightmose instructions.

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

4 years ago[FileCheck] Improve -dump-input documentation
Joel E. Denny [Thu, 9 Jul 2020 21:31:31 +0000 (17:31 -0400)]
[FileCheck] Improve -dump-input documentation

Document the default of `fail` in `-help`.  Extend `-dump-input=help`
to help users find related command-line options, but let `-help`
provide their full documentation.

Reviewed By: probinson

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

4 years agoRecommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser...
Craig Topper [Thu, 9 Jul 2020 21:52:16 +0000 (14:52 -0700)]
Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def."

This time without the change to make operator| use operator&=.
That seems to be the source of the gcc 5.3 miscompile.

Original commit message:
These represent the same thing but 64BIT only showed up from
getHostCPUFeatures providing a list of featuers to clang. While
EM64T showed up from getting the features for a named CPU.

EM64T didn't have a string specifically so it would not be passed
up to clang when getting features for a named CPU. While 64bit
needed a name since that's how it is index.

Merge them by filtering 64bit out before sending features to clang
for named CPUs.

4 years ago[AMDGPU] Return restricted number of regs from TTI
Stanislav Mekhanoshin [Thu, 18 Jun 2020 23:32:17 +0000 (16:32 -0700)]
[AMDGPU] Return restricted number of regs from TTI

This is practically NFC at the moment because nothing really
asks the real number or does anything useful with it.

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

4 years ago[DAGCombiner] convert if-chain in store merging to switch; NFC
Sanjay Patel [Thu, 9 Jul 2020 15:53:51 +0000 (11:53 -0400)]
[DAGCombiner] convert if-chain in store merging to switch; NFC

4 years ago[DAGCombiner] add helper function for store merging of loaded values; NFC
Sanjay Patel [Thu, 9 Jul 2020 15:42:52 +0000 (11:42 -0400)]
[DAGCombiner] add helper function for store merging of loaded values; NFC

4 years ago[DAGCombiner] add helper function for store merging of extracts; NFC
Sanjay Patel [Thu, 9 Jul 2020 14:33:31 +0000 (10:33 -0400)]
[DAGCombiner] add helper function for store merging of extracts; NFC

4 years ago[DAGCombiner] add helper function for store merging of constants; NFC
Sanjay Patel [Thu, 9 Jul 2020 14:02:16 +0000 (10:02 -0400)]
[DAGCombiner] add helper function for store merging of constants; NFC

4 years ago[DAGCombiner] add helper function to manage list of consecutive stores; NFC
Sanjay Patel [Wed, 8 Jul 2020 21:09:58 +0000 (17:09 -0400)]
[DAGCombiner] add helper function to manage list of consecutive stores; NFC

4 years ago[PredicateInfo] Print RenamedOp (NFC)
Nikita Popov [Thu, 9 Jul 2020 20:58:45 +0000 (22:58 +0200)]
[PredicateInfo] Print RenamedOp (NFC)

Make it easier to debug renaming issues.

4 years agoRevert "[CallGraph] Ignore callback uses"
Roman Lebedev [Thu, 9 Jul 2020 21:00:26 +0000 (00:00 +0300)]
Revert "[CallGraph] Ignore callback uses"

This likely has broken test/Transforms/Attributor/IPConstantProp/ tests.
http://45.33.8.238/linux/22502/step_12.txt

This reverts commit 205dc0922d5f7305226f7457fcbcb4224c92530c.

4 years agoTemporarily Revert "Fix [-Werror,-Wsign-compare] warnings arising from subsection...
Eric Christopher [Thu, 9 Jul 2020 20:46:59 +0000 (13:46 -0700)]
Temporarily Revert "Fix [-Werror,-Wsign-compare] warnings arising from subsection symbols patch."
as it's causing build errors with another clang so I'll need to approach
this differently.

This reverts commit c2827083166cd5150232d8fd3ada3cf8fa8c9ac3.

4 years agoTemporarily Revert "[PowerPC] Split s34imm into two types"
Eric Christopher [Thu, 9 Jul 2020 20:28:22 +0000 (13:28 -0700)]
Temporarily Revert "[PowerPC] Split s34imm into two types"
as it was failing in Release+Asserts mode with an assert.

This reverts commit bd2068031121adf5a0e28d9306a1741d6f0bbd87.

4 years agoRevert D83013 "[LPM] Port CGProfilePass from NPM to LPM"
Fangrui Song [Thu, 9 Jul 2020 20:34:04 +0000 (13:34 -0700)]
Revert D83013 "[LPM] Port CGProfilePass from NPM to LPM"

This reverts commit c92a8c0a0f68fbbb23e3fdde071007e63a552e82.

It breaks builds and has unaddressed review comments.

4 years ago[CallGraph] Ignore callback uses
Giorgis Georgakoudis [Wed, 8 Jul 2020 05:43:24 +0000 (22:43 -0700)]
[CallGraph] Ignore callback uses

Summary:
Ignore callback uses when adding a callback function
in the CallGraph. Callback functions are typically
created when outlining, e.g. for OpenMP, so they have
internal scope and linkage. They should not be added
to the ExternalCallingNode since they are only callable
by the specified caller function at creation time.

A CGSCC pass, such as OpenMPOpt, may need to update
the CallGraph by adding a new outlined callback function.
Without ignoring callback uses, adding breaks CGSCC
pass restrictions and results to a broken CallGraph.

Reviewers: jdoerfert

Subscribers: hiraditya, sstefan1, llvm-commits

Tags: #llvm

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

4 years ago[llvm-reduce] Reducing attributes
Roman Lebedev [Thu, 9 Jul 2020 20:06:59 +0000 (23:06 +0300)]
[llvm-reduce] Reducing attributes

Summary:
This handles all three places where attributes could currently be - `GlobalVariable`, `Function` and `CallBase`.
For last two, it correctly handles all three possible attribute locations (return value, arguments and function itself)

There was a previous attempt at it D73853,
which was committed in rGfc62b36a000681c01e993242b583c5ec4ab48a3c,
but then reverted all the way back in rGb12176d2aafa0ccb2585aa218fc3b454ba84f2a9
due to some (osx?) test failures.

Reviewers: nickdesaulniers, dblaikie, diegotf, george.burgess.iv, jdoerfert, Tyker, arsenm

Reviewed By: nickdesaulniers

Subscribers: wdng, MaskRay, arsenm, llvm-commits, mgorny

Tags: #llvm

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

4 years ago[NFC][llvm-reduce] Purify for_each usage in Operand Bundles into range-based for...
Roman Lebedev [Thu, 9 Jul 2020 20:06:49 +0000 (23:06 +0300)]
[NFC][llvm-reduce] Purify for_each usage in Operand Bundles into range-based for loop

Summary:
As per lengthy/heated disscussion in D83351,
and CodingStandards D83431.

Reviewers: dblaikie, nickdesaulniers

Reviewed By: nickdesaulniers

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[NFCI][llvm-reduce] OperandBundleCounter: drop pointless constructor
Roman Lebedev [Thu, 9 Jul 2020 20:06:30 +0000 (23:06 +0300)]
[NFCI][llvm-reduce] OperandBundleCounter: drop pointless constructor

Reviewers: nickdesaulniers, dblaikie

Reviewed By: nickdesaulniers

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[Docs] CodingStandards: for_each is discouraged
Roman Lebedev [Thu, 9 Jul 2020 20:06:20 +0000 (23:06 +0300)]
[Docs] CodingStandards: for_each is discouraged

Summary:
As per disscussion in D83351, using `for_each` is potentially confusing,
at least in regards to inconsistent style (there's less than 100 `for_each`
usages in LLVM, but ~100.000 `for` range-based loops

Therefore, it should be avoided.

Reviewers: dblaikie, nickdesaulniers

Reviewed By: dblaikie, nickdesaulniers

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

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

4 years agoRevert "[InstCombine] Lower infinite combine loop detection thresholds"
Roman Lebedev [Thu, 9 Jul 2020 20:04:26 +0000 (23:04 +0300)]
Revert "[InstCombine] Lower infinite combine loop detection thresholds"

And just after 3 days, we have a hit in `InstCombiner::mergeStoreIntoSuccessor()`:
https://bugs.llvm.org/show_bug.cgi?id=46661

To be recommitted once that is addressed.

This reverts commit cd7f8051ac7b6f08734102446482c1e5d951bfcc.

4 years ago[CMake][Fuchsia] Support for building with MSVC
Petr Hosek [Fri, 31 Jan 2020 22:42:22 +0000 (14:42 -0800)]
[CMake][Fuchsia] Support for building with MSVC

This change adds the necessary flags for building the full Fuchsia
toolchain on Windows with MSVC.

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

4 years ago[LPM] Port CGProfilePass from NPM to LPM
Zequan Wu [Wed, 8 Jul 2020 19:30:28 +0000 (12:30 -0700)]
[LPM] Port CGProfilePass from NPM to LPM

Reviewers: hans, chandlerc!, asbirlea, nikic

Reviewed By: hans, nikic

Subscribers: steven_wu, dexonsmith, nikic, echristo, void, zhizhouy, cfe-commits, aeubanks, MaskRay, jvesely, nhaehnle, hiraditya, kerbowa, llvm-commits

Tags: #llvm, #clang

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

4 years ago[SVE] Remove calls to VectorType::getNumElements from CodeGen
Christopher Tetreault [Thu, 9 Jul 2020 18:51:03 +0000 (11:51 -0700)]
[SVE] Remove calls to VectorType::getNumElements from CodeGen

Reviewers: efriedma, fpetrogalli, sdesmalen, RKSimon, arsenm

Reviewed By: RKSimon

Subscribers: wdng, tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[InstSimplify] Re-enable select ?, undef, X -> X transform when X is provably not...
Craig Topper [Thu, 9 Jul 2020 19:20:50 +0000 (12:20 -0700)]
[InstSimplify] Re-enable select ?, undef, X -> X transform when X is provably not poison

Follow up from the transform being removed in D83360. If X is probably not poison, then the transform is safe.

Still plan to remove or adjust the code from ConstantFolding after this.

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

4 years ago[libc++] Get rid of the %{libcxx_src_root} substitution
Louis Dionne [Thu, 9 Jul 2020 19:15:26 +0000 (15:15 -0400)]
[libc++] Get rid of the %{libcxx_src_root} substitution

This reduces the set of substitutions required to run the test suite.

4 years ago[Clang][Driver] Recognize the AIX OBJECT_MODE environment setting
David Tenty [Thu, 9 Jul 2020 19:10:19 +0000 (15:10 -0400)]
[Clang][Driver] Recognize the AIX OBJECT_MODE environment setting

Summary:
AIX uses an environment variable called OBJECT_MODE to indicate to
utilities in the toolchain whether they should be operating in 32-bit or
64-bit mode. This patch makes the clang driver recognize the current
OBJECT_MODE setting when we are operating with an AIX target and adds a
custom diagnostic for invalid settings.

For more details about OBJECT_MODE on AIX see:

https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.3/com.ibm.xlc1313.aix.doc/compiler_ref/tusetenv1.html
https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.3/com.ibm.xlc1313.aix.doc/compiler_ref/opt_3264.html

Reviewers: stevewan, hubert.reinterpretcast, ShuhongL, jasonliu

Reviewed By: hubert.reinterpretcast, jasonliu

Subscribers: jasonliu, cfe-commits

Tags: #clang

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

4 years ago[MLIR] IR changes to add yield semantics for affine.if and affine.parallel
Jeremy Bruestle [Thu, 9 Jul 2020 19:02:20 +0000 (12:02 -0700)]
[MLIR] IR changes to add yield semantics for affine.if and affine.parallel

Reviewed By: bondhugula, flaub

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

4 years ago[AST][test] Add regression test forPointerExprEvaluator::VisitCXXNewExpr
Jan Korous [Thu, 9 Jul 2020 19:06:01 +0000 (12:06 -0700)]
[AST][test] Add regression test forPointerExprEvaluator::VisitCXXNewExpr

This assert was failing:
assert(CAT && "unexpected type for array initializer");

until this patch landed:
9a7eda1bece887ca9af085d79fe6e4fb8826dcda
PR45350: Handle unsized array CXXConstructExprs in constant evaluation

4 years ago[NFC][AArch64] Refactor getArgumentPopSize
Kyungwoo Lee [Thu, 9 Jul 2020 18:42:50 +0000 (11:42 -0700)]
[NFC][AArch64] Refactor getArgumentPopSize

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

4 years ago[LLDB/Reproducers] Add flag to avoid installing the signal handler.
Jonas Devlieghere [Thu, 9 Jul 2020 18:47:56 +0000 (11:47 -0700)]
[LLDB/Reproducers] Add flag to avoid installing the signal handler.

There are bugs where you don't want the signal handler to trigger, most
notably when that will cause another crash. Examples of this are lldb
running out of memory or a bug in the reproducer generation code. This
adds an escape hatch trough a (developer oriented) flag to not install
the signal handler.

rdar://problem/65149595

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

4 years ago[lldb/Reproducers] Rename developer-oriented reproducer flags.
Jonas Devlieghere [Thu, 9 Jul 2020 17:35:16 +0000 (10:35 -0700)]
[lldb/Reproducers] Rename developer-oriented reproducer flags.

This is a preparatory rename of the developer facing reproducer flags.

reproducer-skip-version-check -> reproducer-no-version-check
reproducer-auto-generate      -> reproducer-generate-on-quit

4 years ago[NFC][test] Adding fastcc test case for promoted 16-bit integer bitcasts.
Puyan Lotfi [Thu, 9 Jul 2020 18:35:00 +0000 (11:35 -0700)]
[NFC][test] Adding fastcc test case for promoted 16-bit integer bitcasts.

The following: https://reviews.llvm.org/D82552

fixed an assert in the SelectionDag ISel legalizer for some CCs on armv7.

I noticed that this fix also fixes the assert when using fastcc, so I am
adding a fastcc regression test here.

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

4 years ago[OPENMP50] extend array section for stride (Parsing/Sema/AST)
cchen [Thu, 9 Jul 2020 18:27:32 +0000 (13:27 -0500)]
[OPENMP50] extend array section for stride (Parsing/Sema/AST)

Reviewers: ABataev, jdoerfert

Reviewed By: ABataev

Subscribers: yaxunl, guansong, arphaman, sstefan1, cfe-commits, sandoval, dreachem

Tags: #clang

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

4 years ago[libc++] The enable_experimental Lit feature should be False by default
Louis Dionne [Thu, 9 Jul 2020 18:21:24 +0000 (14:21 -0400)]
[libc++] The enable_experimental Lit feature should be False by default

This preserves existing behavior before f5f58f1f733b.

4 years agoFix [-Werror,-Wsign-compare] warnings arising from subsection symbols patch.
Eric Christopher [Thu, 9 Jul 2020 18:13:03 +0000 (11:13 -0700)]
Fix [-Werror,-Wsign-compare] warnings arising from subsection symbols patch.

4 years ago[InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non...
Craig Topper [Thu, 9 Jul 2020 18:01:11 +0000 (11:01 -0700)]
[InstSimplify] Don't fold vectors of partial undef in SimplifySelectInst if the non-undef element value might produce poison

We can't fold to the non-undef value unless we know it isn't poison. So check each element with isGuaranteedNotToBeUndefOrPoison. This currently rules out all constant expressions.

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

4 years ago[libc++] Move the enable_experimental Lit param to the DSL
Louis Dionne [Thu, 9 Jul 2020 17:42:32 +0000 (13:42 -0400)]
[libc++] Move the enable_experimental Lit param to the DSL

4 years ago[X86] Immediately call LowerShift from lowerBuildVectorToBitOp.
Craig Topper [Thu, 9 Jul 2020 17:41:03 +0000 (10:41 -0700)]
[X86] Immediately call LowerShift from lowerBuildVectorToBitOp.

If we don't immediately lower the vector shift, the splat
constant vector we created may get turned into a constant pool
load before we get around to lowering the shift. This makes it
a lot more difficult to create a shift by constant. Sometimes we
fail to see through the constant pool at all and end up trying
to lower as if it was a variable shift. This requires custom
handling and may create an unsupported vselect on pre-sse-4.1
targets. Since we're after LegalizeVectorOps we are unable to
legalize the unsupported vselect as that code is in LegalizeVectorOps
rather than LegalizeDAG.

So calling LowerShift immediately ensures that we get see the
splat constant.

Fixes PR46527.

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

4 years agoRemove unnecessary 'rm' in llvm-reduce tests
David Blaikie [Thu, 9 Jul 2020 17:48:10 +0000 (10:48 -0700)]
Remove unnecessary 'rm' in llvm-reduce tests

These were initially added to cleanup some transient/leftover files in
r372054. Now that's all cleaned up, these are no longer needed.

4 years ago[PGO][PGSO] Add profile guided size optimization to X86 ISel Lowering.
Hiroshi Yamauchi [Thu, 9 Jul 2020 17:19:00 +0000 (10:19 -0700)]
[PGO][PGSO] Add profile guided size optimization to X86 ISel Lowering.

4 years ago[X86] Directly emit X86ISD::BLENDV instead of VSELECT in a few places that were emitt...
Craig Topper [Thu, 9 Jul 2020 17:28:42 +0000 (10:28 -0700)]
[X86] Directly emit X86ISD::BLENDV instead of VSELECT in a few places that were emitting sign bit tests.

Technically a VSELECT expects a vector of all 1s or 0s elements
for its condition. But we aren't guaranteeing that the sign bit
and the non sign bits match in these locations. So we should use
BLENDV which is more relaxed.

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

4 years ago[PowerPC] Fix test case from beb52b12cb17
Stefan Pintilie [Thu, 9 Jul 2020 17:26:53 +0000 (12:26 -0500)]
[PowerPC] Fix test case from beb52b12cb17

Forgot to add the REQUIRES ppc line to the test.

4 years ago[libc++] Clean up some outdated documentation about running libc++ tests
Louis Dionne [Thu, 9 Jul 2020 17:35:01 +0000 (13:35 -0400)]
[libc++] Clean up some outdated documentation about running libc++ tests

The documentation is still awfully outdated, but it's a bit better at least.

4 years ago[lldb/Function] Reflow doxygen comments for member variables, NFC
Vedant Kumar [Thu, 9 Jul 2020 17:36:48 +0000 (10:36 -0700)]
[lldb/Function] Reflow doxygen comments for member variables, NFC

As suggested in the review for https://reviews.llvm.org/D83359.

4 years ago[Function] Lock the function when parsing call site info
Vedant Kumar [Tue, 7 Jul 2020 23:54:09 +0000 (16:54 -0700)]
[Function] Lock the function when parsing call site info

Summary:
DWARF-parsing methods in SymbolFileDWARF which update module state
typically take the module lock. ParseCallEdgesInFunction doesn't do
this, but higher-level locking within lldb::Function (which owns the
storage for parsed call edges) is necessary.

The lack of locking could explain some as-of-yet unreproducible crashes
which occur in Function::GetTailCallingEdges(). In these crashes, the
`m_call_edges` vector is non-empty but contains a nullptr, which
shouldn't be possible. (If this vector is non-empty, it _must_ contain a
non-null unique_ptr.)

This may address rdar://55622443 and rdar://65119458.

Reviewers: jasonmolenda, friss, jingham

Subscribers: aprantl, lldb-commits

Tags: #lldb

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

4 years ago[ValueLattice] Simplify canTrackGlobalVariableInterprocedurally (NFC).
Florian Hahn [Thu, 9 Jul 2020 17:31:23 +0000 (18:31 +0100)]
[ValueLattice] Simplify canTrackGlobalVariableInterprocedurally (NFC).

using all_of and checking for valid users in the lambda seems more
straight forward. Also adds a comment explaining what we are checking.

4 years agoMerge TableGen files used for clang options
Daniel Grumberg [Thu, 25 Jun 2020 12:34:22 +0000 (13:34 +0100)]
Merge TableGen files used for clang options

Summary:
Putting all the options in the same file is needed so they can be
ordered based on the dependencies between them.

Reviewers: Bigcheese, jdoerfert

Subscribers: dexonsmith, sstefan1, cfe-commits

Tags: #clang

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

4 years ago[libc++] Move the long_tests Lit feature to the DSL
Louis Dionne [Thu, 9 Jul 2020 17:25:27 +0000 (13:25 -0400)]
[libc++] Move the long_tests Lit feature to the DSL

4 years ago[libc++] Move the stdlib Lit parameter to the DSL
Louis Dionne [Thu, 9 Jul 2020 17:18:24 +0000 (13:18 -0400)]
[libc++] Move the stdlib Lit parameter to the DSL

4 years ago[libc++] Fix test failure in C++03 mode
Louis Dionne [Thu, 9 Jul 2020 17:03:00 +0000 (13:03 -0400)]
[libc++] Fix test failure in C++03 mode

4 years ago[PGO][PGSO] Add profile guided size optimization tests to X86 ISel Lowering.
Hiroshi Yamauchi [Wed, 8 Jul 2020 21:00:15 +0000 (14:00 -0700)]
[PGO][PGSO] Add profile guided size optimization tests to X86 ISel Lowering.

4 years ago[compiler-rt] [test] Allow expanding lit substitutions recursively
Sergej Jaskiewicz [Thu, 9 Jul 2020 16:46:20 +0000 (19:46 +0300)]
[compiler-rt] [test] Allow expanding lit substitutions recursively

Summary:
This allows using lit substitutions in the `COMPILER_RT_EMULATOR` variable.

(For reference, the ability to expand substitutions recursively has been introduced in https://reviews.llvm.org/D76178.)

Reviewers: phosek, compnerd

Reviewed By: compnerd

Subscribers: dberris, #sanitizers

Tags: #sanitizers

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

4 years ago[runtimes] Allow passing Lit parameters through CMake
Louis Dionne [Thu, 9 Jul 2020 15:54:09 +0000 (11:54 -0400)]
[runtimes] Allow passing Lit parameters through CMake

This allows passing parameters to the test suites without using
LLVM_LIT_ARGS. The problem is that we sometimes want to set some
Lit arguments on the CMake command line, but the Lit parameters in
a CMake cache file. If the only knob to do that is LLVM_LIT_ARGS,
the command-line entry overrides the cache one, and the parameters
set by the cache are ignored.

This fixes a current issue with the build bots that they completely
ignore the 'std' param set by Lit, because other Lit arguments are
provided via LLVM_LIT_ARGS on the CMake command-line.

4 years ago[compiler-rt] [test] Use the parent process env as base env in tests
Sergej Jaskiewicz [Thu, 9 Jul 2020 16:42:08 +0000 (19:42 +0300)]
[compiler-rt] [test] Use the parent process env as base env in tests

Summary:
Right now the lit config builds up an environment that the tests will be run in. However, it does it from scratch instead of adding new variables to the parent process environment. This may (and does) result in strange behavior when running tests with an executor (i. e. with the `COMPILER_RT_EMULATOR` CMake variable set to something), since the executor may need some of the parent process's environment variables.

Here this is fixed.

Reviewers: compnerd, phosek

Reviewed By: compnerd

Subscribers: dberris, #sanitizers

Tags: #sanitizers

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

4 years ago[lldb] Use enum constant instead of raw value
Fred Riss [Thu, 9 Jul 2020 16:43:02 +0000 (09:43 -0700)]
[lldb] Use enum constant instead of raw value

4 years ago[compiler-rt] Better Windows support for running tests in external shell
Sergej Jaskiewicz [Thu, 9 Jul 2020 16:36:15 +0000 (19:36 +0300)]
[compiler-rt] Better Windows support for running tests in external shell

Summary:
These changes are necessary to support remote running compiler-rt tests
that were compiled on Windows.

Most of the code here has been copy-pasted from other lit configs.

Why do we remove the conversions to ASCII in the crt config?

We set the `universal_newlines` argument to `True` in `Popen` instead.
This is supported in both Python 2.7 and 3, is easier
(no need to do the `str(dir.decode('ascii'))` dance) and less
error prone.

Also, this is necessary because if the config is executed on Windows,
and `execute_external` is `True`, we take the branch
`if sys.platform in ['win32'] and execute_external`,
and if we use Python 3, then the `dir` variable is a byte-like object,
not str, but the ``replace method on byte-like objects requires its
arguments to also be byte-like objects, which is incompatible with
Python 2 etc etc.

It is a lot simpler to just work with strings in the first place, which
is achieved by setting `universal_newlines` to `True`. As far as
I understand, this way wasn't taken because of the need to support
Python <2.7, but this is not the case now.

Reviewers: compnerd, phosek, weimingz

Reviewed By: compnerd

Subscribers: dberris, #sanitizers

Tags: #sanitizers

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

4 years ago[AliasSetTracker] More precise AAInfo intersection check
Nikita Popov [Wed, 8 Jul 2020 20:28:29 +0000 (22:28 +0200)]
[AliasSetTracker] More precise AAInfo intersection check

The code currently checks whether the intersection has one of TBAA,
Scope or NoAlias unset -- however, those might have already been
unset in the first place, in which case we will unnecessarily
report a change. Instead, compare the intersection result to the
original AAInfo.

This makes for a 0.5% geomean compile-time saving on CTMark.

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

4 years ago[PowerPC] Split s34imm into two types
Stefan Pintilie [Thu, 9 Jul 2020 16:28:32 +0000 (11:28 -0500)]
[PowerPC] Split s34imm into two types

Currently the instruction paddi always takes s34imm as the type for the
34 bit immediate. However, the PC Relative form of the instruction should
not produce the same fixup as the non PC Relative form.
This patch splits the s34imm type into s34imm and s34imm_pcrel so that two
different fixups can be emitted.

Reviewed By: kamaub, nemanjai

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

4 years ago[SCCP] Move tests using only ipsccp from IPConstantProp to SCCP (NFC).
Florian Hahn [Thu, 9 Jul 2020 16:12:17 +0000 (17:12 +0100)]
[SCCP] Move tests using only ipsccp from IPConstantProp to SCCP (NFC).

Some of the tests in the llvm/test/Transforms/IPConstantProp directory
actually only use -ipsccp. Those tests belong to the other (IP)SCCP
tests in llvm/test/Transforms/SCCP/ and this commits moves them there to
avoid confusion with IPConstantProp.

4 years agoRevert 51b0da73 "Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in...
Hans Wennborg [Thu, 9 Jul 2020 15:47:35 +0000 (17:47 +0200)]
Revert 51b0da73 "Recommit "[X86] Merge the FEATURE_64BIT and FEATURE_EM64T bits in X86TargetParser.def.""

It gets miscompiled with GCC 5.3, causing Clang to crash with
"error: unknown target CPU 'x86-64'"

See the llvm-commits thread for reproduction steps.

This reverts commit 51b0da731af75c68dd521e04cc576d5a611b1612.

4 years agoRefactored NumericLiteralParser to not require a Preprocessor
Dmitri Gribenko [Thu, 9 Jul 2020 15:09:57 +0000 (17:09 +0200)]
Refactored NumericLiteralParser to not require a Preprocessor

Summary:
We would like to use NumericLiteralParser in the implementation of the
syntax tree builder, and plumbing a preprocessor there seems
inconvenient and superfluous.

Reviewers: eduucaldas

Reviewed By: eduucaldas

Subscribers: gribozavr2, cfe-commits

Tags: #clang

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

4 years ago[MSP430] Align the _Complex ABI with current msp430-gcc
Anatoly Trosinenko [Thu, 9 Jul 2020 14:25:32 +0000 (17:25 +0300)]
[MSP430] Align the _Complex ABI with current msp430-gcc

Assembler output is checked against msp430-gcc 9.2.0.50 from TI.

Reviewed By: asl

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

4 years ago[MLIR][SPIRVToLLVM] Conversion of SPIR-V array, runtime array, and pointer types
George Mitenkov [Thu, 9 Jul 2020 14:48:50 +0000 (17:48 +0300)]
[MLIR][SPIRVToLLVM] Conversion of SPIR-V array, runtime array, and pointer types

This patch adds type conversion for 4 SPIR-V types: array, runtime array, pointer
and struct. This conversion is integrated using a separate function
`populateSPIRVToLLVMTypeConversion()` that adds new type conversions. At the moment,
this is a basic skeleton that allows to perfom conversion from SPIR-V array,
runtime array and pointer types to LLVM typesystem. There is no support of array
strides or storage classes. These will be supported on the case by case basis.

Reviewed By: antiagainst

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

4 years agoFix warning caused by __builtin_expect_with_probability was not handled
Zhi Zhuang [Thu, 9 Jul 2020 14:10:14 +0000 (07:10 -0700)]
Fix warning caused by __builtin_expect_with_probability was not handled
in places such as constant folding

Previously some places that should have handled
__builtin_expect_with_probability is missing, so in some case it acts
differently than __builtin_expect.
For example it was not handled in constant folding, thus in the
following program, the "if" condition should be constantly true and
folded, but previously it was not handled and cause warning "control may
reach end of non-void function" (while __builtin_expect does not):

__attribute__((noreturn)) extern void bar();
int foo(int x, int y) {
  if (y) {
    if (__builtin_expect_with_probability(1, 1, 1))
      bar();
  }
  else
    return 0;
}

Now it's fixed.

Differential Revisions: https://reviews.llvm.org/D83362

4 years ago[PowerPC] Support PCRelative Callees for R_PPC64_REL24 Relocation
Stefan Pintilie [Thu, 9 Jul 2020 14:50:19 +0000 (09:50 -0500)]
[PowerPC] Support PCRelative Callees for R_PPC64_REL24 Relocation

The R_PPC64_REL24 is used in function calls when the caller requires a
valid TOC pointer. If the callee shares the same TOC or does not clobber
the TOC pointer then a direct call can be made. If the callee does not
share the TOC a thunk must be added to save the TOC pointer for the caller.

Up until PC Relative was introduced all local calls on medium and large code
models were assumed to share a TOC. This is no longer the case because
if the caller requires a TOC and the callee is PC Relative then the callee
can clobber the TOC even if it is in the same DSO.

This patch is to add support for a TOC caller calling a PC Relative callee that
clobbers the TOC.

Reviewed By: sfertile, MaskRay

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

4 years ago[MLIR][SPIRVToLLVM] SPIR-V types size in bytes function
George Mitenkov [Thu, 9 Jul 2020 14:20:38 +0000 (17:20 +0300)]
[MLIR][SPIRVToLLVM] SPIR-V types size in bytes function

Added `getSizeInBytes()` function as a class member to several SPIR-V types:
`ScalarType`, `ArrayType` and `VectorType`. This function aims at exposing
the functionality of `getTypeNumBytes()` from `SPIRVLowering.cpp`. Support
of more types will be added on demand.

Reviewed By: antiagainst

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

4 years ago[flang] partially revert upstreamed code to support complex values in runtime support...
Eric Schweitz [Thu, 9 Jul 2020 14:39:44 +0000 (07:39 -0700)]
[flang] partially revert upstreamed code to support complex values in runtime support to avoid warnings.

4 years ago[NFC] Add SExt multiuses test
Diogo Sampaio [Thu, 9 Jul 2020 14:30:24 +0000 (15:30 +0100)]
[NFC] Add SExt multiuses test

4 years agoAMDGPU/GlobalISel: Work around verifier error in test
Matt Arsenault [Thu, 9 Jul 2020 14:22:22 +0000 (10:22 -0400)]
AMDGPU/GlobalISel: Work around verifier error in test

The unfortunate split between finalizeLowering and the selector pass
means there's a point where the verifier fails. The DAG selector pass
skips the verifier, but this seems to not work when using the
GlobalISel fallback.

4 years agoFix MSVC "not all control paths return a value" warning. NFC.
Simon Pilgrim [Thu, 9 Jul 2020 14:00:57 +0000 (15:00 +0100)]
Fix MSVC "not all control paths return a value" warning. NFC.

4 years ago[BasicAA] Enable -basic-aa-recphi by default
David Green [Thu, 9 Jul 2020 12:06:51 +0000 (13:06 +0100)]
[BasicAA] Enable -basic-aa-recphi by default

This option was added a while back, to help improve AA around pointer
phi loops. It looks for phi(gep(phi, const), x) loops, checking if x can
then prove more precise aliasing info.

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

4 years agoOpaquePtr: Don't check pointee type for byval/preallocated
Matt Arsenault [Fri, 26 Jun 2020 15:36:22 +0000 (11:36 -0400)]
OpaquePtr: Don't check pointee type for byval/preallocated

Since none of these users really care about the actual type, hide the
type under a new size-getting attribute to go along with
hasPassPointeeByValueAttr. This will work better for the future byref
attribute, which may end up only tracking the byte size and not the IR
type.

We currently have 3 parameter attributes that should carry the type
(technically inalloca does not yet). The APIs are somewhat awkward
since preallocated/inalloca piggyback on byval in some places, but in
others are treated as distinct attributes. Since these are all
mutually exclusive, we should probably just merge all the attribute
infrastructure treating these as totally distinct attributes.

4 years ago[analyzer] Add CTUImportCppThreshold for C++ files
Gabor Marton [Thu, 9 Jul 2020 12:26:23 +0000 (14:26 +0200)]
[analyzer] Add CTUImportCppThreshold for C++ files

Summary:
The default CTUImportThreshold (8) seems to be too conservative with C projects.
We increase this value to 24 and we introduce another threshold for C++ source
files (defaulted to 8) because their AST is way more compilcated than C source
files.

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

4 years agomake -fmodules-codegen and -fmodules-debuginfo work also with PCHs
Luboš Luňák [Sun, 3 Nov 2019 20:15:03 +0000 (21:15 +0100)]
make -fmodules-codegen and -fmodules-debuginfo work also with PCHs

Allow to build PCH's (with -building-pch-with-obj and the extra .o file)
with -fmodules-codegen -fmodules-debuginfo to allow emitting shared code
into the extra .o file, similarly to how it works with modules. A bit of
a misnomer, but the underlying functionality is the same. This saves up
to 20% of build time here. The patch is fairly simple, it basically just
duplicates -fmodules checks to also alternatively check
-building-pch-with-obj.

This already got committed as cbc9d22e49b434b6ceb2eb94b67079d02e0a7b74,
but then got reverted in 7ea9a6e0220da36ff2fd1fbc29c2755be23e5166
because of PR44953, as discussed in D74846. This is a corrected version
which does not include two places for the PCH case that aren't included
in the modules -fmodules-codegen path either.

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

4 years ago[X86][AVX] Attempt to fold extract_subvector(shuffle(X)) -> extract_subvector(X)
Simon Pilgrim [Thu, 9 Jul 2020 12:25:12 +0000 (13:25 +0100)]
[X86][AVX] Attempt to fold extract_subvector(shuffle(X)) -> extract_subvector(X)

If we're extracting a subvector from a shuffle that is shuffling entire subvectors we can peek through and extract the subvector from the shuffle source instead.

This helps remove some cases where concat_vectors(extract_subvector(),extract_subvector()) legalizations has resulted in BLEND/VPERM2F128 shuffles of the subvectors.

4 years agoBasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI.
Simon Pilgrim [Thu, 9 Jul 2020 10:51:24 +0000 (11:51 +0100)]
BasicAAResult::constantOffsetHeuristic - pass APInt arg as const reference. NFCI.

Avoids unnecessary APInt copies and silences clang tidy warning.

4 years ago[RISCV] Avoid Splitting MBB in RISCVExpandPseudo
Sam Elliott [Thu, 9 Jul 2020 12:41:28 +0000 (13:41 +0100)]
[RISCV] Avoid Splitting MBB in RISCVExpandPseudo

Since the `RISCVExpandPseudo` pass has been split from
`RISCVExpandAtomicPseudo` pass, it would be nice to run the former as
early as possible (The latter has to be run as late as possible to
ensure correctness). Running earlier means we can reschedule these pairs
as we see fit.

Running earlier in the machine pass pipeline is good, but would mean
teaching many more passes about `hasLabelMustBeEmitted`. Splitting the
basic blocks also pessimises possible optimisations because some
optimisations are MBB-local, and others are disabled if the block has
its address taken (which is notionally what `hasLabelMustBeEmitted`
means).

This patch uses a new approach of setting the pre-instruction symbol on
the AUIPC instruction to a temporary symbol and referencing that. This
avoids splitting the basic block, but allows us to reference exactly the
instruction that we need to. Notionally, this approach seems more
correct because we do actually want to address a specific instruction.

This then allows the pass to be moved much earlier in the pass pipeline,
before both scheduling and register allocation. However, to do so we
must leave the MIR in SSA form (by not redefining registers), and so use
a virtual register for the intermediate value. By using this virtual
register, this pass now has to come before register allocation.

Reviewed By: luismarques, asb

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

4 years agoSpeculativeExecution: Fix for logic change introduced in D81730.
dfukalov [Mon, 29 Jun 2020 12:41:40 +0000 (15:41 +0300)]
SpeculativeExecution: Fix for logic change introduced in D81730.

Summary:
The test case started to hoist bitcasts to upper BB after D81730.
Reverted unintentional logic change. Some instructions may have zero cost but
will not be hoisted by different limitation so should be counted for threshold.

Reviewers: aprantl, arsenm, nhaehnle

Reviewed By: aprantl

Subscribers: wdng, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[DebugInfo] Fix pessimizing move. NFC.
Benjamin Kramer [Thu, 9 Jul 2020 12:23:46 +0000 (14:23 +0200)]
[DebugInfo] Fix pessimizing move. NFC.

DWARFDebugPubTable.cpp:80:31: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]

4 years ago[DebugInfo] Add more checks to parsing .debug_pub* sections.
Igor Kudrin [Thu, 9 Jul 2020 12:15:31 +0000 (19:15 +0700)]
[DebugInfo] Add more checks to parsing .debug_pub* sections.

The patch adds checking for various potential issues in parsing name
lookup tables and reporting them as recoverable errors, similarly as we
do for other tables.

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

4 years ago[DebugInfo] Do not hang when parsing a malformed .debug_pub* section.
Igor Kudrin [Thu, 9 Jul 2020 12:15:11 +0000 (19:15 +0700)]
[DebugInfo] Do not hang when parsing a malformed .debug_pub* section.

The parsing method did not check reading errors and might easily fall
into an infinite loop on an invalid input because of that.

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

4 years ago[SCCP] Use conditional info with AND/OR branch conditions.
Florian Hahn [Thu, 9 Jul 2020 11:59:24 +0000 (12:59 +0100)]
[SCCP] Use conditional info with AND/OR branch conditions.

Currently SCCP does not combine the information of conditions joined by
AND in the true branch or OR in the false branch.

For branches on AND, 2 copies will be inserted for the true branch, with
one being the operand of the other as in the code below. We can combine
the information using intersection. Note that for the OR case, the
copies are inserted in the false branch, where using intersection is
safe as well.

    define void @foo(i32 %a) {
    entry:
      %lt = icmp ult i32 %a, 100
      %gt = icmp ugt i32 %a, 20
      %and = and i1 %lt, %gt
    ; Has predicate info
    ; branch predicate info { TrueEdge: 1 Comparison:  %lt = icmp ult i32 %a, 100 Edge: [label %entry,label %true] }
      %a.0 = call i32 @llvm.ssa.copy.140247425954880(i32 %a)
    ; Has predicate info
    ; branch predicate info { TrueEdge: 1 Comparison:  %gt = icmp ugt i32 %a, 20 Edge: [label %entry,label %false] }
      %a.1 = call i32 @llvm.ssa.copy.140247425954880(i32 %a.0)
      br i1 %and, label %true, label %false

    true:                                             ; preds = %entry
      call void @use(i32 %a.1)
      %true.1 = icmp ne i32 %a.1, 20
      call void @use.i1(i1 %true.1)
      ret void

    false:                                            ; preds = %entry
      call void @use(i32 %a.1)
      ret void
    }

Reviewers: efriedma, davide, mssimpso, nikic

Reviewed By: nikic

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

4 years agoMake helpers static. NFC.
Benjamin Kramer [Thu, 9 Jul 2020 11:48:56 +0000 (13:48 +0200)]
Make helpers static. NFC.

4 years ago[clangd] Implement path and URI translation for remote index
Kirill Bobyrev [Thu, 9 Jul 2020 10:52:42 +0000 (12:52 +0200)]
[clangd] Implement path and URI translation for remote index

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

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