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
Craig Topper [Fri, 14 Apr 2017 06:43:34 +0000 (06:43 +0000)]
[ValueTracking] Calculate the KnownZeros for Intrinsic::ctpop without using a temporary APInt to count leading zeros on.
The APInt was created from an 'unsigned' and we just wanted to know how many bits the value needed to represent it. We can just use Log2_32 from MathExtras.h to get the info.
llvm-svn: 300309
Craig Topper [Fri, 14 Apr 2017 06:43:32 +0000 (06:43 +0000)]
[ValueTracking] Use APInt::isNegative(). NFC
llvm-svn: 300308
Craig Topper [Fri, 14 Apr 2017 06:43:29 +0000 (06:43 +0000)]
[ValueTracking] Use APInt::sext instead of zext and setBitsFrom. NFC
llvm-svn: 300307
Konstantin Zhuravlyov [Fri, 14 Apr 2017 05:33:57 +0000 (05:33 +0000)]
[AMDGPU][GFX9] Set +fp32-denormals for >=gfx900 unless -cl-denorms-are-zero is set
Differential Revision: https://reviews.llvm.org/D31482
llvm-svn: 300306
Craig Topper [Fri, 14 Apr 2017 05:09:04 +0000 (05:09 +0000)]
[InstCombine] Use APInt::setSignBit and APInt::isNegative(). NFC
llvm-svn: 300305
Xinliang David Li [Fri, 14 Apr 2017 04:14:29 +0000 (04:14 +0000)]
Fix use after free error
llvm-svn: 300304
NAKAMURA Takumi [Fri, 14 Apr 2017 03:16:48 +0000 (03:16 +0000)]
clang/test/CoverageMapping/unused_names.c: Relax an expression for targeting PECOFF.
llvm-svn: 300303
Xinliang David Li [Fri, 14 Apr 2017 03:03:24 +0000 (03:03 +0000)]
Fix test failure on windows: pass module to getInstrProfXXName calls
llvm-svn: 300302
Xinliang David Li [Fri, 14 Apr 2017 03:01:25 +0000 (03:01 +0000)]
Remove unused function /nfc
llvm-svn: 300301
Peter Collingbourne [Fri, 14 Apr 2017 02:55:06 +0000 (02:55 +0000)]
Object, LTO: Add target triple to irsymtab and LTO API.
Start using it in LLD to avoid needing to read bitcode again just to get the
target triple, and in llvm-lto2 to avoid printing symbol table information
that is inappropriate for the target.
Differential Revision: https://reviews.llvm.org/D32038
llvm-svn: 300300
Daniel Berlin [Fri, 14 Apr 2017 02:53:37 +0000 (02:53 +0000)]
NewGVN: Don't propagate over phi backedges where undef causes us to
have >1 value, unless we can prove the phi node is cycle free.
Fixes PR 32607.
llvm-svn: 300299
Peter Collingbourne [Fri, 14 Apr 2017 02:34:47 +0000 (02:34 +0000)]
COFF: Remove some unused fields.
llvm-svn: 300298
Peter Collingbourne [Fri, 14 Apr 2017 02:34:32 +0000 (02:34 +0000)]
ELF: Remove some dead code.
llvm-svn: 300297
Richard Smith [Fri, 14 Apr 2017 02:04:44 +0000 (02:04 +0000)]
Remove empty test directory for nonexistent standard clause.
llvm-svn: 300296
Vedant Kumar [Fri, 14 Apr 2017 01:59:44 +0000 (01:59 +0000)]
[docs] UBSan: Mention that print_stacktrace=1 is unsupported on Darwin
Printing out stack traces along with UBSan diagnostics is unsupported on
Darwin. That's because it isn't possible to use the fast unwinder or the
slow unwinder.
Apparently, it's inappropriate to use the fast unwinder for UBSan
issues. I'm not exactly sure why (see the comment in ubsan_diag.cc).
Forcing use of the fast unwinder produces decent results, AFAICT.
Darwin also does not appear to have a slow unwinder suitable for use
with the sanitizers. Apparently that's because of PR20800 [1][2]. But
that bug has been fixed. I'm not sure if there is anything preventing
use of the slow unwinder now.
Currently, passing UBSAN_OPTIONS=print_stacktrace=1 does nothing on
Darwin. This isn't good, but it might be a while before we can fix the
situation, so we should at least document it.
[1] https://github.com/google/sanitizers/issues/137
"We can't use the slow unwinder on OSX now, because Clang produces
incorrect unwind info for the ASan runtime functions on OSX
(http://llvm.org/PR20800)."
[2] https://bugs.llvm.org/show_bug.cgi?id=20800
Bug 20800 - Invalid compact unwind info generated for a function without
frame pointers on OSX
llvm-svn: 300295
Rui Ueyama [Fri, 14 Apr 2017 01:35:04 +0000 (01:35 +0000)]
Remove useless local variable.
llvm-svn: 300294
Rui Ueyama [Fri, 14 Apr 2017 01:34:45 +0000 (01:34 +0000)]
Replace uintX_t with uint64_t.
We generally want to use uint64_t instead of uintX_t if the 64-bit
type works for both 32-bit and 64-bit because it is simpler than
the variable-size type.
llvm-svn: 300293
Sanjoy Das [Fri, 14 Apr 2017 01:33:15 +0000 (01:33 +0000)]
Use range-for; NFC
llvm-svn: 300292
Sanjoy Das [Fri, 14 Apr 2017 01:33:13 +0000 (01:33 +0000)]
Use transform instead of manual loop; NFC
llvm-svn: 300291
Kuba Mracek [Fri, 14 Apr 2017 01:00:03 +0000 (01:00 +0000)]
Revert r300287.
llvm-svn: 300290
NAKAMURA Takumi [Fri, 14 Apr 2017 00:36:06 +0000 (00:36 +0000)]
LLVMCodeGen: Add ProfileData into deps corresponding to r300277.
llvm-svn: 300289
Stanislav Mekhanoshin [Fri, 14 Apr 2017 00:33:44 +0000 (00:33 +0000)]
[AMDGPU] added SIInstrInfo::getAddNoCarry() helper
Addressed rest of post submit comments from D31993.
Differential Revision: https://reviews.llvm.org/D32057
llvm-svn: 300288
Kuba Mracek [Fri, 14 Apr 2017 00:32:43 +0000 (00:32 +0000)]
[ObjC] Fix lifetime markers of loop variable in EmitObjCForCollectionStmt
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). The markers of the loop variable need to be either both inside the loop (so that we poison and unpoison the variable in each iteration), or both outside. This patch implements the "both inside" approach.
Differential Revision: https://reviews.llvm.org/D32029
llvm-svn: 300287
Lang Hames [Fri, 14 Apr 2017 00:06:12 +0000 (00:06 +0000)]
[ORC] Re-enable the Error/Expected unit tests that were disabled in r300177.
The tests were failing due to an occasional deadlock in SerializationTraits
for Error: Both serializers and deserializers were protected by a single
mutex and in the unit test (where both ends of the RPC are in the same
process) one side might obtain the mutex, then block waiting for input,
leaving the other side of the connection unable to obtain the mutex to
write the data the first side was waiting for. Splitting the mutex into
two (one for serialization, one for deserialization) appears to have fixed the
issue.
llvm-svn: 300286
Reid Kleckner [Fri, 14 Apr 2017 00:06:06 +0000 (00:06 +0000)]
Simplify some Verifier attribute checks with AttributeSet
Now that we have a type that can represent the attributes on a single
return, function, or parameter, we can pass it around directly rather
than passing around AttributeList and Idx. Removes some more one-based
argument attribute index counting.
NFC
llvm-svn: 300285
Rui Ueyama [Thu, 13 Apr 2017 23:49:54 +0000 (23:49 +0000)]
Remove useless namespaces.
llvm-svn: 300284