Haojian Wu [Thu, 20 Oct 2016 11:32:47 +0000 (11:32 +0000)]
[Clang-tidy]: Fix modernize-avoid-bind erroneous scope resolution.
Hello, i would like to suggest a fix for one of the checks in clang-tidy and i should hope this one is the correct mailing list.
The check is modernize-avoid-bind.
Consider the following:
void bar(int x, int y);
namespace N {
void bar(int x, int y);
}
void foo(){
auto Test = std::bind(N::bar,1,1);
}
clang-tidy’s modernize-avoid-bind check suggests writing:
void foo(){
auto Test =[] {return bar(1,1);};
}
instead of:
void foo(){
auto Test = [] {return N::bar(1,1);};
}
So clang-tidy has proposed an incorrect Fix.
Patch by IdrissRio!
Reviewers: alexfh, hokein, aaron.ballman
Subscriber: cfe-commits
llvm-svn: 284719
Michael Kruse [Thu, 20 Oct 2016 11:16:19 +0000 (11:16 +0000)]
[cmake] Avoid warnings in feature tests. NFC.
Apply the __attribute__((unused)) before the function to unambiguously apply to
the function declaration.
Add more casts-to-void to mark return values unused as intended.
Contributed-by: Andy Gibbs <andyg1001@hotmail.co.uk>
llvm-svn: 284718
Simon Pilgrim [Thu, 20 Oct 2016 11:10:21 +0000 (11:10 +0000)]
[DAGCombiner] Add general constant vector support to (srl (shl x, c), c) -> (and x, cst2)
We already supported scalar constant / splatted constant vector - now accepts any (non opaque) constant scalar / vector
llvm-svn: 284717
Rafael Espindola [Thu, 20 Oct 2016 10:55:58 +0000 (10:55 +0000)]
Compact SectionPiece.
We allocate a lot of these when linking debug info. This speeds up the
link of debug programs by 1% to 2%.
llvm-svn: 284716
Simon Pilgrim [Thu, 20 Oct 2016 10:53:38 +0000 (10:53 +0000)]
Wdocumentation fix
llvm-svn: 284715
Simon Pilgrim [Thu, 20 Oct 2016 10:42:14 +0000 (10:42 +0000)]
Fix spelling mistake in comment.
llvm-svn: 284714
Simon Pilgrim [Thu, 20 Oct 2016 10:37:58 +0000 (10:37 +0000)]
Fix MSVC bool -> uint64_t promotion warning
llvm-svn: 284713
Peter Smith [Thu, 20 Oct 2016 10:16:13 +0000 (10:16 +0000)]
[ELF] Add REQUIRES: arm to test to fix buildbot without ARM backend.
llvm-svn: 284711
Peter Smith [Thu, 20 Oct 2016 09:59:26 +0000 (09:59 +0000)]
[ELF] Allow relative exceptions relocations in shared libraries
The R_ARM_PREL31 and R_ARM_NONE relocations should not be faulted in
shared libraries. In the case of R_ARM_NONE, we have moved the TLS
relaxation hint instruction to R_TLSDESC_CALL so that R_HINT can be used
without side-effects. In the case of R_ARM_PREL31 we permit it to be used
against PLT entries as the personality routines are imported when used in
shared libraries.
Differential Revision: https://reviews.llvm.org/D25721
llvm-svn: 284710
Eugene Leviant [Thu, 20 Oct 2016 09:39:09 +0000 (09:39 +0000)]
Don't include PHDRs if linker script doesn't want them
This script below shouldn't include file and program headers
to PT_LOAD segment, because it doesn't have PHDRS and FILEHDR
attributes:
PHDRS { all PT_LOAD; }
SECTIONS { /* list of sections here */ }
Differential revision: https://reviews.llvm.org/D25774
llvm-svn: 284709
George Rimar [Thu, 20 Oct 2016 09:19:48 +0000 (09:19 +0000)]
[ELF] - Partial support of --gdb-index command line option (Part 1).
In this patch partial gdb_index section is created.
For costructing the .gdb_index section 6 steps should be performed (details are in
SplitDebugInfo.cpp file header), this patch do first 3:
Creates proper section header.
Fills list of compilation units.
Types CU list area is not supposed to be supported, so it is ignored and therefore
can be treated as implemented either.
Differential revision: https://reviews.llvm.org/D24706
llvm-svn: 284708
Benjamin Kramer [Thu, 20 Oct 2016 09:14:39 +0000 (09:14 +0000)]
[Go bindings] Update for r284678 API changes.
Alignment moved from createBasicType to createAutoVariable.
llvm-svn: 284707
Omair Javaid [Thu, 20 Oct 2016 09:07:26 +0000 (09:07 +0000)]
Fix ARM/AArch64 Step-Over watchpoint issue remove provision for duplicate watchpoints
This patch fixes ARM/AArch64 watchpoint bug which was taking inferior out of control while stepping over watchpoints.
Also adds a test case that tests above problem.
Differential revision: https://reviews.llvm.org/D25057
llvm-svn: 284706
George Rimar [Thu, 20 Oct 2016 08:36:42 +0000 (08:36 +0000)]
[ELF] - Applied clang format. NFC.
llvm-svn: 284705
Jonas Paulsson [Thu, 20 Oct 2016 08:27:16 +0000 (08:27 +0000)]
[SystemZ] Post-RA scheduler implementation
Post-RA sched strategy and scheduling instruction annotations for z196, zEC12
and z13.
This scheduler optimizes decoder grouping and balances processor resources
(including side steering the FPd unit instructions).
The SystemZHazardRecognizer keeps track of the scheduling state, which can
be dumped with -debug-only=misched.
Reviers: Ulrich Weigand, Andrew Trick.
https://reviews.llvm.org/D17260
llvm-svn: 284704
George Rimar [Thu, 20 Oct 2016 08:22:54 +0000 (08:22 +0000)]
[ELF] - Testcase checking that we do not crash on invalid sh_info in SHT_GROUP sections. NFC.
Fix was landed as r284702 "[Object/ELF] - Check index argument in getSymbol()."
Patch contains LLD testcase only.
llvm-svn: 284703
George Rimar [Thu, 20 Oct 2016 08:03:10 +0000 (08:03 +0000)]
[Object/ELF] - Check index argument in getSymbol().
Without this check LLD crashes when SHT_GROUP section has invalid symbol index
because of next code:
template <class ELFT>
StringRef elf::ObjectFile<ELFT>::getShtGroupSignature(const Elf_Shdr &Sec) {
..
const Elf_Sym *Sym = Obj.getSymbol(Symtab, Sec.sh_info);
..
}
If sh_info is too large, &Symbols[Index] just asserts.
No testcases provided because llvm-objdump/llvm-readelf does
not use getSymbol() function.
I`ll commit testcase for LLD separatelly.
Differential revision: https://reviews.llvm.org/D25516
llvm-svn: 284702
Richard Smith [Thu, 20 Oct 2016 07:53:17 +0000 (07:53 +0000)]
Work around MSVC rejects-valid. Apparenty (some versions of) MSVC will check
that a member is default-initializable even if it's initialized by a default
member initializer.
llvm-svn: 284701
Rui Ueyama [Thu, 20 Oct 2016 06:44:58 +0000 (06:44 +0000)]
Add a helper function to define symbols.
Also replace std::copy with memcpy because in other places we are
using memcpy.
llvm-svn: 284700
Rui Ueyama [Thu, 20 Oct 2016 06:34:03 +0000 (06:34 +0000)]
Rename variables so that they are more in line with rest of the code.
llvm-svn: 284699
Rui Ueyama [Thu, 20 Oct 2016 05:35:25 +0000 (05:35 +0000)]
Update document.
llvm-svn: 284698
Rui Ueyama [Thu, 20 Oct 2016 05:23:23 +0000 (05:23 +0000)]
Format. NFC.
llvm-svn: 284697
Rui Ueyama [Thu, 20 Oct 2016 05:12:29 +0000 (05:12 +0000)]
Remove Config::Binary.
This member is used only by LinkerDriver, so move it to LinkerDriver.
llvm-svn: 284696
Rui Ueyama [Thu, 20 Oct 2016 05:03:49 +0000 (05:03 +0000)]
Remove an optional parameter from LinkerDriver::addFile to simplify.
llvm-svn: 284695
Rui Ueyama [Thu, 20 Oct 2016 04:47:47 +0000 (04:47 +0000)]
Split LinkerDriver::createFiles. NFC.
llvm-svn: 284694
Rui Ueyama [Thu, 20 Oct 2016 04:47:45 +0000 (04:47 +0000)]
Fix error message for unknown -format argument.
-format=<foo>, -format <foo> and -b <foo> are all the same.
Previous code was intended to produce an error message with the
same spelling as given from the command line, but it actually
always printed out this string: "unknown -format= value:".
This is probably more confusing than "unknown -format value:".
So I changed the message.
llvm-svn: 284693
Rui Ueyama [Thu, 20 Oct 2016 04:36:36 +0000 (04:36 +0000)]
Simplify. NFC.
llvm-svn: 284692
Eric Fiselier [Thu, 20 Oct 2016 03:31:07 +0000 (03:31 +0000)]
Attempt to workaround XPASS for aligned allocation tests
llvm-svn: 284691
Erik Pilkington [Thu, 20 Oct 2016 02:46:22 +0000 (02:46 +0000)]
Replace uses of LLVM_FUNCTION_NAME with __func__, this was macro was removed from llvm/Support in r284681
llvm-svn: 284690
Tobias Grosser [Thu, 20 Oct 2016 01:59:24 +0000 (01:59 +0000)]
Update isl to isl-0.17.1-236-ga9c6cc7
This includes isl_id_to_str, which is used in Michael's upcoming DeLICM patch.
llvm-svn: 284689
Peter Collingbourne [Thu, 20 Oct 2016 01:58:34 +0000 (01:58 +0000)]
X86: Allow expressions to appear as u8imm operands.
llvm-svn: 284688
Rui Ueyama [Thu, 20 Oct 2016 01:33:09 +0000 (01:33 +0000)]
Remove std:: from std::size_t.
llvm-svn: 284687
Peter Collingbourne [Thu, 20 Oct 2016 01:21:26 +0000 (01:21 +0000)]
X86: Deduplicate some lowering code. NFCI.
llvm-svn: 284686
Richard Smith [Thu, 20 Oct 2016 01:20:00 +0000 (01:20 +0000)]
Refactor and simplify Sema::FindCompositePointerType. No functionality change intended.
llvm-svn: 284685
Richard Smith [Thu, 20 Oct 2016 00:55:15 +0000 (00:55 +0000)]
PR26276: Fix detection of non-cast-expressions as operands of fold-expressions.
llvm-svn: 284684
Victor Leschuk [Thu, 20 Oct 2016 00:37:07 +0000 (00:37 +0000)]
Upgrade debug-info-vla test: we do not pass default alignment now
llvm-svn: 284683
Victor Leschuk [Thu, 20 Oct 2016 00:26:36 +0000 (00:26 +0000)]
DebugInfo: remove broken bitcode upgrade test
llvm-svn: 284682
Reid Kleckner [Thu, 20 Oct 2016 00:22:23 +0000 (00:22 +0000)]
Use __func__ directly now that all supported compilers support it
Remove the portability macro now that it is unused.
llvm-svn: 284681
Reid Kleckner [Thu, 20 Oct 2016 00:13:34 +0000 (00:13 +0000)]
Fix narrowing conversion error in 32-bit MSVC builds
Use size_t instead of ELFT::uint for the string table offset. If the
linker is built 32-bit, it can't write an output file larger than 2GB.
Other code in this area uses size_t as well.
llvm-svn: 284680
Victor Leschuk [Thu, 20 Oct 2016 00:13:19 +0000 (00:13 +0000)]
DebugInfo: pass alignment value only if it was forced
Preparation to implement DW_AT_alignment support:
- We pass non-zero align value to DIBuilder only when alignment was forced
- Modify tests to match this change
Differential Revision: https://reviews.llvm.org/D24426
llvm-svn: 284679
Victor Leschuk [Thu, 20 Oct 2016 00:13:12 +0000 (00:13 +0000)]
DebugInfo: preparation to implement DW_AT_alignment
- Add alignment attribute to DIVariable family
- Modify bitcode format to match new DIVariable representation
- Update tests to match these changes (also add bitcode upgrade test)
- Expect that frontend passes non-zero align value only when it is not default
(was forcibly aligned by alignas()/_Alignas()/__atribute__(aligned())
Differential Revision: https://reviews.llvm.org/D25073
llvm-svn: 284678
Derek Schuff [Thu, 20 Oct 2016 00:10:34 +0000 (00:10 +0000)]
[WebAssembly] Update extending load test for new i1 behavior
r284611 changed the behavior of the DAG legalizer for sign-extending i1
values. Update the wasm extending load test to match.
llvm-svn: 284677
Rui Ueyama [Thu, 20 Oct 2016 00:07:36 +0000 (00:07 +0000)]
Allow linker-script-defined entry symbols.
Previously, we were checking the existence of an entry symbol
too early. It was done before the linker script processor creates
symbols defined in scripts. Fixes bug 30743.
llvm-svn: 284676
Rui Ueyama [Thu, 20 Oct 2016 00:05:46 +0000 (00:05 +0000)]
Fix build failure.
llvm-svn: 284675
Sean Callanan [Thu, 20 Oct 2016 00:03:39 +0000 (00:03 +0000)]
Added a decorator for the macOS version and switched over testcases that used platform.release
llvm-svn: 284674
Richard Smith [Thu, 20 Oct 2016 00:01:36 +0000 (00:01 +0000)]
Fix crash on noreturn conversion in unprototyped function type. Thanks to Keith
Walker for spotting the bug.
llvm-svn: 284673
Reid Kleckner [Wed, 19 Oct 2016 23:52:38 +0000 (23:52 +0000)]
Remove LLVM_NOEXCEPT and replace it with noexcept
Now that we have dropped MSVC 2013, all supported compilers support
noexcept and we can drop this portability macro.
llvm-svn: 284672
Reid Kleckner [Wed, 19 Oct 2016 23:50:50 +0000 (23:50 +0000)]
Use noexcept directly now that all compilers support it
llvm-svn: 284671
Michael J. Spencer [Wed, 19 Oct 2016 23:49:27 +0000 (23:49 +0000)]
[ELF] Replace std::pair with a struct so we have proper names. NFC.
llvm-svn: 284670
Richard Smith [Wed, 19 Oct 2016 23:47:37 +0000 (23:47 +0000)]
Extend hack to work around bad exception specifications for 'swap' members to
also cover libstdc++'s std::__debug::array and std::__profile::array.
llvm-svn: 284669
Kevin Enderby [Wed, 19 Oct 2016 23:44:34 +0000 (23:44 +0000)]
Next set of additional error checks for invalid Mach-O files for the
load commands that use the MachO::thread_command type
but are not used in llvm libObject code but used in llvm tool code.
This includes the LC_UNIXTHREAD and LC_THREAD
load commands.
A quick note about the philosophy of the error checking in
libObject for Mach-O files, the idea behind the checking is
that we never will return a Mach-O file out of libObject that
contains unknown things in the load commands.
To do this the 32-bit ARM and PPC general tread states
needed to be defined as two test case binaries contained
them. If other thread states for other CPUs need to be
added we will do that as needed.
Going forward the LC_MAIN load command is used to
set the entry point in Mach-O executables these days
instead of an LC_UNIXTHREAD as was done in the past.
So today only in core files are LC_THREAD load commands
and thread states usually found.
Other thread states have not yet been defined in
include/Support/MachO.h at this time. But that can be
added as needed with their corresponding checking also
added.
llvm-svn: 284668
Reid Kleckner [Wed, 19 Oct 2016 23:39:55 +0000 (23:39 +0000)]
Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it
llvm-svn: 284667
Jason Molenda [Wed, 19 Oct 2016 23:38:38 +0000 (23:38 +0000)]
Add lldb register definitions for w0-w28, s0-s31, and d0-d31 to
RegisterInfos_arm64.h. These register definitions include the
offset into the register context, which will vary depending on the
endianness of the arm64 target system (e.g. s8 is at offset 0 in
v8 on little-endian, it is at offset 12 on big-endian) and I've
only added the little-endian definitions to the table. If we want
to add a big-endian arm64 target, we'll need a separate table which
uses the big-endian offsets for these registers. I changed the
name of the register table from g_register_infos_arm64 to
g_register_infos_arm64_le to make it explicit that this is the
little-endian version of that table, and updated users of the table
to use the new name.
I added support for the "w", "s", and "d" registers to
RegisterContextDarwin_arm64 but it was more an example than anything
useful -- this plugin is only used when working with core files and
darwin core files do not (today) include the floating point register
context, so it only added the support for the "w" pseudo registers.
When we're connected to a real arm64 device, we use the ProcessGDBRemote
code.
llvm-svn: 284666
Reid Kleckner [Wed, 19 Oct 2016 23:34:58 +0000 (23:34 +0000)]
Update Compiler.h to fail fast when building with MSVC 2013
llvm-svn: 284665
Rong Xu [Wed, 19 Oct 2016 23:31:59 +0000 (23:31 +0000)]
[PGO] Fix a use-after-move. NFC.
llvm-svn: 284664
Rafael Espindola [Wed, 19 Oct 2016 23:13:40 +0000 (23:13 +0000)]
Don't call markLiveAt for non alloc sections.
We don't gc them anyway, so just use an early return in Enqueue.
llvm-svn: 284663
Rui Ueyama [Wed, 19 Oct 2016 23:11:21 +0000 (23:11 +0000)]
Read an expression in the form of "ABSOLUTE(<expr>) op <expr> ...".
Fixes bug 30741.
llvm-svn: 284662
Reid Kleckner [Wed, 19 Oct 2016 23:04:57 +0000 (23:04 +0000)]
Revert "DenseSet: Appease msc18 to define derived constructors explicitly."
This reverts commit r284570. MSVC 18 / 2013 is not supported anymore.
llvm-svn: 284661
Reid Kleckner [Wed, 19 Oct 2016 23:04:41 +0000 (23:04 +0000)]
Update docs to reflect new minimum MSVC version requirement
Mailing list discussion about this:
http://lists.llvm.org/pipermail/llvm-dev/2016-September/104631.html
Code changes to simplify the ifdefs will come next, and can be reverted
without affecting the policy if someone needs it.
llvm-svn: 284660
Rong Xu [Wed, 19 Oct 2016 22:51:17 +0000 (22:51 +0000)]
[PGO] Fix bogus warning for merging empty llvm profile file
Profile runtime can generate an empty raw profile (when there is no function in
the shared library). This empty profile is treated as a text format profile. A
test format profile without the flag of "#IR" is thought to be a clang
generated profile. So in llvm profile merging, we will get a bogus warning of
"Merge IR generated profile with Clang generated profile."
The fix here is to skip the empty profile (when the buffer size is 0) for
profile merge.
Reviewers: vsk, davidxl
Differential Revision: http://reviews.llvm.org/D25687
llvm-svn: 284659
Michael Gottesman [Wed, 19 Oct 2016 22:46:06 +0000 (22:46 +0000)]
[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.
This is needed by downstream projects such as swift to get proper cmake
dependency information for LLVM/Clang targets.
A few months ago I added support for exporting this information for Clang
libraries. In order to be incremental, I did not add support for exporting clang
tools as well at that time. Now such support is needed, so I am committing this
incremental code.
llvm-svn: 284658
Lang Hames [Wed, 19 Oct 2016 22:41:03 +0000 (22:41 +0000)]
[BuildingAJIT] Use the remote target triple to construct the TargetMachine in
Chapter 5.
Chapter 5 demonstrates remote JITing: code is executed on the remote, not the
machine running the REPL, so it's the remote's triple (and TargetMachine) that
we need.
llvm-svn: 284657
Mehdi Amini [Wed, 19 Oct 2016 22:36:07 +0000 (22:36 +0000)]
Add computeHostNumPhysicalCores() implementation for Darwin
Differential Revision: https://reviews.llvm.org/D25800
llvm-svn: 284656
Wei Ding [Wed, 19 Oct 2016 22:34:49 +0000 (22:34 +0000)]
AMDGPU : Add a function to enable and disable IEEEBit for SC and shader
respectively.
Differential Revision: http://reviews.llvm.org/D25789
llvm-svn: 284655
Lang Hames [Wed, 19 Oct 2016 22:19:38 +0000 (22:19 +0000)]
Remove the JIT EH/small code model tests for now.
These tests rely on two sections being allocated with a limited displacement
from one to the other to work. We've never guaranteed this, and consequently
these tests usually fail. That led to them being XFAILed, but now they XPASS
whenever the sections do happen to be allocated nearby in memory. So I'm
removing these for now to get rid of the noise. We can re-instate them if/when
we take the time to implement a displacement-respecting allocator.
llvm-svn: 284654
Richard Smith [Wed, 19 Oct 2016 22:18:42 +0000 (22:18 +0000)]
Add optimization to sizeof...(X) handling: if none of parameter pack X's
corresponding arguments are unexpanded pack expansions, we can compute the
result without substituting them. This significantly improves the memory usage
and performance of make_integer_sequence implementations that do this kind of
thing:
using result = integer_sequence<T, Ns ..., sizeof...(Ns) + Ns ...>;
... but note that such an implementation will still perform O(sizeof...(Ns)^2)
work while building the second pack expansion (we just have a somewhat lower
constant now).
In principle we could get this down to linear time by caching whether the
number of expansions of a pack is constant, or checking whether we're within an
alias template before scanning the pack for pack expansions (since that's the
only case in which we do substitutions within a dependent context at the
moment), but this patch doesn't attempt that.
llvm-svn: 284653
Eli Friedman [Wed, 19 Oct 2016 22:16:32 +0000 (22:16 +0000)]
Don't crash generating debug info for VLA in function prototype.
Fixes regression from r279445.
Differential Revision: https://reviews.llvm.org/D25793
llvm-svn: 284652
Victor Leschuk [Wed, 19 Oct 2016 22:11:07 +0000 (22:11 +0000)]
DebugInfo: use uint32_t for alignment variables.
LLVM now uses uint32_t for DebugInfo alignment for space efficiency,
in this patch we change frontend DebugInfo-related variables to uint32_t too.
Differential Revision: https://reviews.llvm.org/D25621
llvm-svn: 284651
Chris Bieneman [Wed, 19 Oct 2016 21:50:25 +0000 (21:50 +0000)]
[CMake] Make the runtimes directory work with bootstrap builds
This patch builds on clang r284648, and allows the runtime directory to make the bootstrap builds depend on the builtin libraries.
This patch also make the bootstrap build depend on configuring the other runtimes because the libcxx headers are copied during configuration. I have left a TODO in the code to remove that once I come up with a better solution.
llvm-svn: 284650
Sanjay Patel [Wed, 19 Oct 2016 21:23:45 +0000 (21:23 +0000)]
[InstSimplify] fold negation of sign-bit
0 - X --> X, if X is 0 or the minimum signed value
0 - X --> 0, if X is 0 or the minimum signed value and the sub is NSW
I noticed this pattern might be created in the backend after the change from D25485,
so we'll want to add a similar fold for the DAG.
The use of computeKnownBits in InstSimplify may be something to investigate if the
compile time of InstSimplify is noticeable. We could replace computeKnownBits with
specific pattern matchers or limit the recursion.
Differential Revision: https://reviews.llvm.org/D25785
llvm-svn: 284649
Chris Bieneman [Wed, 19 Oct 2016 21:18:48 +0000 (21:18 +0000)]
[CMake] Add clang-bootstrap-deps target
Having this target allows other parts of the build system to add to the bootstrap dependencies without needing to be defined before the bootstrap targets are created.
This will specifically be used connect the builtins build from the LLVM runtimes directory as a dependency of the next build stage.
llvm-svn: 284648
Justin Lebar [Wed, 19 Oct 2016 21:15:01 +0000 (21:15 +0000)]
[CUDA] When we emit an error that might have been deferred, also print a callstack.
Summary:
Previously, when you did something not allowed in a host+device function
and then caused it to be codegen'ed, we would print out an error telling
you that you did something bad, but we wouldn't tell you how we decided
that the function needed to be codegen'ed.
This change causes us to print out a callstack when emitting deferred
errors. This is immensely helpful when debugging highly-templated code,
where it's often unclear how a function became known-emitted.
We only print the callstack once per function, after we print the all
deferred errors.
This patch also switches all of our hashtables to using canonical
FunctionDecls instead of regular FunctionDecls. This prevents a number
of bugs, some of which are caught by tests added here, in which we
assume that two FDs for the same function have the same pointer value.
Reviewers: rnk
Subscribers: cfe-commits, tra
Differential Revision: https://reviews.llvm.org/D25704
llvm-svn: 284647
Chris Bieneman [Wed, 19 Oct 2016 21:12:04 +0000 (21:12 +0000)]
[CMake] Support thin LTO in PGO CMake cache
This allows you to set PGO_INSTRUMENT_LTO=Thin and have it work correctly.
llvm-svn: 284646
Rui Ueyama [Wed, 19 Oct 2016 21:07:29 +0000 (21:07 +0000)]
Avoid using grep command in a test.
This test is failing on FreeBSD bots. This is an attempt to fix it
by not using grep command.
llvm-svn: 284645
Justin Lebar [Wed, 19 Oct 2016 21:03:42 +0000 (21:03 +0000)]
[AST] Add CanonicalDeclPtr<T>.
Summary:
CanonicalDeclPtr<T> is just like a T*, except it calls
T::getCanonicalDecl() on construction.
This is useful as the key in a "set of canonical Decls" -- it's much
less error-prone than calling getCanonicalDecl() every time you touch
the set.
Reviewers: rnk
Subscribers: cfe-commits, tra
Differential Revision: https://reviews.llvm.org/D25703
llvm-svn: 284644
Justin Lebar [Wed, 19 Oct 2016 21:03:38 +0000 (21:03 +0000)]
[CUDA] Emit errors for wrong-side calls made on the same line as non-wrong-side calls.
Summary:
This fixes two related bugs:
1) Previously, if you had a non-wrong side call at some source code
location L, we wouldn't emit errors for wrong-side calls that appeared
at L.
2) We'd only emit one wrong-side error per source code location, when we
actually want to emit it twice if we hit this line more than once due to
e.g. template instantiation.
Reviewers: tra
Subscribers: rnk, cfe-commits
Differential Revision: https://reviews.llvm.org/D25702
llvm-svn: 284643
Vedant Kumar [Wed, 19 Oct 2016 20:53:16 +0000 (20:53 +0000)]
[ubsan] Drop dependency on a 64-bit arch in a test (NFC)
This should fix:
http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/46184
llvm-svn: 284642
Rui Ueyama [Wed, 19 Oct 2016 20:53:07 +0000 (20:53 +0000)]
Move getVersionString to Core and simplify Version.cpp.
llvm-svn: 284641
Vedant Kumar [Wed, 19 Oct 2016 20:28:35 +0000 (20:28 +0000)]
[ubsan] Re-work check lines to try to appease a bot (NFC)
This bot does not produce the IR I expect -- it's missing some
'handler.dynamic_type_cache_miss:' labels. We don't need to rely on
those labels, so get rid of them in hopes of making the bot happy.
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55493
llvm-svn: 284639
Sriraman Tallam [Wed, 19 Oct 2016 20:24:06 +0000 (20:24 +0000)]
New clang option -mpie-copy-relocations to use copy relocations for PIE builds.
Differential Revision: https://reviews.llvm.org/D19996
llvm-svn: 284638
Lang Hames [Wed, 19 Oct 2016 20:22:12 +0000 (20:22 +0000)]
[BuildingAJIT] Make the chapter 5 server export symbols.
This will allow chapter 5 to work on Linux.
llvm-svn: 284637
Vedant Kumar [Wed, 19 Oct 2016 20:21:16 +0000 (20:21 +0000)]
[ubsan] Use the object pointer's type info for devirtualized calls
ubsan reports a false positive 'invalid member call' diagnostic on the
following example (PR30478):
struct Base1 {
virtual int f1() { return 1; }
};
struct Base2 {
virtual int f1() { return 2; }
};
struct Derived2 final : Base1, Base2 {
int f1() override { return 3; }
};
int t1() {
Derived2 d;
return static_cast<Base2 *>(&d)->f1();
}
Adding the "final" attribute to a most-derived class allows clang to
devirtualize member calls into an instance of that class. We should pass
along the type info of the object pointer to avoid the FP. In this case,
that means passing along the type info for 'Derived2' instead of 'Base2'
when checking the dynamic type of static_cast<Base2 *>(&d2).
Differential Revision: https://reviews.llvm.org/D25448
llvm-svn: 284636
Hans Wennborg [Wed, 19 Oct 2016 20:10:03 +0000 (20:10 +0000)]
Typo: nomed struct -> named struct
llvm-svn: 284635
Rui Ueyama [Wed, 19 Oct 2016 20:05:43 +0000 (20:05 +0000)]
Include ARGV[0] in error messages.
This is what other linkers and clang driver do.
Differential Revision: https://reviews.llvm.org/D25780
llvm-svn: 284634
Reid Kleckner [Wed, 19 Oct 2016 19:56:22 +0000 (19:56 +0000)]
[GlobalMerge] Handle non-landingpad EH pads
This code crashed on funclet-style EH instructions such as catchpad,
catchswitch, and cleanuppad. Just treat all EH pad instructions
equivalently and avoid merging the globals they reference through any
use.
llvm-svn: 284633
Artur Pilipenko [Wed, 19 Oct 2016 19:43:54 +0000 (19:43 +0000)]
[IndVarSimplify] Teach calculatePostIncRange to take guards into account
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D25739
llvm-svn: 284632
Matthew Simpson [Wed, 19 Oct 2016 19:22:02 +0000 (19:22 +0000)]
[LV] Avoid emitting trivially dead instructions
Some instructions from the original loop, when vectorized, can become trivially
dead. This happens because of the way we structure the new loop. For example,
we create new induction variables and induction variable "steps" in the new
loop. Thus, when we go to vectorize the original induction variable update, it
may no longer be needed due to the instructions we've already created. This
patch prevents us from creating these redundant instructions. This reduces code
size before simplification and allows greater flexibility in code generation
since we have fewer unnecessary instruction uses.
Differential Revision: https://reviews.llvm.org/D25631
llvm-svn: 284631
Chad Rosier [Wed, 19 Oct 2016 19:09:03 +0000 (19:09 +0000)]
[AliasSetTracker] Add support for memcpy and memmove.
Differential Revision: https://reviews.llvm.org/D25776
llvm-svn: 284630
Artur Pilipenko [Wed, 19 Oct 2016 18:59:03 +0000 (18:59 +0000)]
[IndVarSimplify] Use control-dependent range information to prove non-negativity
This change is motivated by the case when IndVarSimplify doesn't widen a comparison of IV increment because it can't prove IV increment being non-negative. We end up with a redundant trunc of the widened increment on this example.
for.body:
%i = phi i32 [ %start, %for.body.lr.ph ], [ %i.inc, %for.inc ]
%within_limits = icmp ult i32 %i, 64
br i1 %within_limits, label %continue, label %for.end
continue:
%i.i64 = zext i32 %i to i64
%arrayidx = getelementptr inbounds i32, i32* %base, i64 %i.i64
%val = load i32, i32* %arrayidx, align 4
br label %for.inc
for.inc:
%i.inc = add nsw nuw i32 %i, 1
%cmp = icmp slt i32 %i.inc, %limit
br i1 %cmp, label %for.body, label %for.end
There is a range check inside of the loop which guarantees the IV to be non-negative. NSW on the increment guarantees that the increment is also non-negative. Teach IndVarSimplify to use the range check to prove non-negativity of loop increments.
Reviewed By: sanjoy
Differential Revision: https://reviews.llvm.org/D25738
llvm-svn: 284629
Chad Rosier [Wed, 19 Oct 2016 18:50:32 +0000 (18:50 +0000)]
[AliasSetTracker] Return void for add() functions. NFC.
Differential Revision: https://reviews.llvm.org/D25748
llvm-svn: 284628
Sanjay Patel [Wed, 19 Oct 2016 18:42:12 +0000 (18:42 +0000)]
[InstSimplify] move one and add more tests for potential negation folds
llvm-svn: 284627
Rafael Espindola [Wed, 19 Oct 2016 18:34:32 +0000 (18:34 +0000)]
Add a macro for prefetching data.
It will be used in lld.
llvm-svn: 284626
Rui Ueyama [Wed, 19 Oct 2016 18:09:52 +0000 (18:09 +0000)]
Remove ending "." from an error message.
Other error messages don't end with ".".
llvm-svn: 284625
Hans Wennborg [Wed, 19 Oct 2016 18:04:27 +0000 (18:04 +0000)]
MS ABI: Fix assert when generating virtual function call with virtual bases and -flto (PR30731)
getClassAtVTableLocation() was calling
ASTRecordLayout::getBaseClassOffset() on a virtual base, causing an
assert.
Differential Revision: https://reviews.llvm.org/D25779
llvm-svn: 284624
Mehdi Amini [Wed, 19 Oct 2016 18:02:21 +0000 (18:02 +0000)]
[ADT] Zip range adapter
This augments the STLExtras toolset with a zip iterator and range
adapter. Zip comes in two varieties: `zip`, which will zip to the
shortest of the input ranges, and `zip_first`, which limits its
`begin() == end()` checks to just the first range.
Recommit r284035 after MSVC2013 support has been dropped.
Patch by: Bryant Wong <github.com/bryant>
Differential Revision: https://reviews.llvm.org/D23252
llvm-svn: 284623
Mandeep Singh Grang [Wed, 19 Oct 2016 17:56:49 +0000 (17:56 +0000)]
[polly] Fix non-determinism in polly BlockGenerators
Summary: Iterating over SeenBlocks which is a SmallPtrSet results in non-determinism in codegen
Reviewers: jdoerfert, zinob, grosser
Tags: #polly
Differential Revision: https://reviews.llvm.org/D25778
llvm-svn: 284622
Vedant Kumar [Wed, 19 Oct 2016 17:55:44 +0000 (17:55 +0000)]
[llvm-cov] Don't spawn a thread unless ThreadCount > 1
Initializing a ThreadPool with ThreadCount = 1 spawns a thread even
though we don't need to. This is at least slower than it needs to be,
and at worst may somehow be exacerbating PR30735 (llvm-cov times out
on ARM bots).
As a follow-up, I'll try to add logic to llvm::ThreadPool to avoid
spawning a thread when ThreadCount = 1.
llvm-svn: 284621
Simon Dardis [Wed, 19 Oct 2016 17:50:52 +0000 (17:50 +0000)]
[mips][msa] Range check MSA intrinsics with immediates
This patch teaches clang to range check immediates for MIPS MSA instrinsics.
This checking is done strictly in comparison to some existing GCC
implementations. E.g. msa_andvi_b(var, 257) does not result in andvi $wX, 1.
Similarily msa_ldi_b takes a range of -128 to 127.
As part of this effort, correct the existing MSA test as it has both illegal
types and immediates.
Reviewers: vkalintiris
Differential Revision: https://reviews.llvm.org/D25017
llvm-svn: 284620
Krzysztof Parzyszek [Wed, 19 Oct 2016 17:40:36 +0000 (17:40 +0000)]
[AMDGPU] Stop using MCRegisterClass::getSize()
Differential Review: https://reviews.llvm.org/D24675
llvm-svn: 284619
Teresa Johnson [Wed, 19 Oct 2016 17:35:01 +0000 (17:35 +0000)]
[ThinLTO] Default backend threads to heavyweight_hardware_concurrency
Summary:
Changes default backend parallelism from thread::hardware_concurrency to
the new llvm::heavyweight_hardware_concurrency, which for X86 Linux
defaults to the number of physical cores (and will fall back to
thread::hardware_concurrency otherwise). This avoid oversubscribing
the physical cores using hyperthreading.
Reviewers: mehdi_amini, pcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25775
llvm-svn: 284618