platform/upstream/llvm.git
5 years agoRemove unnecessary const_cast [NFC]
Aaron Puchert [Thu, 23 Aug 2018 21:13:32 +0000 (21:13 +0000)]
Remove unnecessary const_cast [NFC]

This required adding a few const specifiers on functions.

Also a minor formatting fix suggested in D49885.

llvm-svn: 340575

5 years agoChange xfail to skipIf. The exact condition is really difficult to get
Adrian Prantl [Thu, 23 Aug 2018 21:08:30 +0000 (21:08 +0000)]
Change xfail to skipIf. The exact condition is really difficult to get
right and doesn't add much signal.

llvm-svn: 340574

5 years agoXFAIL test for older versions of clang
Adrian Prantl [Thu, 23 Aug 2018 21:00:37 +0000 (21:00 +0000)]
XFAIL test for older versions of clang

llvm-svn: 340573

5 years ago[MIPS GlobalISel] Lower i8 and i16 arguments
Petar Jovanovic [Thu, 23 Aug 2018 20:41:09 +0000 (20:41 +0000)]
[MIPS GlobalISel] Lower i8 and i16 arguments

Lower integer arguments smaller than i32.
Support both register and stack arguments.
Define setLocInfo function for setting LocInfo field in ArgLocs vector.

Patch by Petar Avramovic.

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

llvm-svn: 340572

5 years agoFix broken builtin functions in the expression command
Raphael Isemann [Thu, 23 Aug 2018 20:40:45 +0000 (20:40 +0000)]
Fix broken builtin functions in the expression command

Summary:
Calling any non-libc builtin function in the expression command currently just causes Clang
to state that the function is not known. The reason for this is that we actually never
initialize the list of builtin functions in the Builtin::Context.

This patch just calls the initializer for the builtins in the preprocessor. Also adds some tests
for the new builtins.

It also gets rid of the extra list of builtins in the ClangExpressionParser, as we can just reuse
the existing list in the Preprocessor for the ASTContext. Having just one list of builtins around
is also closer to the standard Clang behavior.

Reviewers: #lldb, vsk

Reviewed By: vsk

Subscribers: sgraenitz, clayborg, vsk, lldb-commits

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

llvm-svn: 340571

5 years ago[llvm-mca] Fix parameter name. NFC.
Walter Lee [Thu, 23 Aug 2018 20:17:42 +0000 (20:17 +0000)]
[llvm-mca] Fix parameter name.  NFC.

llvm-svn: 340570

5 years ago[WebAssembly] Prioritize splats over v128.consts
Thomas Lively [Thu, 23 Aug 2018 19:23:13 +0000 (19:23 +0000)]
[WebAssembly] Prioritize splats over v128.consts

Summary:
Splats are fewer bytes than v128.consts, so use them when either could
apply.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 340569

5 years agoRevert "[PPC64] Fix DQ-form instruction handling and emit error for misalign..."
Sean Fertile [Thu, 23 Aug 2018 19:10:40 +0000 (19:10 +0000)]
Revert "[PPC64] Fix DQ-form instruction handling and emit error for misalign..."

This reverts commit 5125b44dbb5d06b715213e4bec75c7346bfcc7d3.
ppc64-dq.s and ppc64-error-missaligned-dq.s fail on several of the build-bots.
Reverting to investigate.

llvm-svn: 340568

5 years agoRemove the use of pair inside the tuple in concat_iterator.
Alina Sbirlea [Thu, 23 Aug 2018 18:46:48 +0000 (18:46 +0000)]
Remove the use of pair inside the tuple in concat_iterator.

Summary:
Remove the use of pair inside the tuple in concat_iterator, and create separate begins and ends tuples instead.
This fixes the failure for llvm <= 3.7 and libstd++ that broke the hexagon build.

Reviewers: timshen

Subscribers: sanjoy, jlebar, dexonsmith, kparzysz, llvm-commits

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

llvm-svn: 340567

5 years ago[llvm-mca] Set the Selection strategy to Default if nullptr is passed.
Matt Davis [Thu, 23 Aug 2018 18:42:37 +0000 (18:42 +0000)]
[llvm-mca] Set the Selection strategy to Default if nullptr is passed.

* Set (not reset) the strategy in Scheduler::setCustomStrategyImpl()

llvm-svn: 340566

5 years ago[x86] move/add tests for insertelement with variable index; NFC
Sanjay Patel [Thu, 23 Aug 2018 18:38:40 +0000 (18:38 +0000)]
[x86] move/add tests for insertelement with variable index; NFC

The variable index pattern is different than the constant index
cases as shown in D51125. We might want to splat regardless of
whether the scalar is loaded from memory or transferred from GPR.

llvm-svn: 340565

5 years ago[PPC64] Fix DQ-form instruction handling and emit error for misalignment.
Sean Fertile [Thu, 23 Aug 2018 18:35:09 +0000 (18:35 +0000)]
[PPC64] Fix DQ-form instruction handling and emit error for misalignment.

Fixes the handling of *_DS relocations used on DQ-form instructions where we
were overwriting some of the extended opcode bits. Also adds an alignment check
so that the user will receive a diagnostic error if the value we are writing
is not properly aligned.

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

llvm-svn: 340564

5 years ago[LoopVectorize][NFCI] Use find instead of count
David Bolvansky [Thu, 23 Aug 2018 18:34:58 +0000 (18:34 +0000)]
[LoopVectorize][NFCI] Use find instead of count

Summary:
Avoid "count" if possible -> use "find" to check for the existence of keys.

Passed llvm test suite.

Reviewers: fhahn, dcaballe, mkuper, rengolin

Reviewed By: fhahn

Subscribers: llvm-commits

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

llvm-svn: 340563

5 years agoFix format string issue introduced in r340548
Walter Lee [Thu, 23 Aug 2018 18:26:26 +0000 (18:26 +0000)]
Fix format string issue introduced in r340548

Make format string portable.

llvm-svn: 340562

5 years agoFixup AreCoreFilesPrevented() to consider first LLVM_ENABLE_CRASH_DUMPS and secondly...
Douglas Yung [Thu, 23 Aug 2018 18:20:13 +0000 (18:20 +0000)]
Fixup AreCoreFilesPrevented() to consider first LLVM_ENABLE_CRASH_DUMPS and secondly coreFilesPrevented.

The previous change ignored the latter resulting in crash dumps being generated when LLVM_ENABLE_CRASH_DUMPS was
set, but coreFilesPrevented was true.

llvm-svn: 340561

5 years ago[cmake] Add option to skip building lldb-server
Alex Langford [Thu, 23 Aug 2018 18:05:45 +0000 (18:05 +0000)]
[cmake] Add option to skip building lldb-server

Summary:
There is currently a way to skip the debugserver build. See how the CMake
variables SKIP_DEBUGSERVER and LLDB_CODESIGN_IDENTITY are used if you're
interested in that.

This allows us to skip building lldb-server as well. There is another
debug server called ds2 that can be used with LLDB. If you choose to use
ds2, this flag is very useful because it can cut down the build time of LLDB.

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

llvm-svn: 340560

5 years ago[docs] Regenerate ClangCommandLineReference.rst
Vedant Kumar [Thu, 23 Aug 2018 17:55:03 +0000 (17:55 +0000)]
[docs] Regenerate ClangCommandLineReference.rst

llvm-svn: 340559

5 years ago[options] Document -(static|shared)-libsan
Vedant Kumar [Thu, 23 Aug 2018 17:54:48 +0000 (17:54 +0000)]
[options] Document -(static|shared)-libsan

llvm-svn: 340558

5 years agoFix check for dictionary entry
Adrian Prantl [Thu, 23 Aug 2018 17:51:14 +0000 (17:51 +0000)]
Fix check for dictionary entry

llvm-svn: 340557

5 years ago[ValueTracking] Fix assert message and add test case for r340546 and PR38677.
Craig Topper [Thu, 23 Aug 2018 17:45:53 +0000 (17:45 +0000)]
[ValueTracking] Fix assert message and add test case for r340546 and PR38677.

The bug was already fixed. This just adds a test case for it.

llvm-svn: 340556

5 years agoCOFF: Implement safe ICF on rodata using address-significance tables.
Peter Collingbourne [Thu, 23 Aug 2018 17:44:42 +0000 (17:44 +0000)]
COFF: Implement safe ICF on rodata using address-significance tables.

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

llvm-svn: 340555

5 years ago[DEBUGINFO] Fix misprint in the name of DebugDirectivesOnly, NFC.
Alexey Bataev [Thu, 23 Aug 2018 17:43:40 +0000 (17:43 +0000)]
[DEBUGINFO] Fix misprint in the name of DebugDirectivesOnly, NFC.

llvm-svn: 340553

5 years agoDriver: Enable address-significance tables by default when targeting COFF.
Peter Collingbourne [Thu, 23 Aug 2018 17:43:29 +0000 (17:43 +0000)]
Driver: Enable address-significance tables by default when targeting COFF.

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

llvm-svn: 340552

5 years agoXFAIL test for older versions of dsymutil
Adrian Prantl [Thu, 23 Aug 2018 17:30:56 +0000 (17:30 +0000)]
XFAIL test for older versions of dsymutil

llvm-svn: 340550

5 years ago[RegisterCoalescer] Fix for assert in removePartialRedundancy
Tim Renouf [Thu, 23 Aug 2018 17:28:33 +0000 (17:28 +0000)]
[RegisterCoalescer] Fix for assert in removePartialRedundancy

Summary:
I got "Use not jointly dominated by defs" when removePartialRedundancy
attempted to prune then re-extend a subrange whose only liveness was a
dead def at the copy being removed.

V2: Removed junk from test. Improved comment.
V3: Addressed minor review comments.

Subscribers: MatzeB, qcolombet, nhaehnle, llvm-commits

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

Change-Id: I6f894e9f517f71e921e0c6d81d28c5f344db8dad
llvm-svn: 340549

5 years agolldbtest.py: Work around macOS SIP when testing ASANified builds.
Adrian Prantl [Thu, 23 Aug 2018 17:19:08 +0000 (17:19 +0000)]
lldbtest.py: Work around macOS SIP when testing ASANified builds.

llvm-svn: 340548

5 years ago[ASTMatchers] Let hasObjectExpression also support UnresolvedMemberExpr, CXXDependent...
Shuai Wang [Thu, 23 Aug 2018 17:16:06 +0000 (17:16 +0000)]
[ASTMatchers] Let hasObjectExpression also support UnresolvedMemberExpr, CXXDependentScopeMemberExpr

Reviewers: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 340547

5 years ago[ValueTracking] Fix an assert from r340480.
Craig Topper [Thu, 23 Aug 2018 17:15:02 +0000 (17:15 +0000)]
[ValueTracking] Fix an assert from r340480.

We need to allow ConstantExpr Selects in addition to SelectInst.

I'll try to put together a test case, but I wanted to fix the issues being reported.

Fixes PR38677

llvm-svn: 340546

5 years ago[llvm-mca] Fix wrong call to setCustomStrategy().
Andrea Di Biagio [Thu, 23 Aug 2018 17:09:08 +0000 (17:09 +0000)]
[llvm-mca] Fix wrong call to setCustomStrategy().

Thanks to @waltl for reporting this issue.

I have also added an assert to check for invalid null strategy objects, and I
have reworded a couple of code comments in Scheduler.h

llvm-svn: 340545

5 years agoComment out #define __cpp_lib_node_extract, we only support half of that functionality
Erik Pilkington [Thu, 23 Aug 2018 17:08:02 +0000 (17:08 +0000)]
Comment out #define __cpp_lib_node_extract, we only support half of that functionality

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

llvm-svn: 340544

5 years agoAdd libc++ data formatter for std::function
Adrian Prantl [Thu, 23 Aug 2018 17:02:39 +0000 (17:02 +0000)]
Add libc++ data formatter for std::function

- Added LibcxxFunctionSummaryProvider
- Removed LibcxxFunctionFrontEnd
- Modified data formatter tests to test new summary functionality

Patch by Shafik Yaghmour!

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

llvm-svn: 340543

5 years ago[OpenMP][libomptarget] Bringing up to spec with respect to OMP_TARGET_OFFLOAD env var
Alexandre Eichenberger [Thu, 23 Aug 2018 16:22:42 +0000 (16:22 +0000)]
[OpenMP][libomptarget] Bringing up to spec with respect to OMP_TARGET_OFFLOAD env var

Summary:
Right now, only the OMP_TARGET_OFFLOAD=DISABLED was implemented. Added support for the other MANDATORY and DEFAULT values.

Reviewers: gtbercea, ABataev, grokos, caomhin, Hahnfeld

Reviewed By: Hahnfeld

Subscribers: protze.joachim, gtbercea, AlexEichenberger, RaviNarayanaswamy, Hahnfeld, guansong, openmp-commits

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

llvm-svn: 340542

5 years agoRe-land [ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt
Raphael Isemann [Thu, 23 Aug 2018 16:06:30 +0000 (16:06 +0000)]
Re-land [ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt

Lands r340468 again, but this time we mark the test as unsupported on Windows
because it seems that try/catch crashes CodeGen at the moment.

llvm-svn: 340541

5 years ago[x86] add debug option for and-immediate shrinking
Sanjay Patel [Thu, 23 Aug 2018 15:58:07 +0000 (15:58 +0000)]
[x86] add debug option for and-immediate shrinking

The commit that added this functionality:
rL322957

may be causing/exposing a miscompile in PR38648:
https://bugs.llvm.org/show_bug.cgi?id=38648

so allow enabling/disabling to make debugging easier.

llvm-svn: 340540

5 years ago[clangd] Check for include overlapping looks for only the line now.
Kadir Cetinkaya [Thu, 23 Aug 2018 15:55:27 +0000 (15:55 +0000)]
[clangd] Check for include overlapping looks for only the line now.

Summary:
Currently we match an include only if we are inside filename, with this patch we
will match whenever we are on the starting line of the include.

Reviewers: ilya-biryukov, hokein, ioeric

Reviewed By: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 340539

5 years ago[InstCombine] Fold Select with binary op - FP opcodes
David Bolvansky [Thu, 23 Aug 2018 15:22:15 +0000 (15:22 +0000)]
[InstCombine] Fold Select with binary op - FP opcodes

Summary:
Follow up for https://reviews.llvm.org/rL339520 and https://reviews.llvm.org/rL338300

Alive:

```
%A = fcmp oeq float %x, 0.0
%B = fadd nsz float %x, %z
%C = select i1 %A, float %B, float %y
=>
%C = select i1 %A, float %z, float %y
----------
  %A = fcmp oeq float %x, 0.0
  %B = fadd nsz float %x, %z
  %C = select %A, float %B, float %y
=>
  %C = select %A, float %z, float %y

Done: 1
Optimization is correct

%A = fcmp une float %x, -0.0
%B = fadd nsz float %x, %z
%C = select i1 %A, float %y, float %B
=>
%C = select i1 %A, float %y, float %z
----------
  %A = fcmp une float %x, -0.0
  %B = fadd nsz float %x, %z
  %C = select %A, float %y, float %B
=>
  %C = select %A, float %y, float %z

Done: 1
Optimization is correct
```

Reviewers: spatel, lebedev.ri

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 340538

5 years ago[FunctionAttrs] Infer WriteOnly Function Attribute
Brian Homerding [Thu, 23 Aug 2018 15:05:22 +0000 (15:05 +0000)]
[FunctionAttrs] Infer WriteOnly Function Attribute

These changes expand the FunctionAttr logic in order to mark functions as
WriteOnly when appropriate. This is done through an additional bool variable
and extended logic.

Reviewers: hfinkel, jdoerfert

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

llvm-svn: 340537

5 years ago[llvm-mca] Allow the definition of custom strategies for selecting processor resource...
Andrea Di Biagio [Thu, 23 Aug 2018 15:04:52 +0000 (15:04 +0000)]
[llvm-mca] Allow the definition of custom strategies for selecting processor resource units.

With this patch, users can now customize the pipeline selection strategy for
scheduler resources. The resource selection strategy can be defined at processor
resource granularity. This enables the definition of different strategies for
different hardware schedulers.

To override the strategy associated with a processor resource, users can call
method ResourceManager::setCustomStrategy(), and pass a 'ResourceStrategy'
object in input.

Class ResourceStrategy is an abstract class which declares virtual method
`ResourceStrategy::select()`. Method select() is meant to implement the actual
strategy; it is responsible for picking the next best resource from a set of
available pipeline resources.  Custom strategy must simply override that method.

By default, processor resources are associated with instances of
'DefaultResourceStrategy'.  A 'DefaultResourceStrategy' internally implements a
simple round-robin selector. For more details, please refer to the code comments
in Scheduler.h.

llvm-svn: 340536

5 years ago[analyzer] added cache for SMT queries in the SMTConstraintManager
Mikhail R. Gadelha [Thu, 23 Aug 2018 13:21:35 +0000 (13:21 +0000)]
[analyzer] added cache for SMT queries in the SMTConstraintManager

Summary:
This patch implements a new cache for the result of SMT queries; with this patch the regression tests are 25% faster.

It's implemented as a `llvm::DenseMap` where the key is the hash of the set of the constraints in a state.

There is still one method that does not use the cache, `getSymVal`, because it needs to get a symbol interpretation from the SMT, which is not cached yet.

Reviewers: NoQ, george.karpenkov

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin, Szelethus

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

llvm-svn: 340535

5 years ago[analyzer] Moved all CSA code from the SMT API to a new header, `SMTConv.h`. NFC.
Mikhail R. Gadelha [Thu, 23 Aug 2018 13:21:31 +0000 (13:21 +0000)]
[analyzer] Moved all CSA code from the SMT API to a new header, `SMTConv.h`. NFC.

Summary:
With this patch, the SMT backend is almost completely detached from the CSA.

Unfortunate consequence is that we missed the `ConditionTruthVal` from the CSA and had to use `Optional<bool>`.

The Z3 solver implementation is still in the same file as the `Z3ConstraintManager`, in `lib/StaticAnalyzer/Core/Z3ConstraintManager.cpp` though, but except for that, the SMT API can be moved to anywhere in the codebase.

Reviewers: NoQ, george.karpenkov

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin, Szelethus

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

llvm-svn: 340534

5 years ago[analyzer] Templatefy SMTConstraintManager so more generic code can be moved from...
Mikhail R. Gadelha [Thu, 23 Aug 2018 13:21:00 +0000 (13:21 +0000)]
[analyzer] Templatefy SMTConstraintManager so more generic code can be moved from solver specific implementations. NFC.

Summary:
By making SMTConstraintManager a template and passing the SMT constraint type and expr, we can further move code from the Z3ConstraintManager class to the generic SMT constraint Manager.

Now, each SMT specific constraint manager only needs to implement the method `bool canReasonAbout(SVal X) const`.

Reviewers: NoQ, george.karpenkov

Reviewed By: george.karpenkov

Subscribers: mgorny, xazax.hun, szepet, a.sidorin, Szelethus

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

llvm-svn: 340533

5 years ago[analyzer] Delete SMTContext. NFC.
Mikhail R. Gadelha [Thu, 23 Aug 2018 13:20:18 +0000 (13:20 +0000)]
[analyzer] Delete SMTContext. NFC.

Summary: There is no reason to have a base class for a context anymore as each SMT object carries a reference to the specific solver context.

Reviewers: NoQ, george.karpenkov, hiraditya

Reviewed By: hiraditya

Subscribers: hiraditya, xazax.hun, szepet, a.sidorin, Szelethus

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

llvm-svn: 340532

5 years agoChange dyn_cast<CXXMethodDecl>(FD) to isa<CXXMethodDecl>(FD) [NFC]
Mikael Holmen [Thu, 23 Aug 2018 13:18:27 +0000 (13:18 +0000)]
Change dyn_cast<CXXMethodDecl>(FD) to isa<CXXMethodDecl>(FD) [NFC]

The result of the dyn_cast wasn't used to we can just check isa.

llvm-svn: 340531

5 years ago[clangd] Suggest code-completions for overriding base class virtual methods.
Kadir Cetinkaya [Thu, 23 Aug 2018 13:14:50 +0000 (13:14 +0000)]
[clangd] Suggest code-completions for overriding base class virtual methods.

Summary:
Whenever a code-completion is triggered within a class/struct/union looks at
base classes and figures out non-overriden virtual functions. Than suggests
completions for those.

Reviewers: ilya-biryukov, hokein, ioeric

Reviewed By: hokein

Subscribers: MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 340530

5 years ago[GVN] Invalidate cached info for phis when setting dead predecessors to undef
John Brawn [Thu, 23 Aug 2018 12:48:17 +0000 (12:48 +0000)]
[GVN] Invalidate cached info for phis when setting dead predecessors to undef

When GVN sets the incoming value for a phi to undef because the incoming block
is unreachable it needs to also invalidate the cached info for that phi in
MemoryDependenceAnalysis, otherwise later queries will return stale information.

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

llvm-svn: 340529

5 years ago[DWARF] Unify warning callbacks. NFC.
Victor Leschuk [Thu, 23 Aug 2018 12:43:33 +0000 (12:43 +0000)]
[DWARF] Unify warning callbacks. NFC.

Both DWARFDebugLine and DWARFDebugAddr used the same callback mechanism
for handling recoverable errors. They both implemented similar warn() function
to be used as such callbacks.

In this revision we get rid of code duplication and move this warn() function
to DWARFContext as DWARFContext::dumpWarning().

Reviewers: lhames, jhenderson, aprantl, probinson, dblaikie, JDevlieghere

Reviewed By: jhenderson

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

llvm-svn: 340528

5 years ago[clangd] Move function argument snippet disable mechanism from LSP rendering to inter...
Kadir Cetinkaya [Thu, 23 Aug 2018 12:19:39 +0000 (12:19 +0000)]
[clangd] Move function argument snippet disable mechanism from LSP rendering to internal clangd reprensentation.

Summary:
We were handling the EnableFunctionArgSnippets only when we are producing LSP
response. Move that code into CompletionItem generation so that internal clients
can benefit from that as well.

Reviewers: ilya-biryukov, ioeric, hokein

Reviewed By: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 340527

5 years ago[SCCP] Remove unused variable added in r340525.
Florian Hahn [Thu, 23 Aug 2018 11:17:59 +0000 (11:17 +0000)]
[SCCP] Remove unused variable added in r340525.

llvm-svn: 340526

5 years agoRecommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from cmp instructions.
Florian Hahn [Thu, 23 Aug 2018 11:04:00 +0000 (11:04 +0000)]
Recommit r333268: [IPSCCP] Use PredicateInfo to propagate facts from cmp instructions.

This version of the patch fixes cleaning up ssa_copy intrinsics, so it does not
crash for instructions in blocks that have been marked unreachable.

This patch updates IPSCCP to use PredicateInfo to propagate
facts to true branches predicated by EQ and to false branches
predicated by NE.

As a follow up, we should be able to extend it to also propagate additional
facts about nonnull.

Reviewers: davide, mssimpso, dberlin, efriedma

Reviewed By: davide, dberlin

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

llvm-svn: 340525

5 years agoRemoved unused variable [NFC]
Mikael Holmen [Thu, 23 Aug 2018 10:59:49 +0000 (10:59 +0000)]
Removed unused variable [NFC]

The compiler warned:
../tools/clang/lib/StaticAnalyzer/Core/RetainSummaryManager.cpp:329:19: error: unused variable 'MD' [-Werror,-Wunused-variable]
  if (const auto *MD = dyn_cast<CXXMethodDecl>(FD)) {
                  ^
1 error generated.

llvm-svn: 340524

5 years ago[clangd] Increase the timeouts in TUScheduler tests to 10 seconds.
Ilya Biryukov [Thu, 23 Aug 2018 10:25:07 +0000 (10:25 +0000)]
[clangd] Increase the timeouts in TUScheduler tests to 10 seconds.

Some of them timeout on our buildbots in certain configurations.
The timeouts are there to avoid hanging indefinitely on deadlocks, so
the exact number we put there does not matter.

llvm-svn: 340523

5 years agoUpdate avr attributes test for output change in r340519
Alexander Richardson [Thu, 23 Aug 2018 10:21:36 +0000 (10:21 +0000)]
Update avr attributes test for output change in r340519

After this commit there is an addrspace(1) before the attribute #. Since
these tests are only checking the value of the attribute add a {{.*}} to
make the test resilient to future output changes.

llvm-svn: 340522

5 years ago[libclang] Fix cursors for arguments of Subscript and Call operators
Ivan Donchevskii [Thu, 23 Aug 2018 09:48:11 +0000 (09:48 +0000)]
[libclang] Fix cursors for arguments of Subscript and Call operators

The DeclRefExpr of CXXOperatorCallExpr refering to the custom operator
is visited before the arguments to the operator call. For the Call and
Subscript operator the range of this DeclRefExpr includes the whole call
expression, so that all tokens in that range were mapped to the operator
function, even the tokens of the arguments.

Fix this by ensuring that this particular DeclRefExpr is visited last.

Fixes PR25775.

Fix by Nikolai Kosjar.

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

llvm-svn: 340521

5 years ago[Support] Fix some Wundef warnings
Sven van Haastregt [Thu, 23 Aug 2018 09:42:58 +0000 (09:42 +0000)]
[Support] Fix some Wundef warnings

For the _WIN32 macro, it is the definedness that matters rather than
the value.  Most uses of the macro already rely on the definedness.
This commit fixes the few remaining uses that relied on the value.

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

llvm-svn: 340520

5 years agoAllow creating llvm::Function in non-zero address spaces
Alexander Richardson [Thu, 23 Aug 2018 09:25:17 +0000 (09:25 +0000)]
Allow creating llvm::Function in non-zero address spaces

Most users won't have to worry about this as all of the
'getOrInsertFunction' functions on Module will default to the program
address space.

An overload has been added to Function::Create to abstract away the
details for most callers.

This is based on https://reviews.llvm.org/D37054 but without the changes to
make passing a Module to Function::Create() mandatory. I have also added
some more tests and fixed the LLParser to accept call instructions for
types in the program address space.

Reviewed By: bjope

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

llvm-svn: 340519

5 years agoTableGen/SearchableTables: Cast enums to unsigned in generated code
Nicolai Haehnle [Thu, 23 Aug 2018 08:02:02 +0000 (08:02 +0000)]
TableGen/SearchableTables: Cast enums to unsigned in generated code

Summary:
This should fix signedness warnings when compiling with MSVC.

Change-Id: I4664cce0ba91e9b42d21a86fd4a7e82f2320c451

Reviewers: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 340518

5 years agoFix comparison of char and int64 in TestWriteFixNegativeInt
Vitaly Buka [Thu, 23 Aug 2018 07:12:05 +0000 (07:12 +0000)]
Fix comparison of char and int64 in TestWriteFixNegativeInt
It was broken on clang-ppc64le-linux-lnt bot.

llvm-svn: 340517

5 years agoInitialize the address-significance table fragment's layout order.
Peter Collingbourne [Thu, 23 Aug 2018 06:57:49 +0000 (06:57 +0000)]
Initialize the address-significance table fragment's layout order.

This fragment is created after layout, which is where the order
normally gets set.

Should fix a test failure under msan.

llvm-svn: 340516

5 years ago[x86/retpoline] Split the LLVM concept of retpolines into separate
Chandler Carruth [Thu, 23 Aug 2018 06:06:38 +0000 (06:06 +0000)]
[x86/retpoline] Split the LLVM concept of retpolines into separate
subtarget features for indirect calls and indirect branches.

This is in preparation for enabling *only* the call retpolines when
using speculative load hardening.

I've continued to use subtarget features for now as they continue to
seem the best fit given the lack of other retpoline like constructs so
far.

The LLVM side is pretty simple. I'd like to eventually get rid of the
old feature, but not sure what backwards compatibility issues that will
cause.

This does remove the "implies" from requesting an external thunk. This
always seemed somewhat questionable and is now clearly not desirable --
you specify a thunk the same way no matter which set of things are
getting retpolines.

I really want to keep this nicely isolated from end users and just an
LLVM implementation detail, so I've moved the `-mretpoline` flag in
Clang to no longer rely on a specific subtarget feature by that name and
instead to be directly handled. In some ways this is simpler, but in
order to preserve existing behavior I've had to add some fallback code
so that users who relied on merely passing -mretpoline-external-thunk
continue to get the same behavior. We should eventually remove this
I suspect (we have never tested that it works!) but I've not done that
in this patch.

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

llvm-svn: 340515

5 years agoMC: Don't align COFF section contents.
Peter Collingbourne [Thu, 23 Aug 2018 05:39:36 +0000 (05:39 +0000)]
MC: Don't align COFF section contents.

Aligning section contents is not required, but only
recommended, by the specification. Microsoft's documentation says
(https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#section-table-section-headers):
"For object files, the value should be aligned on a 4-byte boundary
for best performance."

However, according to my measurements, aligning section contents has
a neutral to negative effect on performance.

I measured the median run time of 100 links of Chromium's
base_unittests on Linux with lld-link and on Windows with link.exe with
both aligned and unaligned sections. On Linux I didn't see a measurable
performance difference, and on Windows the link was slightly faster
with unaligned sections (presumably because on Windows the bottleneck
is I/O).

Also, the sections created by cl.exe are unaligned, so we should expect
tools to broadly accept unaligned sections.

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

llvm-svn: 340514

5 years agoRevert r340508: [DebugInfo] Fix bug in LiveDebugVariables.
Chandler Carruth [Thu, 23 Aug 2018 05:39:02 +0000 (05:39 +0000)]
Revert r340508: [DebugInfo] Fix bug in LiveDebugVariables.

This patch's test case relies on debug prints which isn't generally an
OK way to test stuff in LLVM and fails whenever asserts aren't enabled.
I've send a heads-up to the commit and detailed comments on the review.

llvm-svn: 340513

5 years ago[LibCalls] Added returned attribute to libcalls
David Bolvansky [Thu, 23 Aug 2018 05:18:23 +0000 (05:18 +0000)]
[LibCalls] Added returned attribute to libcalls

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

llvm-svn: 340512

5 years agoMissing quote in previous commit
JF Bastien [Thu, 23 Aug 2018 04:09:49 +0000 (04:09 +0000)]
Missing quote in previous commit

The test was failing because I missed a quote.

llvm-svn: 340511

5 years agoImprove incompatible triple error
JF Bastien [Thu, 23 Aug 2018 03:55:24 +0000 (03:55 +0000)]
Improve incompatible triple error

When complaining that the triple is incompatible with all targets, print out the triple not just a generic error about triples not matching.

llvm-svn: 340510

5 years agoImprove incompatible triple error
JF Bastien [Thu, 23 Aug 2018 03:40:31 +0000 (03:40 +0000)]
Improve incompatible triple error

When complaining that the triple is incompatible with all targets, print out the triple not just a generic error about triples not matching.

llvm-svn: 340509

5 years ago[DebugInfo] Fix bug in LiveDebugVariables.
Hsiangkai Wang [Thu, 23 Aug 2018 03:28:24 +0000 (03:28 +0000)]
[DebugInfo] Fix bug in LiveDebugVariables.

In lib/CodeGen/LiveDebugVariables.cpp, it uses std::prev(MBBI) to
get DebugValue's SlotIndex. However, the previous instruction may be
also a debug instruction. It could not use a debug instruction to query
SlotIndex in mi2iMap.

Scan all debug instructions and use the first debug instruction to query
SlotIndex for following debug instructions. Only handle DBG_VALUE in
handleDebugValue().

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

llvm-svn: 340508

5 years agoFix undefined behavior in r340457
Scott Linder [Thu, 23 Aug 2018 02:51:09 +0000 (02:51 +0000)]
Fix undefined behavior in r340457

llvm-svn: 340507

5 years agoAdd new .def file introduced for BinaryFormat/MsgPack
David Blaikie [Thu, 23 Aug 2018 02:01:30 +0000 (02:01 +0000)]
Add new .def file introduced for BinaryFormat/MsgPack

Patch by Kristina Brooks!

llvm-svn: 340506

5 years ago[WebAssembly] SIMD Bitwise binary arithmetic
Thomas Lively [Thu, 23 Aug 2018 00:48:37 +0000 (00:48 +0000)]
[WebAssembly] SIMD Bitwise binary arithmetic

Summary: AND, OR, and XOR. This CL depends on D51113.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 340505

5 years ago[WebAssembly][NFC] Reorganize SIMD instructions
Thomas Lively [Thu, 23 Aug 2018 00:43:47 +0000 (00:43 +0000)]
[WebAssembly][NFC] Reorganize SIMD instructions

Summary:
Reorganize WebAssemblyInstrSIMD.td to put all of the instruction
definitions together, making it easier to see which instructions have
been implemented already. Depends on D51143.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 340504

5 years ago[WebAssembly][NFC] Move specific instruction formats to specific files
Thomas Lively [Thu, 23 Aug 2018 00:36:43 +0000 (00:36 +0000)]
[WebAssembly][NFC] Move specific instruction formats to specific files

Summary:
WebAssemblyInstrFormats.td retains only multiclasses that are used in
multiple other tablegen files.

Reviewers: aheejin, dschuff

Subscribers: sbc100, jgravelle-google, sunfish, jfb, llvm-commits

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

llvm-svn: 340503

5 years ago[analyzer] Preliminary version of retain count checking for OSObjects
George Karpenkov [Thu, 23 Aug 2018 00:26:59 +0000 (00:26 +0000)]
[analyzer] Preliminary version of retain count checking for OSObjects

Has quite a lot of false positives, disabled behind the flag.

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

llvm-svn: 340502

5 years agoRevert "[CStringSyntaxChecker] Check strlcat sizeof check"
George Karpenkov [Thu, 23 Aug 2018 00:02:35 +0000 (00:02 +0000)]
Revert "[CStringSyntaxChecker] Check strlcat sizeof check"

This reverts commit 3073790e87378fea9a68fb052185fec9596ef135.

The check is not correct, strlact(dest, "mystr", sizeof(dest)) is fine.

llvm-svn: 340501

5 years agoRevert "[CStringSyntaxChecker] Reduces space around error message for strlcat."
George Karpenkov [Thu, 23 Aug 2018 00:02:12 +0000 (00:02 +0000)]
Revert "[CStringSyntaxChecker] Reduces space around error message for strlcat."

This reverts commit 6b43b80320722da41ca6ef7a3b57cc300fb83094.

llvm-svn: 340500

5 years agoMC: Teach the COFF object writer to write address-significance tables.
Peter Collingbourne [Wed, 22 Aug 2018 23:58:16 +0000 (23:58 +0000)]
MC: Teach the COFF object writer to write address-significance tables.

The format is the same as in ELF: a sequence of ULEB128-encoded
symbol indexes.

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

llvm-svn: 340499

5 years agowin: Omit ".exe" from clang and clang-cl driver-level diagnostics.
Nico Weber [Wed, 22 Aug 2018 23:53:39 +0000 (23:53 +0000)]
win: Omit ".exe" from clang and clang-cl driver-level diagnostics.

Like https://reviews.llvm.org/D51133 but for clang.
https://reviews.llvm.org/D51134

llvm-svn: 340498

5 years agowin: Omit ".exe" from lld warning and error messages.
Nico Weber [Wed, 22 Aug 2018 23:52:13 +0000 (23:52 +0000)]
win: Omit ".exe" from lld warning and error messages.

This is a minor follow-up to https://reviews.llvm.org/D49189. On Windows, lld
used to print "lld-link.exe: error: ...". Now it just prints "lld-link: error:
...". This matches what link.exe does (it prints "LINK : ...") and makes lld's
output less dependent on the host system.

https://reviews.llvm.org/D51133

llvm-svn: 340487

5 years agoRevert "[ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt"
Raphael Isemann [Wed, 22 Aug 2018 23:50:30 +0000 (23:50 +0000)]
Revert "[ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt"

This test breaks llvm-clang-x86_64-expensive-checks-win.

llvm-svn: 340483

5 years agolld-link: Separate 'undefined symbol' errors with just one newline, not two.
Nico Weber [Wed, 22 Aug 2018 23:45:05 +0000 (23:45 +0000)]
lld-link: Separate 'undefined symbol' errors with just one newline, not two.

newline() in ErrorHandler.cpp already tries to insert newlines between messages
that contain embedded newlines, so getSymbolLocations() shouldn't return a
string that ends in a newline -- else we end up with two newlines between error
messages.

Makes lld-link's output look more like ld.lld output.

https://reviews.llvm.org/D51117

llvm-svn: 340482

5 years agoFix two RUN: lines that were unintentionally spelled "RN:".
Nico Weber [Wed, 22 Aug 2018 23:44:03 +0000 (23:44 +0000)]
Fix two RUN: lines that were unintentionally spelled "RN:".

https://reviews.llvm.org/D51140

llvm-svn: 340481

5 years ago[ValueTracking] Teach computeNumSignBits to understand min/max clamp patterns with...
Craig Topper [Wed, 22 Aug 2018 23:27:50 +0000 (23:27 +0000)]
[ValueTracking] Teach computeNumSignBits to understand min/max clamp patterns with constant/splat values

If we have a min/max pair we can do a better job of counting sign bits if we look at them together. This is similar to what is done in the SelectionDAG version of computeNumSignBits for ISD::SMAX/SMIN.

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

llvm-svn: 340480

5 years ago[NFC] Add tags file to .gitignore
George Karpenkov [Wed, 22 Aug 2018 23:23:17 +0000 (23:23 +0000)]
[NFC] Add tags file to .gitignore

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

llvm-svn: 340479

5 years ago[X86] Teach combineLoopSADPattern to handle cases where there is no loop and the...
Craig Topper [Wed, 22 Aug 2018 23:19:01 +0000 (23:19 +0000)]
[X86] Teach combineLoopSADPattern to handle cases where there is no loop and the add has two absolute difference inputs

Previously we asumed a vector reduction add is part of a loop and one of the input is a phi. But the code in SelectionDAGBuilder that sets vector reduction flag handles more cases than that. It just requires that the use chain ends in a horizontal reduction. And there are no other uses. This means it can handle unrolled reduction loops.

If the initial value of the reduction was 0, an unrolled loop would begin with a vector reduction add that has two sad inputs. Previously we would only transform one side of the add, but for this case we need to transform both sides.

I've created a lambda to reuse some of the code for both sides. And fixed the variables names to remove reference to "phi".

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

llvm-svn: 340478

5 years ago[X86] Add test cases for D50817. NFC
Craig Topper [Wed, 22 Aug 2018 23:18:58 +0000 (23:18 +0000)]
[X86] Add test cases for D50817. NFC

llvm-svn: 340477

5 years ago[NFC] Refactor simplification of pow()
Evandro Menezes [Wed, 22 Aug 2018 23:18:02 +0000 (23:18 +0000)]
[NFC] Refactor simplification of pow()

llvm-svn: 340476

5 years ago[analyzer] Track non-zero values in ReturnVisitor
George Karpenkov [Wed, 22 Aug 2018 23:17:25 +0000 (23:17 +0000)]
[analyzer] Track non-zero values in ReturnVisitor

Tracking those can help to provide much better diagnostics in many cases.

In general, most of the visitor machinery should be refactored to allow
tracking the origin of arbitrary values.

rdar://36039765

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

llvm-svn: 340475

5 years ago[analyzer] Track the problematic subexpression in UndefResultChecker
George Karpenkov [Wed, 22 Aug 2018 23:17:02 +0000 (23:17 +0000)]
[analyzer] Track the problematic subexpression in UndefResultChecker

This is tested in a subsequent commit, which allows tracking those values.

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

llvm-svn: 340474

5 years ago[analyzer] [NFC] Minor refactoring of BugReporterVisitors
George Karpenkov [Wed, 22 Aug 2018 23:16:44 +0000 (23:16 +0000)]
[analyzer] [NFC] Minor refactoring of BugReporterVisitors

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

llvm-svn: 340473

5 years ago[WebAssembly] Arbitrary BUILD_VECTOR and remove i64x2.mul
Thomas Lively [Wed, 22 Aug 2018 23:06:27 +0000 (23:06 +0000)]
[WebAssembly] Arbitrary BUILD_VECTOR and remove i64x2.mul

Summary:
This CL adds support for arbitrary BUILD_VECTORS, i.e. not splats and
not consts. This is the last feature needed to properly lower v2i64
multiplies without a i64x2.mul instruction (which is not in the spec),
so i64x2.mul is removed as well.

Reviewers: aheejin, dschuff

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

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

Remove unnecessary condition and fix whitespace

llvm-svn: 340472

5 years ago[Driver] Check normalized triples for multiarch runtime path
Petr Hosek [Wed, 22 Aug 2018 22:56:46 +0000 (22:56 +0000)]
[Driver] Check normalized triples for multiarch runtime path

Previously we only used target triple as provided which matches the
GCC behavior, but it also means that all clients have to be consistent
in their spelling of target triples since e.g. x86_64-linux-gnu and
x86_64-unknown-linux-gnu will result in Clang driver looking at two
different paths when searching for runtime libraries.

Unfortunatelly, as it turned out many clients aren't consistent in
their spelling of target triples, e.g. many Linux distributions use
the shorter spelling but config.guess and rustc insist on using the
normalized variant which is causing issues. To avoid having to ship
multiple copies of runtimes for different triple spelling or rely on
symlinks which are not portable, we should also check the normalized
triple when constructing paths for multiarch runtimes.

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

llvm-svn: 340471

5 years ago[hwasan] make error reporting look more like in asan, print the memory tag around...
Kostya Serebryany [Wed, 22 Aug 2018 22:55:16 +0000 (22:55 +0000)]
[hwasan] make error reporting look more like in asan, print the memory tag around the buggy access, simplify one test

llvm-svn: 340470

5 years ago[SelectionDAG] unroll unsupported vector FP ops earlier to avoid libcalls on undef...
Sanjay Patel [Wed, 22 Aug 2018 22:52:05 +0000 (22:52 +0000)]
[SelectionDAG] unroll unsupported vector FP ops earlier to avoid libcalls on undef elements (PR38527)

This solves the motivating case from:
https://bugs.llvm.org/show_bug.cgi?id=38527

If we are legalizing an FP vector op that maps to 1 of the LLVM intrinsics that mimic libm calls,
but we're going to end up with scalar libcalls for that vector type anyway, then we should unroll
the vector op into scalars before widening. This avoids libcalls because we've lost the knowledge
that some of the scalar elements are undef.

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

llvm-svn: 340469

5 years ago[ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt
Raphael Isemann [Wed, 22 Aug 2018 22:51:37 +0000 (22:51 +0000)]
[ASTImporter] Add test for ObjCAtTryStmt/ObjCAtCatchStmt/ObjCAtThrowStmt

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

llvm-svn: 340468

5 years ago[ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.
Raphael Isemann [Wed, 22 Aug 2018 22:50:45 +0000 (22:50 +0000)]
[ASTImporter] Actually test ArrayInitLoopExpr in the array-init-loop-expr test.

Summary:
The `array-init-loop-expr` test is currently not testing the importing of ArrayInitLoopExprs.

This is because we import the `S` struct into the `test.cpp` context
and only do a copy-assignment in `test.cpp`, so the actual ArrayInitLoopExpr we wanted to
import is generated by clang directly in the target context. This means we actually
never test the importing of ArrayInitLoopExpr with this test, which becomes obvious
when looking at the missing test coverage for the respective  VisitArrayInitLoopExpr method.

This patch moves the copy-assignment of our struct to the `S.cpp` context, which means
that `test.cpp` now actually has to import the ArrayInitLoopExpr.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 340467

5 years ago[ASTImporter] Remove duplicated and dead CXXNamedCastExpr handling code.
Raphael Isemann [Wed, 22 Aug 2018 22:49:32 +0000 (22:49 +0000)]
[ASTImporter] Remove duplicated and dead CXXNamedCastExpr handling code.

Summary:
`CXXNamedCastExpr` importing is already handled in the respective `VisitCXXNamedCastExpr` method.
So this code here can never be reached under normal circumstances and we might as well remove it.

This patch shouldn't change any observable behavior of the ASTImporter.

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

llvm-svn: 340466

5 years ago[ASTImporter] Add test for ObjCTypeParamDecl
Raphael Isemann [Wed, 22 Aug 2018 22:48:40 +0000 (22:48 +0000)]
[ASTImporter] Add test for ObjCTypeParamDecl

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

llvm-svn: 340465

5 years ago[ASTImporter] Add test for SwitchStmt
Raphael Isemann [Wed, 22 Aug 2018 22:47:10 +0000 (22:47 +0000)]
[ASTImporter] Add test for SwitchStmt

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: a_sidorin, martong, cfe-commits

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

llvm-svn: 340464

5 years ago[ASTImporter] Add test for ObjCAutoreleasePoolStmt
Raphael Isemann [Wed, 22 Aug 2018 22:45:04 +0000 (22:45 +0000)]
[ASTImporter] Add test for ObjCAutoreleasePoolStmt

Reviewers: a.sidorin, a_sidorin

Reviewed By: a_sidorin

Subscribers: martong, cfe-commits

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

llvm-svn: 340463

5 years ago[NFC] Expand test cases for simplifying pow()
Evandro Menezes [Wed, 22 Aug 2018 22:44:06 +0000 (22:44 +0000)]
[NFC] Expand test cases for simplifying pow()

llvm-svn: 340462

5 years ago[MemorySSA] Invalidate optimized Defs upon moving them; NFC
George Burgess IV [Wed, 22 Aug 2018 22:34:38 +0000 (22:34 +0000)]
[MemorySSA] Invalidate optimized Defs upon moving them; NFC

We're currently getting this behavior implicitly, since we determine if
a Def's optimization is valid based on the ID of its defining access.
This is incorrect, though I wouldn't be surprised if this was masked in
part by that we're using a WeakVH to track what Defs are optimized to.
(Not to mention that we don't move Defs super often, AFAICT). I'll
submit a patch to fix this shortly.

This also includes a minor refactor to reduce duplication a bit.

No test is included, since like said, this already happens to be our
behavior. I'll add a test for this with my fix to the other bug
mentioned above.

llvm-svn: 340461