Eric Fiselier [Sun, 16 Apr 2017 02:50:40 +0000 (02:50 +0000)]
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>
llvm-svn: 300412
Eric Fiselier [Sun, 16 Apr 2017 02:47:46 +0000 (02:47 +0000)]
Workaround Clang bug regarding template template parameters
llvm-svn: 300411
Eric Fiselier [Sun, 16 Apr 2017 02:40:45 +0000 (02:40 +0000)]
Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector.
This patch cleans up all usages of the following feature test macros inside
<vector> and its tests:
* _LIBCPP_HAS_NO_RVALUE_REFERENCES
* _LIBCPP_HAS_NO_VARIADICS
* _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
Where needed the above guards were replaced with _LIBCPP_CXX03_LANG.
llvm-svn: 300410
Petr Hosek [Sun, 16 Apr 2017 02:25:55 +0000 (02:25 +0000)]
[CMake][libcxx] Fix the --target and --gcc-toolchain flag handling
CMake has the problem with the single dash variant because of the
space, so use the double dash with equal sign version. We also
don't have to pass the target triple when checking for compiler-rt
since that flag is already included in compile flags now.
Differential Revision: https://reviews.llvm.org/D32068
llvm-svn: 300409
Eric Fiselier [Sun, 16 Apr 2017 02:14:31 +0000 (02:14 +0000)]
Cleanup and better scope unique_ptr internals
llvm-svn: 300408
Eric Fiselier [Sun, 16 Apr 2017 02:06:25 +0000 (02:06 +0000)]
Cleanup default_delete specializations
llvm-svn: 300407
Eric Fiselier [Sun, 16 Apr 2017 01:51:04 +0000 (01:51 +0000)]
Overhaul unique_ptr - Implement LWG 2801, 2905, 2520.
This patch overhauls both specializations of unique_ptr while implementing
the following LWG issues:
* LWG 2801 - This issue constrains unique_ptr's constructors when the deleter type
is not default constructible. Additionally it adds SFINAE conditions
to unique_ptr<T[]>::unique_ptr(Up).
* LWG 2905 - This issue reworks the unique_ptr(pointer, /* see below */ deleter)
constructors so that they correctly SFINAE when the deleter argument cannot
be used to construct the stored deleter.
* LWG 2520 - This issue fixes initializing unique_ptr<T[]> from nullptr.
Libc++ had previously implemented this issue, but the suggested resolution
still broke initialization from NULL. This patch re-works the
unique_ptr<T[]>(Up, deleter) overloads so that they accept NULL as well
as nullptr.
llvm-svn: 300406
Craig Topper [Sun, 16 Apr 2017 01:03:51 +0000 (01:03 +0000)]
[APInt] Fix a bug in lshr by a value more than 64 bits above the bit width.
This was throwing an assert because we determined the intra-word shift amount by subtracting the size of the full word shift from the total shift amount. But we failed to account for the fact that we clipped the full word shifts by total words first. To fix this just calculate the intra-word shift as the remainder of dividing by bits per word.
llvm-svn: 300405
Dimitry Andric [Sat, 15 Apr 2017 22:15:01 +0000 (22:15 +0000)]
Use correct registers for "A" inline asm constraint
Summary:
In PR32594, inline assembly using the 'A' constraint on x86_64 causes
llvm to crash with a "Cannot select" stack trace. This is because
`X86TargetLowering::getRegForInlineAsmConstraint` hardcodes that 'A'
means the EAX and EDX registers.
However, on x86_64 it means the RAX and RDX registers, and on 16-bit x86
(ia16?) it means the old AX and DX registers.
Add new register classes in `X86RegisterInfo.td` to support these cases,
and amend the logic in `getRegForInlineAsmConstraint` to cope with
different subtargets. Also add a test case, derived from PR32594.
Reviewers: craig.topper, qcolombet, RKSimon, ab
Reviewed By: ab
Subscribers: ab, emaste, royger, llvm-commits
Differential Revision: https://reviews.llvm.org/D31902
llvm-svn: 300404
Eric Fiselier [Sat, 15 Apr 2017 19:32:02 +0000 (19:32 +0000)]
Implement LWG 2857 for variant. Tests from Casey Carter @ Microsoft.
Also mark LWG 2857 as complete, since the changes to optional and
any were completed by Marshall earlier.
llvm-svn: 300403
Sanjay Patel [Sat, 15 Apr 2017 17:55:06 +0000 (17:55 +0000)]
[InstCombine] allow (X != C1 && X != C2) and similar patterns to match splat vector constants
llvm-svn: 300402
Sanjay Patel [Sat, 15 Apr 2017 17:50:45 +0000 (17:50 +0000)]
[InstCombine] add tests to show missing transforms for vectors; NFC
llvm-svn: 300401
Aaron Ballman [Sat, 15 Apr 2017 12:53:20 +0000 (12:53 +0000)]
Add isStaticStorageClass to the dynamic matcher registry so that it can be used from clang-query.
Patch by Dave Lee.
llvm-svn: 300400
Eric Fiselier [Sat, 15 Apr 2017 12:05:11 +0000 (12:05 +0000)]
Simplify test helper
llvm-svn: 300399
Tobias Grosser [Sat, 15 Apr 2017 08:15:54 +0000 (08:15 +0000)]
Update isl bindings to latest version (+ Polly extensions)
After the isl C++ binding generator is now close to being upstreamed to isl, we
synchronize the latest changes to Polly. These are mostly formatting changes
plus a small interface change for the foreach callback function and some naming
changes in isl::boolean.
llvm-svn: 300398
Eric Fiselier [Sat, 15 Apr 2017 06:49:02 +0000 (06:49 +0000)]
Fix PR32642 - string::insert and string::append don't work with move_iterator.
llvm-svn: 300397
Akira Hatanaka [Sat, 15 Apr 2017 06:42:00 +0000 (06:42 +0000)]
[ObjC] Use empty Objective-C collection literal constants when
available.
Original patch by Douglas Gregor with minor modifications.
This recommits r300389, which broke bots because there have been API
changes since the original patch was written.
rdar://problem/
20689633
llvm-svn: 300396
Eric Christopher [Sat, 15 Apr 2017 06:15:00 +0000 (06:15 +0000)]
When we turn on vsx it should also turn on altivec explicitly, same
with disabling it as well as disabling all vsx specific features when
turning off altivec.
Fixes PR32663.
llvm-svn: 300395
Eric Christopher [Sat, 15 Apr 2017 06:14:52 +0000 (06:14 +0000)]
Tidy checking for the soft float attribute.
llvm-svn: 300394
Eric Christopher [Sat, 15 Apr 2017 06:14:50 +0000 (06:14 +0000)]
Cache the DataLayout rather than looking it up frequently.
llvm-svn: 300393
Serge Pavlov [Sat, 15 Apr 2017 05:53:49 +0000 (05:53 +0000)]
Do not run tests for crash recovery if libstdc++ safe mode is enabled
If expensive checks are enabled, safe mode of libstdc++ is enabled too.
In this mode the library uses more complex data that allow additional
checks, for instance, a container may keep list of iterators that points
to it. If a code crashes it can leave these complex library objects in
inconsistent state. It occurs in a few tests that check error recovery
if compiler crashes. These test hang in expensive check mode, as the
library tries to synchronize access to the iterators pointing to some
container, but corresponding mutex remains locked after the crash.
This fix marks these tests as unsupported if clang is built with
libstdc++ safe mode enabled.
Differential Revision: https://reviews.llvm.org/D31126
llvm-svn: 300392
Akira Hatanaka [Sat, 15 Apr 2017 05:44:27 +0000 (05:44 +0000)]
Revert "[ObjC] Use empty Objective-C collection literal constants when"
This reverts commit r300389. There were mistakes in the changes I made
to CodeGen.
llvm-svn: 300391
Eric Fiselier [Sat, 15 Apr 2017 05:41:45 +0000 (05:41 +0000)]
[libcxx] Fix check-cxx-abilist on OS X
Summary:
Recent commits broke the check-cxx-abilist by changing the default OS X to use `-rexport_library` instead of `-reexport_symbol_list`. Apparently `-reexport_library` doesn't export the symbols into `libc++.dylib`s symbol table, whereas `-reexport_symbol_list` does.
This means the change removed ~500 symbols from the symbol table. I've been told this change is non ABI breaking, but it does make it harder to maintain the ABI lists, and hence the ABI.
This patch fixes the issue by switching back to `-reexport_symbol_list`. It still avoid the issues fixed in r299052 by putting the new/delete symbols in a different symbol list file, which is only exported when LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS in OFF.
Reviewers: mehdi_amini, smeenai, dexonsmith
Reviewed By: smeenai
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D31644
llvm-svn: 300390
Akira Hatanaka [Sat, 15 Apr 2017 05:31:35 +0000 (05:31 +0000)]
[ObjC] Use empty Objective-C collection literal constants when
available.
Original patch by Douglas Gregor with minor modifications.
rdar://problem/
20689633
llvm-svn: 300389
Eric Fiselier [Sat, 15 Apr 2017 05:28:06 +0000 (05:28 +0000)]
Rewrite and cleanup unique_ptr tests.
This patch almost entirely rewrites the unique_ptr tests. There are a couple
of reasons for this:
A) Most of the *.fail.cpp tests were either incorrect or could be better written
as a *.pass.cpp test that uses <type_traits> to check if certain operations
are valid (Ex. Using static_assert(!std::is_copy_constructible_v<T>) instead
of writing a failure test).
B) [unique.ptr.runtime] has very poor test coverage. Many of the constructors
and assignment operators have to tests at all. The special members that have
tests have very few test cases and are typically way out of date.
C) The tests for [unique.ptr.single] and [unique.ptr.runtime] are largely
duplicates of each other. This means common requirements have two different
sets of tests in two different test files. This makes the tests harder to
maintain than if there was a single copy.
To address (A) this patch changes almost all of the *.fail.cpp tests into
.pass.cpp tests using type traits; Allowing the *.fail.cpp tests to be removed.
The address (B) and (C) the tests for [unique.ptr.single] and [unique.ptr.runtime]
have been combined into a single directory, allowing both specializations to share
common tests. Tests specific to the single/runtime specializations are given the
suffix "*.single.pass.cpp" or "*.runtime.pass.cpp".
Finally the unique.ptr test have been moved into the correct directory according
to the standard. Specifically they have been removed from "utilities/memory" into
"utilities/smartptr".
PS. This patch also adds newly written tests for upcoming unique_ptr changes/fixes.
However since these tests don't currently pass they are guarded by the macro
TEST_WORKAROUND_UPCOMING_UNIQUE_PTR_CHANGES. This allows other STL's to validate
the tests before libc++ implements the changes. The relevant libc++ changes should
land in the next week.
llvm-svn: 300388
Eric Fiselier [Sat, 15 Apr 2017 02:45:43 +0000 (02:45 +0000)]
Make clang-format use C++03 syntax
llvm-svn: 300387
Zachary Turner [Sat, 15 Apr 2017 02:44:53 +0000 (02:44 +0000)]
Fix crash when completing in the current directory.
llvm-svn: 300386
Davide Italiano [Sat, 15 Apr 2017 01:50:51 +0000 (01:50 +0000)]
[MachO/X86_64] Simplify isDataInCodeTransition().
llvm-svn: 300385
Davide Italiano [Sat, 15 Apr 2017 01:42:55 +0000 (01:42 +0000)]
[MachO/AArch64] Merge multiple switch cases into one. NFCI.
llvm-svn: 300384
Vedant Kumar [Sat, 15 Apr 2017 00:10:33 +0000 (00:10 +0000)]
[profile] Sync up InstrProfData.inc (NFC)
llvm-svn: 300383
Vedant Kumar [Sat, 15 Apr 2017 00:10:05 +0000 (00:10 +0000)]
[Coverage] Use the new getInstrProfSectionName API (NFC)
llvm-svn: 300382
Vedant Kumar [Sat, 15 Apr 2017 00:09:57 +0000 (00:09 +0000)]
[ProfileData] Unify getInstrProf*SectionName helpers
This is a version of D32090 that unifies all of the
`getInstrProf*SectionName` helper functions. (Note: the build failures
which D32090 would have addressed were fixed with r300352.)
We should unify these helper functions because they are hard to use in
their current form. E.g we recently introduced more helpers to fix
section naming for COFF files. This scheme doesn't totally succeed at
hiding low-level details about section naming, so we should switch to an
API that is easier to maintain.
This is not an NFC commit because it fixes llvm-cov's testing support
for COFF files (this falls out of the API change naturally). This is an
area where we lack tests -- I will see about adding one as a follow up.
Testing: check-clang, check-profile, check-llvm.
Differential Revision: https://reviews.llvm.org/D32097
llvm-svn: 300381
Duncan P. N. Exon Smith [Sat, 15 Apr 2017 00:07:57 +0000 (00:07 +0000)]
Modules: Do not serialize #pragma pack state
The modules side of r299226, which serializes #pragma pack state,
doesn't work well.
The main purpose was to make -include and -include-pch match semantics
(the PCH side). We also started serializing #pragma pack in PCMs, in
the hopes of making modules and non-modules builds more consistent. But
consider:
$ cat a.h
$ cat b.h
#pragma pack(push, 2)
$ cat module.modulemap
module M {
module a { header "a.h" }
module b { header "b.h" }
}
$ cat t.cpp
#include "a.h"
#pragma pack(show)
As of r299226, the #pragma pack(show) gives "2", even though we've only
included "a.h".
- With -fmodules-local-submodule-visibility, this is clearly wrong. We
should get the default state (8 on x86_64).
- Without -fmodules-local-submodule-visibility, this kind of matches how
other things work (as if include-the-whole-module), but it's still
really terrible, and it doesn't actually make modules and non-modules
builds more consistent.
This commit disables the serialization for modules, essentially a
partial revert of r299226.
Going forward:
1. Having this #pragma pack stuff escape is terrible design (or, more
often, a horrible bug). We should prioritize adding warnings (maybe
-Werror by default?).
2. If we eventually reintroduce this for modules, it should only apply
to -fmodules-local-submodule-visibility, and it should be tracked on
a per-submodule basis.
llvm-svn: 300380
Sanjoy Das [Fri, 14 Apr 2017 23:47:53 +0000 (23:47 +0000)]
Generalize SCEV's unit testing helper a bit
llvm-svn: 300379
Davide Italiano [Fri, 14 Apr 2017 22:36:08 +0000 (22:36 +0000)]
[Interpreter] Make a static func a lambda and remove always_inline.
The attribute was fairly dubious as: a) we shouldn't tell the compiler
when to inline functions, b) GCC complains that the function may be
not always inlinable.
llvm-svn: 300377
Craig Topper [Fri, 14 Apr 2017 22:34:14 +0000 (22:34 +0000)]
[InstCombine] MakeAnd/Or/Xor handling to reuse previous APInt computations
When checking if we should return a constant, we create some temporary APInts to see if we know all bits. But the exact computations we do are needed in several other locations in the same code.
This patch moves them to named temporaries so we can reuse them.
Ideally we'd write directly to KnownZero/One, but we currently seem to only write those variables after all the simplifications checks and I didn't want to change that with this patch.
Differential Revision: https://reviews.llvm.org/D32094
llvm-svn: 300376
Davide Italiano [Fri, 14 Apr 2017 22:27:28 +0000 (22:27 +0000)]
[ARM/Emulation] Remove an unneeded comparison and simplify. NFCI.
reg0 is always zero and comparison to an unsigned always yields
true.
llvm-svn: 300375
Chris Bieneman [Fri, 14 Apr 2017 22:20:36 +0000 (22:20 +0000)]
Fix bot breakage from r300372
Use #cmakedefine instead of #cmakedefine01 because the uses are ifndef instead of if.
llvm-svn: 300374
Davide Italiano [Fri, 14 Apr 2017 22:04:05 +0000 (22:04 +0000)]
[Process/Utility] Remove dead code. NFCI.
llvm-svn: 300373
Chris Bieneman [Fri, 14 Apr 2017 22:03:45 +0000 (22:03 +0000)]
[CMake] Support generating Config.h
Summary:
This patch removes the hand maintained config files in favor of auto-generating the config file. We will still need to maintain the defines for the Xcode builds on Mac, but all CMake builds use the generated header instead.
This will enable finer grained platform support tests and enable supporting LLDB on more platforms with less manual maintenance.
I have only tested this patch on Darwin, and any help testing it out on other platforms would be greatly appreciated. I've probably messed something up somewhere.
Reviewers: labath, zturner
Reviewed By: labath
Subscribers: krytarowski, emaste, srhines, lldb-commits, mgorny
Differential Revision: https://reviews.llvm.org/D31969
llvm-svn: 300372
Vedant Kumar [Fri, 14 Apr 2017 22:03:37 +0000 (22:03 +0000)]
[ubsan] Don't check alignment if the alignment is 1
If a pointer is 1-byte aligned, there's no use in checking its
alignment. Somewhat surprisingly, ubsan can spend a significant amount
of time doing just that!
This loosely depends on D30283.
Testing: check-clang, check-ubsan, and a stage2 ubsan build.
Differential Revision: https://reviews.llvm.org/D30285
llvm-svn: 300371
Vedant Kumar [Fri, 14 Apr 2017 22:03:34 +0000 (22:03 +0000)]
[ubsan] Reduce alignment checking of C++ object pointers
This patch teaches ubsan to insert an alignment check for the 'this'
pointer at the start of each method/lambda. This allows clang to emit
significantly fewer alignment checks overall, because if 'this' is
aligned, so are its fields.
This is essentially the same thing r295515 does, but for the alignment
check instead of the null check. One difference is that we keep the
alignment checks on member expressions where the base is a DeclRefExpr.
There's an opportunity to diagnose unaligned accesses in this situation
(as pointed out by Eli, see PR32630).
Testing: check-clang, check-ubsan, and a stage2 ubsan build.
Along with the patch from D30285, this roughly halves the amount of
alignment checks we emit when compiling X86FastISel.cpp. Here are the
numbers from patched/unpatched clangs based on r298160.
------------------------------------------
| Setup | # of alignment checks |
------------------------------------------
| unpatched, -O0 | 24326 |
| patched, -O0 | 12717 | (-47.7%)
------------------------------------------
Differential Revision: https://reviews.llvm.org/D30283
llvm-svn: 300370
Krzysztof Parzyszek [Fri, 14 Apr 2017 21:19:17 +0000 (21:19 +0000)]
[RDF] No longer ignore implicit defs or uses on any instructions
This used to be a Hexagon-specific treatment, but is no longer needed
since it's switched to subregister liveness tracking.
llvm-svn: 300369
Krzysztof Parzyszek [Fri, 14 Apr 2017 21:17:36 +0000 (21:17 +0000)]
[RDF] Correctly enumerate reg units for reg masks
llvm-svn: 300368
Reid Kleckner [Fri, 14 Apr 2017 20:19:02 +0000 (20:19 +0000)]
[IR] Make paramHasAttr to use arg indices instead of attr indices
This avoids the confusing 'CS.paramHasAttr(ArgNo + 1, Foo)' pattern.
Previously we were testing return value attributes with index 0, so I
introduced hasReturnAttr() for that use case.
llvm-svn: 300367
Kostya Serebryany [Fri, 14 Apr 2017 20:11:16 +0000 (20:11 +0000)]
[libFuzzer] more trophies
llvm-svn: 300366
Sam Clegg [Fri, 14 Apr 2017 19:50:44 +0000 (19:50 +0000)]
[WebAssembly] Improve readobj and nm support for wasm
Now that the libObect support for wasm is better we can
have readobj and nm produce more useful output too.
Differential Revision: https://reviews.llvm.org/D31514
llvm-svn: 300365
Sanjay Patel [Fri, 14 Apr 2017 19:23:50 +0000 (19:23 +0000)]
[InstCombine] (X != C1 && X != C2) --> (X | (C1 ^ C2)) != C2
...when C1 differs from C2 by one bit and C1 <u C2:
http://rise4fun.com/Alive/Vuo
And move related folds to a helper function. This reduces code duplication and
will make it easier to remove the scalar-only restriction as a follow-up step.
llvm-svn: 300364
Craig Topper [Fri, 14 Apr 2017 19:20:12 +0000 (19:20 +0000)]
[InstCombine] Support folding a subtract with a constant LHS into a phi node
We currently only support folding a subtract into a select but not a PHI. This fixes that.
I had to fix an assumption in FoldOpIntoPhi that assumed the PHI node was always in operand 0. Now we pass it in like we do for FoldOpIntoSelect. But we still require some dancing to find the Constant when we create the BinOp or ConstantExpr. This is based code is similar to what we do for selects.
Since I touched all call sites, this also renames FoldOpIntoPhi to foldOpIntoPhi to match coding standards.
Differential Revision: https://reviews.llvm.org/D31686
llvm-svn: 300363
Stanislav Mekhanoshin [Fri, 14 Apr 2017 19:11:40 +0000 (19:11 +0000)]
[AMDGPU] set read_only access qualifier for pointers
If a kernel's pointer argument is known to be readonly
set access qualifier accordingly. This allows RT not to
flush caches before dispatches.
Differential Revision: https://reviews.llvm.org/D32091
llvm-svn: 300362
Sam Clegg [Fri, 14 Apr 2017 18:43:57 +0000 (18:43 +0000)]
[Test commit] Cleanup some whitespace in a test file
llvm-svn: 300361
Craig Topper [Fri, 14 Apr 2017 18:42:55 +0000 (18:42 +0000)]
[InstCombine] Regenerate test checks using script. NFC
llvm-svn: 300360
Rui Ueyama [Fri, 14 Apr 2017 18:38:38 +0000 (18:38 +0000)]
[ELF] Remove unused member [NFC]
Patch by Alexander Richardson.
Differential Revision: https://reviews.llvm.org/D32077
llvm-svn: 300359
Vedant Kumar [Fri, 14 Apr 2017 18:24:35 +0000 (18:24 +0000)]
[ubsan] Use the correct tool name in diagnostics
When using ASan and UBSan together, the common sanitizer tool name is
set to "AddressSanitizer". That means that when a UBSan diagnostic is
printed out, it looks like this:
SUMMARY: AddressSanitizer: ...
This can confuse users. Fix it so that we always use the correct tool
name when printing out UBSan diagnostics.
Differential Revision: https://reviews.llvm.org/D32066
llvm-svn: 300358
Sanjay Patel [Fri, 14 Apr 2017 18:19:27 +0000 (18:19 +0000)]
[InstCombine] add/move tests for and/or-of-icmps equality folds; NFC
llvm-svn: 300357
Alexander Shaposhnikov [Fri, 14 Apr 2017 18:12:11 +0000 (18:12 +0000)]
[clang-move] Create ClangMoveActionFactory on stack
This diff removes unnecessary using of unique_ptr with ClangMoveActionFactory (pico cleanup).
NFC
Test plan: make check-clang-tools
Differential revision: https://reviews.llvm.org/D32063
llvm-svn: 300356
Craig Topper [Fri, 14 Apr 2017 17:59:19 +0000 (17:59 +0000)]
[ValueTracking] Avoid undefined behavior in unittest by not making a named ArrayRef from a std::initializer_list
One of the ValueTracking unittests creates a named ArrayRef initialized by a std::initializer_list. The underlying array for an std::initializer_list is only guaranteed to have a lifetime as long as the initializer_list object itself. So this can leave the ArrayRef pointing at an array that no long exists.
This fixes this to just create an explicit array instead of an ArrayRef.
Differential Revision: https://reviews.llvm.org/D32089
llvm-svn: 300354
Craig Topper [Fri, 14 Apr 2017 17:55:41 +0000 (17:55 +0000)]
[InstCombine] Refactor SimplifyUsingDistributiveLaws to more explicitly skip code when LHS/RHS aren't BinaryOperators
Currently this code always makes 2 or 3 calls to tryFactorization regardless of whether the LHS/RHS are BinaryOperators. We make 3 calls when both operands are BinaryOperators with the same opcode. Or surprisingly, when neither are BinaryOperators. This is because getBinOpsForFactorization returns Instruction::BinaryOpsEnd when the operand is not a BinaryOperator. If both LHS and RHS are not BinaryOperators then they both have an Opcode of Instruction::BinaryOpsEnd. When this happens we rely on tryFactorization to early out due to A/B/C/D being null. Similar behavior occurs for the other calls, we rely on getBinOpsForFactorization having made A/B or C/D null to get tryFactorization to early out.
We also rely on these null checks to check the result of getIdentityValue and early out for it.
This patches refactors this to pull these checks up to SimplifyUsingDistributiveLaws so we don't rely on BinaryOpsEnd as a sentinel or this A/B/C/D null behavior. I think this makes this code easier to reason about. Should also give a tiny performance improvement for cases where the LHS or RHS isn't a BinaryOperator.
Differential Revision: https://reviews.llvm.org/D31913
llvm-svn: 300353
Xinliang David Li [Fri, 14 Apr 2017 17:48:40 +0000 (17:48 +0000)]
[Profile] Make host tool aware of object format when quering prof section names
Differential Revision: https://reviews.llvm.org/D32073
llvm-svn: 300352
Alexey Bataev [Fri, 14 Apr 2017 17:47:07 +0000 (17:47 +0000)]
Update tests for the patch.
llvm-svn: 300351
Sanjoy Das [Fri, 14 Apr 2017 17:42:12 +0000 (17:42 +0000)]
Use range-for in a few places
llvm-svn: 300350
Sanjoy Das [Fri, 14 Apr 2017 17:42:10 +0000 (17:42 +0000)]
Rewrite SCEV Normalization using SCEVRewriteVisitor; NFC
Removes all of the boilerplate, cache management etc. from
ScalarEvolutionNormalization, and keeps only the interesting bits.
llvm-svn: 300349
Sanjoy Das [Fri, 14 Apr 2017 17:42:08 +0000 (17:42 +0000)]
Make SCEVRewriteVisitor smarter about when it trys to create SCEVs
This change really saves just one foldingset lookup, but makes
SCEVRewriteVisitor "feature compatible" with the handwritten logic in
ScalarEvolutionNormalization, so that I can change
ScalarEvolutionNormalization to use SCEVRewriteVisitor in a next step.
This is a non-functional change, but _may_ improve performance in some
pathological cases, but that's unlikely.
llvm-svn: 300348
Aaron Ballman [Fri, 14 Apr 2017 17:37:29 +0000 (17:37 +0000)]
Removing a redundant, but harmless, %s; NFC.
llvm-svn: 300347
Sanjoy Das [Fri, 14 Apr 2017 17:25:23 +0000 (17:25 +0000)]
Add missing #include
Again, caught by the modules build.
llvm-svn: 300346
Krzysztof Parzyszek [Fri, 14 Apr 2017 17:25:13 +0000 (17:25 +0000)]
[RDF] Switch RegisterAggr to a bit vector of register units
This avoids many complications related to the complex register
aliasing schemes.
llvm-svn: 300345
Davide Italiano [Fri, 14 Apr 2017 17:22:02 +0000 (17:22 +0000)]
[FunctionImport] assert(false) -> llvm_unreachable(). NFCI.
llvm-svn: 300344
Greg Clayton [Fri, 14 Apr 2017 17:10:04 +0000 (17:10 +0000)]
Increase the packet timeout for the jModulesInfo since it can take longer than the default 1 second timeout on some linux versions when many shared libraries are involved.
llvm-svn: 300342
Greg Clayton [Fri, 14 Apr 2017 17:05:21 +0000 (17:05 +0000)]
Fixed to disassemble new packets and fixed the dumping of the 'x' packets.
llvm-svn: 300341
Kuba Mracek [Fri, 14 Apr 2017 16:53:25 +0000 (16:53 +0000)]
[ObjC] Fix lifetime markers of loop variable in EmitObjCForCollectionStmt [take 2]
CodeGenFunction::EmitObjCForCollectionStmt currently emits lifetime markers for the loop variable in an inconsistent way: lifetime.start is emitted before the loop is entered, but lifetime.end is emitted inside the loop. AddressSanitizer uses these markers to track out-of-scope accesses to local variables, and we get false positives in Obj-C foreach loops (in the 2nd iteration of the loop). This patch keeps the loop variable alive for the whole loop by extending ForScope and registering the cleanup function inside EmitAutoVarAlloca.
Differential Revision: https://reviews.llvm.org/D32029
llvm-svn: 300340
Sanjoy Das [Fri, 14 Apr 2017 16:47:15 +0000 (16:47 +0000)]
Remove "#if 0"ed out assert
It won't compile after the recent changes I've made, and I think
keeping it in provides very little value.
Instead I've added (in an earlier commit) a C++ unit test to check the
Denormalize(Normalized(X)) == X property for specific instances of X,
which is what the assert was trying to do anyway.
llvm-svn: 300339
Sanjoy Das [Fri, 14 Apr 2017 16:47:12 +0000 (16:47 +0000)]
Delete some unnecessary boilerplate
The PostIncTransform class was not pulling its weight, so delete it
and use free functions instead.
This also makes the use of `function_ref` more idiomatic. We were
storing an instance of function_ref in the PostIncTransform class
before, which was fine in that specific case, but the usage after this
change is more obviously okay.
llvm-svn: 300338
Krzysztof Parzyszek [Fri, 14 Apr 2017 16:33:54 +0000 (16:33 +0000)]
[RDF] Refine propagation of reached uses in liveness computation
llvm-svn: 300337
Sanjoy Das [Fri, 14 Apr 2017 16:28:12 +0000 (16:28 +0000)]
Add missing #include for STLExtras
Looks like earlier I was relying on #include ordering in files that
used ScalarEvolutionNormalization.h.
Found thanks to the selfhost modules buildbot!
llvm-svn: 300336
Krzysztof Parzyszek [Fri, 14 Apr 2017 16:21:55 +0000 (16:21 +0000)]
[Hexagon] Fix a latent problem with interpreting live-in lane masks
A non-zero lane mask on a register with no subregister means that the
whole register is live-in. It is equivalent to a full mask.
llvm-svn: 300335
Sanjoy Das [Fri, 14 Apr 2017 15:50:19 +0000 (15:50 +0000)]
Use range for
llvm-svn: 300334
Sanjoy Das [Fri, 14 Apr 2017 15:50:07 +0000 (15:50 +0000)]
Simplify PostIncTransform further; NFC
Instead of having two ways to check if an add recurrence needs to be
normalized, just pass in one predicate to decide that.
llvm-svn: 300333
Sanjoy Das [Fri, 14 Apr 2017 15:50:04 +0000 (15:50 +0000)]
Add a unit test for SCEV Normalization
llvm-svn: 300332
Sanjoy Das [Fri, 14 Apr 2017 15:49:59 +0000 (15:49 +0000)]
Tighten the API for ScalarEvolutionNormalization
llvm-svn: 300331
Sanjoy Das [Fri, 14 Apr 2017 15:49:53 +0000 (15:49 +0000)]
Remove NormalizeAutodetect; NFC
It is cleaner to have a callback based system where the logic of
whether an add recurrence is normalized or not lives on IVUsers.
This is one step in a multi-step cleanup.
llvm-svn: 300330
Krzysztof Parzyszek [Fri, 14 Apr 2017 15:26:34 +0000 (15:26 +0000)]
[Hexagon] Make a couple of passes compliant with -opt-bisect-limit
llvm-svn: 300329
Erich Keane [Fri, 14 Apr 2017 15:21:18 +0000 (15:21 +0000)]
Make Gentoo GNU GCC Config override whitespace tolerant
The config-*triple* file handling isn't tolerant of
leading/trailing whitespace, making it not terribly
obvious when a single extraneous tab/space/etc will
cause the override to be ignored. This patch simply
trims the lines to ensure that it is tolerant of
whitespace.
llvm-svn: 300328
Simon Pilgrim [Fri, 14 Apr 2017 15:21:15 +0000 (15:21 +0000)]
[Bugpoint] Use boolean AND instead of bitwise AND (PR32660)
llvm-svn: 300327
Simon Pilgrim [Fri, 14 Apr 2017 15:05:57 +0000 (15:05 +0000)]
[X86][SSE] Update MOVNTDQA non-temporal loads to generic implementation (clang)
MOVNTDQA non-temporal aligned vector loads can be correctly represented using generic builtin loads, allowing us to remove the existing x86 intrinsics.
LLVM companion patch: D31767.
Differential Revision: https://reviews.llvm.org/D31766
llvm-svn: 300326
Simon Pilgrim [Fri, 14 Apr 2017 15:05:35 +0000 (15:05 +0000)]
[X86][SSE] Update MOVNTDQA non-temporal loads to generic implementation (LLVM)
MOVNTDQA non-temporal aligned vector loads can be correctly represented using generic builtin loads, allowing us to remove the existing x86 intrinsics.
Clang companion patch: D31766.
Differential Revision: https://reviews.llvm.org/D31767
llvm-svn: 300325
Nirav Dave [Fri, 14 Apr 2017 14:36:45 +0000 (14:36 +0000)]
Silence -Wlogical-op-parentheses warning NFC
llvm-svn: 300324
Tobias Grosser [Fri, 14 Apr 2017 13:39:40 +0000 (13:39 +0000)]
Use isl C++ foreach implementation
This commit switches Polly over to the isl::obj::foreach_* implementation, which
is part of the new isl bindings and follows the foreach pattern established in
Polly by Michael Kruse.
The original isl C function:
isl_stat isl_union_set_foreach_set(__isl_keep isl_union_set *uset,
isl_stat (*fn)(__isl_take isl_set *set, void *user), void *user);
which required the user to define a static callback function to which all
interesting parameters are passed via a 'void *' user-pointer, is on the
C++ side available as a function that takes a std::function<>, which can
carry any additional arguments without the need for a user pointer:
stat UnionSet::foreach_set(const std::function<stat(set)> &fn) const;
The following code illustrates the use of the new C++ interface:
auto Lambda = [=, &Result](isl::set Set) -> isl::stat {
auto Shifted = shiftDimension(Set, Pos, Amount);
Result = Result.add(Shifted);
return isl::stat::ok;
}
UnionSet.foreach_set(Lambda);
Polly had some specialized foreach functions which did not require the lambdas
to return a status flag. We remove these functions in this commit to move Polly
completely over to the new isl interface. We may in the future discuss if
functors without return values can be supported easily.
Another extension proposed by Michael Kruse is the use of C++ iterators to allow
the use of normal for loops to iterate over these sets. Such an extension would
allow us to further simplify the code.
Reviewed-by: Michael Kruse <llvm@meinersbur.de>
Differential Revision: https://reviews.llvm.org/D30620
llvm-svn: 300323
Nirav Dave [Fri, 14 Apr 2017 13:34:33 +0000 (13:34 +0000)]
Fix missing virtual destructor to silence build warning.
llvm-svn: 300322
Nirav Dave [Fri, 14 Apr 2017 13:34:30 +0000 (13:34 +0000)]
Reorder StoreMergeCandidates to run faster. NFCI.
llvm-svn: 300321
Gabor Horvath [Fri, 14 Apr 2017 12:31:36 +0000 (12:31 +0000)]
[clang-tidy] Fixes to misc-forwarding-reference-overload check.
* Style fixes to tests
* Make it work consistently on all platforms
Patch by AndrĂ¡s Leitereg!
llvm-svn: 300320
Dmitry Preobrazhensky [Fri, 14 Apr 2017 12:28:07 +0000 (12:28 +0000)]
[AMDGPU][MC] Corrected ds_write_src2_* to require one offset instead of two.
Fixed bug 32551: https://bugs.llvm.org//show_bug.cgi?id=32551
Reviewers: vpykhtin
Differential Revision: https://reviews.llvm.org/D31809
llvm-svn: 300319
Dmitry Preobrazhensky [Fri, 14 Apr 2017 11:52:26 +0000 (11:52 +0000)]
[AMDGPU][MC] Enabled constants for src operands of s_cbranch_g_fork
Fixed bug 32619: https://bugs.llvm.org//show_bug.cgi?id=32619
Reviewers: artem.tamazov, vpykhtin
Differential Revision: https://reviews.llvm.org/D31973
llvm-svn: 300318
George Rimar [Fri, 14 Apr 2017 09:37:00 +0000 (09:37 +0000)]
[ELF] - Linkerscript: make section with no content to be SHT_PROGBITS by default.
Imagine next script:
SECTIONS { BYTE(0x11); }
Section content written to disk will be 0x11. Previous LLD behavior was to make this
section SHT_NOBITS. What is not correct because section has content.
ld.bfd makes such sections SHT_PROGBITS, this patch do the same.
This fixes PR32537
Differential revision: https://reviews.llvm.org/D32016
llvm-svn: 300317
George Rimar [Fri, 14 Apr 2017 09:30:50 +0000 (09:30 +0000)]
[ELF] - Cleanup of align.s testcase. NFC.
llvm-svn: 300316
George Rimar [Fri, 14 Apr 2017 09:23:26 +0000 (09:23 +0000)]
[ELF] LinkerScript: Don't assign zero to all regular symbols
This fixes an assertion `Align != 0u && "Align can't be 0."'
in llvm::alignTo() when a linker script references a globally
defined variable in an ALIGN() context.
Patch by Alexander Richardson !
Differential revision: https://reviews.llvm.org/D31984
llvm-svn: 300315
Andrew V. Tischenko [Fri, 14 Apr 2017 09:17:09 +0000 (09:17 +0000)]
Fix for PR#30562: Selection DAG error: Detected cycle in SelectionDAG.
Patch by Dinar Temirbulatov
llvm-svn: 300314
Vassil Vassilev [Fri, 14 Apr 2017 08:48:08 +0000 (08:48 +0000)]
PR32280: Do not crash on nested initializers.
Patch by Yuka Takahashi (D31591)!
llvm-svn: 300313
Alex Denisov [Fri, 14 Apr 2017 08:34:32 +0000 (08:34 +0000)]
Add more test cases for StringRef::edit_distance
Example strings taken from here: http://www.let.rug.nl/~kleiweg/lev/
llvm-svn: 300312
Andrew V. Tischenko [Fri, 14 Apr 2017 07:44:23 +0000 (07:44 +0000)]
This patch closes PR#32216: Better testing of schedule model instruction latencies/throughputs.
The details are here: https://reviews.llvm.org/D30941
llvm-svn: 300311
Gil Rapaport [Fri, 14 Apr 2017 07:30:23 +0000 (07:30 +0000)]
[LV] Remove implicit single basic block assumption
This patch is part of D28975's breakdown - no change in output intended.
LV's code currently assumes the vectorized loop is a single basic block up
until predicateInstructions() is called. This patch removes two manifestations
of this assumption (loop phi incoming values, dominator tree update) by
replacing the use of vectorLoopBody with the vectorized loop's latch/header.
Differential Revision: https://reviews.llvm.org/D32040
llvm-svn: 300310