David Majnemer [Wed, 15 Oct 2014 04:54:54 +0000 (04:54 +0000)]
MS ABI: Use the correct this arg when generating implicit array copy ctor
We assumed the last argument of the copy constructor was the this
pointer. However, this is not the case under the MS ABI.
llvm-svn: 219775
Richard Trieu [Wed, 15 Oct 2014 03:42:06 +0000 (03:42 +0000)]
Improvements to -Wnull-conversion
Split logic to separate checking function
Refine the macro checking
Catch nullptr->bool conversions
Add some explanatory comments
llvm-svn: 219774
Jingyue Wu [Wed, 15 Oct 2014 03:27:43 +0000 (03:27 +0000)]
[MachineSink] Use the real post dominator tree
Summary:
Fixes a FIXME in MachineSinking. Instead of using the simple heuristics in
isPostDominatedBy, use the real MachinePostDominatorTree and MachineLoopInfo.
The old heuristics caused instructions to sink unnecessarily, and might create
register pressure.
This is the second try of the fix. The first one (D4814) caused a performance
regression due to failing to sink instructions out of loops (PR21115). This
patch fixes PR21115 by sinking an instruction from a deeper loop to a shallower
one regardless of whether the target block post-dominates the source.
Thanks Alexey Volkov for reporting PR21115!
Test Plan:
Added a NVPTX codegen test to verify that our change prevents the backend from
over-sinking. It also shows the unnecessary register pressure caused by
over-sinking.
Added an X86 test to verify we can sink instructions out of loops regardless of
the dominance relationship. This test is reduced from Alexey's test in PR21115.
Updated an affected test in X86.
Also ran SPEC CINT2006 and llvm-test-suite for compilation time and runtime
performance. Results are attached separately in the review thread.
Reviewers: Jiangning, resistor, hfinkel
Reviewed By: hfinkel
Subscribers: hfinkel, bruno, volkalexey, llvm-commits, meheff, eliben, jholewinski
Differential Revision: http://reviews.llvm.org/D5633
llvm-svn: 219773
Jason Molenda [Wed, 15 Oct 2014 03:11:37 +0000 (03:11 +0000)]
Be more consistent about null checks for the Process and ABI
in GetFullUnwindPlanForFrame() - the code was mostly checking
that we had an active Process and ABI but not always.
clang static analyzer fixit.
llvm-svn: 219772
Jason Molenda [Wed, 15 Oct 2014 03:07:39 +0000 (03:07 +0000)]
Make sure local var cu is non-NULL before dereferencing.
(it was checked for NULL-ness in some places, not in others)
clang static analyzer fixit.
llvm-svn: 219771
Jason Molenda [Wed, 15 Oct 2014 03:06:23 +0000 (03:06 +0000)]
Remove unneeded local var initialization.
clang static analyzer fixit.
llvm-svn: 219770
Jason Molenda [Wed, 15 Oct 2014 03:05:38 +0000 (03:05 +0000)]
Make sure is_indirect local var is initialized; there
exists a code path where it could be used while uninitialized.
clang static analyzer fixit.
llvm-svn: 219769
Jason Molenda [Wed, 15 Oct 2014 03:04:33 +0000 (03:04 +0000)]
Ensure that m_syntax is initialized in all the FileSpec
constructors.
clang static analyzer fixit.
llvm-svn: 219768
Tim Northover [Wed, 15 Oct 2014 01:05:01 +0000 (01:05 +0000)]
ARM: drop check for triple that's no longer used.
Early attempts to support AAPCS bare metal MachO targets based the decision on
the CPU being compiled for. This was not a particularly great idea and we've
got a better option now, but this check remained.
No functional change for any target we care about.
llvm-svn: 219767
Justin Bogner [Wed, 15 Oct 2014 00:33:06 +0000 (00:33 +0000)]
Frontend: Don't accept null DiagnosticsEngines when building ASTUnits
The various ways to create an ASTUnit all take a refcounted pointer to
a diagnostics engine as an argument, and if it isn't pointing at
anything they initialize it. This is a pretty confusing API, and it
really makes more sense for the caller to initialize the thing since
they control the lifetime anyway.
This fixes the one caller that didn't bother initializing the pointer
and asserts that the argument is initialized.
llvm-svn: 219752
Eric Christopher [Wed, 15 Oct 2014 00:15:26 +0000 (00:15 +0000)]
Remove unused variable.
llvm-svn: 219751
Eric Christopher [Wed, 15 Oct 2014 00:09:07 +0000 (00:09 +0000)]
Remove unused variable.
llvm-svn: 219750
Eric Christopher [Tue, 14 Oct 2014 23:58:51 +0000 (23:58 +0000)]
No need to cache this unused variable.
Patch by Ehsan Akhgari.
llvm-svn: 219749
Gerolf Hoflehner [Tue, 14 Oct 2014 23:55:00 +0000 (23:55 +0000)]
[AArch64] Wrong CC access in CSINC-conditional branch sequence
This is a follow up to commit r219742. It removes the CCInMI variable
and accesses the CC in CSCINC directly. In the case of a conditional
branch accessing the CC with CCInMI was wrong.
llvm-svn: 219748
Justin Bogner [Tue, 14 Oct 2014 23:36:06 +0000 (23:36 +0000)]
Frontend: Remove some unused arguments in ASTUnit (NFC)
llvm-svn: 219747
Nick Kledzik [Tue, 14 Oct 2014 23:29:38 +0000 (23:29 +0000)]
[llvm-objdump] Update error message and add test case for mach-o file with bad library ordinals
llvm-svn: 219746
Hans Wennborg [Tue, 14 Oct 2014 23:20:25 +0000 (23:20 +0000)]
vadefs.h: be even more conservative and only define the macros if already defined
llvm-svn: 219745
Ehsan Akhgari [Tue, 14 Oct 2014 23:15:44 +0000 (23:15 +0000)]
clang-cl: Diagnose the usage of ASAN with a debug runtime library
Summary:
AddressSanitizer currently doesn't support this configuration, and binaries
built with it will just get into an infinite loop during startup.
Test Plan: Includes an automated test.
Reviewers: samsonov
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5764
llvm-svn: 219744
Hans Wennborg [Tue, 14 Oct 2014 23:15:43 +0000 (23:15 +0000)]
Sort files list in lib/Headers/CMakeLists.txt
majnemer pointed out that vadefs.h was added in the wrong place. Might
as well sort the rest too.
llvm-svn: 219743
Gerolf Hoflehner [Tue, 14 Oct 2014 23:07:53 +0000 (23:07 +0000)]
[AAarch64] Optimize CSINC-branch sequence
Peephole optimization that generates a single conditional branch
for csinc-branch sequences like in the examples below. This is
possible when the csinc sets or clears a register based on a condition
code and the branch checks that register. Also the condition
code may not be modified between the csinc and the original branch.
Examples:
1. Convert csinc w9, wzr, wzr, <CC>;tbnz w9, #0, 0x44
to b.<invCC>
2. Convert csinc w9, wzr, wzr, <CC>; tbz w9, #0, 0x44
to b.<CC>
rdar://problem/
18506500
llvm-svn: 219742
Hal Finkel [Tue, 14 Oct 2014 22:59:49 +0000 (22:59 +0000)]
[LoopVectorize] Ignore @llvm.assume for cost estimates and legality
A few minor changes to prevent @llvm.assume from interfering with loop
vectorization. First, treat @llvm.assume like the lifetime intrinsics, which
are scalarized (but don't otherwise interfere with the legality checking).
Second, ignore the cost of ephemeral instructions in the loop (these will go
away anyway during CodeGen).
Alignment assumptions and other uses of @llvm.assume can often end up inside of
loops that should be vectorized (this is not uncommon for assumptions generated
by __attribute__((align_value(n))), for example).
llvm-svn: 219741
Hans Wennborg [Tue, 14 Oct 2014 22:35:42 +0000 (22:35 +0000)]
MS Compat: interpose vadefs.h to fix definitions of _crt_va_{start,end,arg} (PR21247)
Differential revision: http://reviews.llvm.org/D5784
llvm-svn: 219740
David Majnemer [Tue, 14 Oct 2014 22:35:11 +0000 (22:35 +0000)]
MC, COFF: Make bigobj test compatible with python3
No functionality change intended.
llvm-svn: 219739
Simon Pilgrim [Tue, 14 Oct 2014 22:31:34 +0000 (22:31 +0000)]
[X86][SSE] pslldq/psrldq shuffle mask decodes
Patch to provide shuffle decodes and asm comments for the sse pslldq/psrldq SSE2/AVX2 byte shift instructions.
Differential Revision: http://reviews.llvm.org/D5598
llvm-svn: 219738
David Majnemer [Tue, 14 Oct 2014 22:26:49 +0000 (22:26 +0000)]
MC: Rewrite bigobj test in python
This makes the test easier to work with. No functionality change
intended.
llvm-svn: 219737
David Blaikie [Tue, 14 Oct 2014 22:22:17 +0000 (22:22 +0000)]
DebugInfo: Lazily built static member variable declarations should use the canonical declaration for line/file information.
When lazily constructing static member variable declarations (when
the vtable optimization fires and the definition of the type is omitted
(or built later, lazily), but the out of line definition of the static
member is provided and must be described in debug info) ensure we use
the canonical declaration when computing the file, line, etc for that
declaration (rather than the definition, which is also a declaration,
but not the canonical one).
llvm-svn: 219736
Tim Northover [Tue, 14 Oct 2014 22:12:21 +0000 (22:12 +0000)]
ARM: remove ARM/Thumb distinction for preferred alignment.
Thumb1 has legitimate reasons for preferring 32-bit alignment of types
i1/i8/i16, since the 16-bit encoding of "add rD, sp, #imm" requires #imm to be
a multiple of 4. However, this is a trade-off betweem code size and RAM usage;
the DataLayout string is not the best place to represent it even if desired.
So this patch removes the extra Thumb requirements, hopefully making ARM and
Thumb completely compatible in this respect.
llvm-svn: 219735
Tim Northover [Tue, 14 Oct 2014 22:12:17 +0000 (22:12 +0000)]
ARM: remove ARM/Thumb distinction for preferred alignment.
Thumb1 has legitimate reasons for preferring 32-bit alignment of types
i1/i8/i16, since the 16-bit encoding of "add rD, sp, #imm" requires #imm to be
a multiple of 4. However, this is a trade-off betweem code size and RAM usage;
the DataLayout string is not the best place to represent it even if desired.
So this patch removes the extra Thumb requirements, hopefully making ARM and
Thumb completely compatible in this respect.
llvm-svn: 219734
Tim Northover [Tue, 14 Oct 2014 22:12:14 +0000 (22:12 +0000)]
ARM: allow misaligned local variables in Thumb1 mode.
There's no hard requirement on LLVM to align local variable to 32-bits, so the
Thumb1 frame handling needs to be able to deal with variables that are only
naturally aligned without falling over.
llvm-svn: 219733
Kaelyn Takata [Tue, 14 Oct 2014 21:57:21 +0000 (21:57 +0000)]
Be smarter when parsing variable declarations with unknown types.
Specifically, avoid typo-correcting the variable name into a type before
typo-correcting the actual type name in the declaration. Doing so
results in a very unpleasant cascade of errors, with the typo correction
of the actual type name being buried in the middle.
llvm-svn: 219732
Zachary Turner [Tue, 14 Oct 2014 21:55:08 +0000 (21:55 +0000)]
Create a process launcher abstraction.
This implements Host::LaunchProcess for windows, and in doing so
does some minor refactor to move towards a more modular process
launching design.
The original motivation for this is that launching processes on
windows needs some very windows specific code, which would live
most appropriately in source/Host/windows somewhere. However,
there is already some common code that all platforms use when
launching a process before delegating to the platform specific
stuff, which lives in source/Host/common/Host.cpp which would
be nice to reuse without duplicating.
This commonality has been abstracted into MonitoringProcessLauncher,
a class which abstracts out the notion of launching a process using
an arbitrary algorithm, and then monitoring it for state changes.
The windows specific launching code lives in ProcessLauncherWindows,
and the posix specific launching code lives in ProcessLauncherPosix.
When launching a process MonitoringProcessLauncher is created, and
then an appropriate delegate launcher is created and given to the
MonitoringProcessLauncher.
Reviewed by: Greg Clayton
Differential Revision: http://reviews.llvm.org/D5781
llvm-svn: 219731
Zachary Turner [Tue, 14 Oct 2014 21:54:14 +0000 (21:54 +0000)]
Fix a path concatenation issue related to windows paths.
llvm-svn: 219730
David Majnemer [Tue, 14 Oct 2014 21:47:53 +0000 (21:47 +0000)]
Add a test for writing COFF BigObj
llvm-svn: 219729
Jason Molenda [Tue, 14 Oct 2014 21:47:45 +0000 (21:47 +0000)]
When PlatformDarwinKernel::ExamineKextForMatchingUUID is given
a FileSpec, UUID, and ArchSpec, and it's opening all the kexts
with the same bundle id to see if they're a match, don't set
the Arch in the ModuleSpec. If Module::GetObjectFile() sees
that the architecture of the kext is a mismatch for the arch
we're looking for, it'll spew a warning message to the dev (r217251).
Rely on the UUID match to get the correct file if we have
a UUID -- we'll get no warning if it's a mismatch.
<rdar://problem/
18641477>
llvm-svn: 219728
Rui Ueyama [Tue, 14 Oct 2014 21:42:08 +0000 (21:42 +0000)]
Use isa<> and cast<> instead of definition().
No functionality change intended.
llvm-svn: 219727
Juergen Ributzka [Tue, 14 Oct 2014 21:41:23 +0000 (21:41 +0000)]
[FastISel][AArch64] Add custom lowering for GEPs.
This is mostly a copy of the existing FastISel GEP code, but on AArch64 we bail
out even for simple cases, because the standard fastEmit functions don't cover
MUL and ADD is lowered inefficientily.
llvm-svn: 219726
Hans Wennborg [Tue, 14 Oct 2014 21:41:17 +0000 (21:41 +0000)]
[x86 asm] allow fwait alias in both At&t and Intel modes (PR21208)
Differential Revision: http://reviews.llvm.org/D5741
llvm-svn: 219725
Rui Ueyama [Tue, 14 Oct 2014 21:37:33 +0000 (21:37 +0000)]
Remove dead code.
Because we use cast<> at the beginning of this function, it will
abort there if a given atom is not a DefinedAtom.
In the switch statement, we checked if a given atom is a DefinedAtom
again by evaluating definition() == Atom::definitionRegular.
This was always true. So we can remove the outer switch statement.
llvm-svn: 219724
Rui Ueyama [Tue, 14 Oct 2014 21:20:01 +0000 (21:20 +0000)]
Use isa<> instead of checking return value of definition().
definition() is supposed to be used through isa, dyn_cast or cast.
It's better to not call that directly.
llvm-svn: 219723
Ed Maste [Tue, 14 Oct 2014 21:08:35 +0000 (21:08 +0000)]
Fix compiler-rt build on FreeBSD 10.1
We have to #define _WANT_RTENTRY to get struct rtentry, and add headers
that it depends on.
SIOCADDRT and SIOCDELRT also do not exist in FreeBSD 10.1 and were removed
in FreeBSD rev. 263203:
Garbage collect long time obsoleted (or never used) stuff from routing
API.
Differential Revision: http://reviews.llvm.org/D5703
llvm-svn: 219722
Renato Golin [Tue, 14 Oct 2014 21:00:22 +0000 (21:00 +0000)]
Re-enable ASAN/UBSAN tests on ARM, with VFP3 they began to pass
When compiling with -mfpu=vfpv3, those tests began to pass, like the others
with "Illegal Instruction" error, so removing the XFAIL from them should
get the bot green (and have more tests!).
llvm-svn: 219721
Tim Northover [Tue, 14 Oct 2014 20:57:29 +0000 (20:57 +0000)]
ARM: set preferred aggregate alignment to 32 universally.
Before, ARM and Thumb mode code had different preferred alignments, which could
lead to some rather unexpected results. There's justification for reducing it
from the default 64-bits (wasted space), but I don't think there is for going
below 32-bits.
There's no actual ABI change here, just to reassure people.
llvm-svn: 219720
Tim Northover [Tue, 14 Oct 2014 20:57:26 +0000 (20:57 +0000)]
ARM: set preferred aggregate alignment to 32 universally.
Before, ARM and Thumb mode code had different preferred alignments, which could
lead to some rather unexpected results. There's justification for reducing it
from the default 64-bits (wasted space), but I don't think there is for going
below 32-bits.
There's no actual ABI change here, just to reassure people.
llvm-svn: 219719
Hal Finkel [Tue, 14 Oct 2014 20:51:26 +0000 (20:51 +0000)]
[CFL-AA] CFL-AA should not assert on an va_arg instruction
The CFL-AA implementation was missing a visit* routine for va_arg instructions,
causing it to assert when run on a function that had one. For now, handle these
in a conservative way.
Fixes PR20954.
llvm-svn: 219718
Sanjay Patel [Tue, 14 Oct 2014 20:43:11 +0000 (20:43 +0000)]
Optimize away fabs() calls when input is squared (known positive).
Eliminate library calls and intrinsic calls to fabs when the input
is a squared value.
Note that no unsafe-math / fast-math assumptions are needed for
this optimization.
Differential Revision: http://reviews.llvm.org/D5777
llvm-svn: 219717
Juergen Ributzka [Tue, 14 Oct 2014 20:36:02 +0000 (20:36 +0000)]
[FastISel][AArch64] Fix sign-/zero-extend folding when SelectionDAG is involved.
Sign-/zero-extend folding depended on the load and the integer extend to be
both selected by FastISel. This cannot always be garantueed and SelectionDAG
might interfer. This commit adds additonal checks to load and integer extend
lowering to catch this.
Related to rdar://problem/
18495928.
llvm-svn: 219716
Bob Wilson [Tue, 14 Oct 2014 20:33:36 +0000 (20:33 +0000)]
Add complex multiply/divide functions to arm64 iOS libclang_rt libraries.
Clang r219557 introduces libcalls to complex multiply/divide functions.
Since these functions are not available in iOS for arm64 devices, add them to
the static libraries.
llvm-svn: 219715
Reid Kleckner [Tue, 14 Oct 2014 20:28:40 +0000 (20:28 +0000)]
Factor code into CXXRecordDecl::getTemplateInstantiationPattern() helper
This moves some code from SemaType.cpp's hasVisibleDefinition() into
DeclCXX.cpp so that it can be used elsewhere. I found one other instance
of code trying to do the same thing, there are probably more. Search for
getInstantiatedFrom() to try to find more.
No functionality change.
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D5783
llvm-svn: 219714
David Majnemer [Tue, 14 Oct 2014 20:28:40 +0000 (20:28 +0000)]
InstCombine: Don't miscompile X % ((Pow2 << A) >>u B)
We assumed that A must be greater than B because the right hand side of
a remainder operator must be nonzero.
However, it is possible for A to be less than B if Pow2 is a power of
two greater than 1.
Take for example:
i32 %A = 0
i32 %B = 31
i32 Pow2 =
2147483648
((Pow2 << 0) >>u 31) is non-zero but A is less than B.
This fixes PR21274.
llvm-svn: 219713
Fariborz Jahanian [Tue, 14 Oct 2014 20:27:05 +0000 (20:27 +0000)]
Patch to warn on interger overflow in presence of
implicit casts. Reviewed by Reid Kleckner.
rdar://
18405357
llvm-svn: 219712
Greg Clayton [Tue, 14 Oct 2014 20:18:05 +0000 (20:18 +0000)]
Fixed stdio redirection within LLDB to "do the right thing" in all cases.
The main issue was if you didn't specify all three (stdin/out/err), you would get file actions added to the launch that would always use the pseudo terminal. This is now fixed.
Also fixed the test suite test that handles IO to test redirecting things individually and all together and in other combinations to make sure we don't regress.
<rdar://problem/
18638226>
llvm-svn: 219711
Jan Vesely [Tue, 14 Oct 2014 20:05:26 +0000 (20:05 +0000)]
Reapply "R600: Add new intrinsic to read work dimensions"
This effectively reverts revert 219707. After fixing the test to work with
new function name format and renamed intrinsic.
Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 219710
Rui Ueyama [Tue, 14 Oct 2014 19:43:37 +0000 (19:43 +0000)]
Use llvm::make_unique.
llvm-svn: 219709
Hal Finkel [Tue, 14 Oct 2014 19:23:07 +0000 (19:23 +0000)]
Revert "r216914 - Revert: [APFloat] Fixed a bug in method 'fusedMultiplyAdd'"
Reapply r216913, a fix for PR20832 by Andrea Di Biagio. The commit was reverted
because of buildbot failures, and credit goes to Ulrich Weigand for isolating
the underlying issue (which can be confirmed by Valgrind, which does helpfully
light up like the fourth of July). Uli explained the problem with the original
patch as:
It seems the problem is calling multiplySignificand with an addend of category
fcZero; that is not expected by this routine. Note that for fcZero, the
significand parts are simply uninitialized, but the code in (or rather, called
from) multiplySignificand will unconditionally access them -- in effect using
uninitialized contents.
This version avoids using a category == fcZero addend within
multiplySignificand, which avoids this problem (the Valgrind output is also now
clean).
Original commit message:
[APFloat] Fixed a bug in method 'fusedMultiplyAdd'.
When folding a fused multiply-add builtin call, make sure that we propagate the
correct result in the case where the addend is zero, and the two other operands
are finite non-zero.
Example:
define double @test() {
%1 = call double @llvm.fma.f64(double 7.0, double 8.0, double 0.0)
ret double %1
}
Before this patch, the instruction simplifier wrongly folded the builtin call
in function @test to constant 'double 7.0'.
With this patch, method 'fusedMultiplyAdd' correctly evaluates the multiply and
propagates the expected result (i.e. 56.0).
Added test fold-builtin-fma.ll with the reproducible from PR20832 plus extra
test cases to verify the behavior of method 'fusedMultiplyAdd' in the presence
of NaN/Inf operands.
This fixes PR20832.
llvm-svn: 219708
Rafael Espindola [Tue, 14 Oct 2014 18:58:04 +0000 (18:58 +0000)]
Revert "R600: Add new intrinsic to read work dimensions"
This reverts commit r219705.
CodeGen/R600/work-item-intrinsics.ll was failing on linux.
llvm-svn: 219707
Rafael Espindola [Tue, 14 Oct 2014 18:53:16 +0000 (18:53 +0000)]
Remove unused member variable.
Fixes pr20904.
llvm-svn: 219706
Jan Vesely [Tue, 14 Oct 2014 18:52:07 +0000 (18:52 +0000)]
R600: Add new intrinsic to read work dimensions
v2: Add SI lowering
Add test
v3: Place work dimensions after the kernel arguments.
v4: Calculate offset while lowering arguments
v5: rebase
v6: change prefix to AMDGPU
Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 219705
Jan Vesely [Tue, 14 Oct 2014 18:52:04 +0000 (18:52 +0000)]
R600: FMA is VecALU only instruction
Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 219704
Reed Kotler [Tue, 14 Oct 2014 18:27:58 +0000 (18:27 +0000)]
Finish getting Mips fast-isel to match up with AArch64 fast-isel
Summary:
In order to facilitate use of common code, checking by reviewers of other fast-isel ports, and hopefully to eventually move most of Mips and other fast-isel ports into target independent code, I've tried to get the two implementations to line up.
There is no functional code change. Just methods moved in the file to be in the same order as in AArch64.
Test Plan: No functional change.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits, aemerson, rfuhler
Differential Revision: http://reviews.llvm.org/D5692
llvm-svn: 219703
David Blaikie [Tue, 14 Oct 2014 18:22:52 +0000 (18:22 +0000)]
DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself.
Let me tell you a tale...
Originally committed in r211723 after discovering a nasty case of weird
scoping due to inlining, this was reverted in r211724 after it fired in
ASan/compiler-rt.
(minor diversion where I accidentally committed/reverted again in
r211871/r211873)
After further testing and fixing bugs in ArgumentPromotion (r211872) and
Inlining (r212065) it was recommitted in r212085. Reverted in r212089
after the sanitizer buildbots still showed problems.
Fixed another bug in ArgumentPromotion (r212128) found by this
assertion.
Recommitted in r212205, reverted in r212226 after it crashed some more
on sanitizer buildbots.
Fix clang some more in r212761.
Recommitted in r212776, reverted in r212793. ASan failures.
Recommitted in r213391, reverted in r213432, trying to reproduce flakey
ASan build failure.
Fixed bugs in r213805 (ArgPromo + DebugInfo), r213952
(LiveDebugVariables strips dbg_value intrinsics in functions not
described by debug info).
Recommitted in r214761, reverted in r214999, flakey failure on Windows
buildbot.
Fixed DeadArgElimination + DebugInfo bug in r219210.
Recommitted in r219215, reverted in r219512, failure on ObjC++ atomic
properties in the test-suite on Darwin.
Fixed ObjC++ atomic properties issue in Clang in r219690.
[This commit is provided 'as is' with no hope that this is the last time
I commit this change either expressed or implied]
llvm-svn: 219702
Ed Maste [Tue, 14 Oct 2014 18:04:47 +0000 (18:04 +0000)]
Skip asan test on FreeBSD
The build fails due to missing asan runtime in the FreeBSD base system.
Instead of marking it expected fail, just skip until we have the runtime
available.
llvm.org/pr21136
llvm-svn: 219701
Rafael Espindola [Tue, 14 Oct 2014 17:38:38 +0000 (17:38 +0000)]
Remove method that is identical to the base class one.
llvm-svn: 219700
Alexey Samsonov [Tue, 14 Oct 2014 17:31:15 +0000 (17:31 +0000)]
[UBSan] XFAIL test added in r219642 on Darwin
llvm-svn: 219699
Matt Arsenault [Tue, 14 Oct 2014 17:21:19 +0000 (17:21 +0000)]
R600/SI: Use DS offsets for constant addresses
Use 0 as the base address for a constant address, so if
we have a constant address we can save moves and form
read2/write2s.
llvm-svn: 219698
Saleem Abdulrasool [Tue, 14 Oct 2014 17:20:18 +0000 (17:20 +0000)]
CodeGen: correct block mangling in ObjC
Mangling for blocks defined within blocks in an ObjectiveC context were also
broken by SVN r219393. Because the code in mangleName assumed that the code was
either C or C++, we would trigger assertions when trying to mangle the inner
blocks in an ObjectiveC context.
Add a test and use the ObjectiveC specific mangling when dealing with an
ObjectiveC method declaration.
llvm-svn: 219697
Saleem Abdulrasool [Tue, 14 Oct 2014 17:20:14 +0000 (17:20 +0000)]
CodeGen: correct mangling for blocks
This addresses a regression introduced with SVN r219393. A block may be
contained within another block. In such a scenario, we would end up within a
BlockDecl, which is not a NamedDecl (as the names are synthesised). The cast to
a NamedDecl of the DeclContext would then assert as the types are unrelated.
Restore the mangling behaviour to that prior to SVN r219393. If the current
block is contained within a BlockDecl, walk up to the parent DeclContext,
recursively, until we have a non-BlockDecl. This is expected to be a NamedDecl.
Add in a couple of asserts to ensure that the assumption that we only encounter
a block within a NamedDecl or a BlockDecl.
llvm-svn: 219696
David Blaikie [Tue, 14 Oct 2014 17:13:09 +0000 (17:13 +0000)]
Revert "Fix stuff... again."
Accidental commit.
This reverts commit r219693.
llvm-svn: 219695
David Blaikie [Tue, 14 Oct 2014 17:12:02 +0000 (17:12 +0000)]
Revert some parts of r196288 that were confusing and untested.
If we figure out why they should be here, let's add some testing of some
kind so we can better demonstrate why it's needed.
llvm-svn: 219694
David Blaikie [Tue, 14 Oct 2014 17:11:59 +0000 (17:11 +0000)]
Fix stuff... again.
llvm-svn: 219693
David Blaikie [Tue, 14 Oct 2014 17:09:38 +0000 (17:09 +0000)]
Formatting for prior commit
llvm-svn: 219692
Ulrich Weigand [Tue, 14 Oct 2014 16:46:45 +0000 (16:46 +0000)]
[SystemZ] Address review comments for r219679
llvm-svn: 219691
David Blaikie [Tue, 14 Oct 2014 16:43:46 +0000 (16:43 +0000)]
DebugInfo: Don't leak location information from one function into the prologue of the next function.
CodeGenFunction objects aren't really designed to be reused for more
than one function, and doing so can leak debug info location information
from one function into the prologue of the next.
Add an assertion in to catch reuses of CodeGenFunction, which
surprisingly only caught the ObjC atomic getter/setter cases. Fix those
and add a test to demonstrate the issue.
The test is a bit slim, because we're just testing for the absence of a
debug location on the prologue instructions, which by itself probably
wouldn't be the end of the world - but the particular debug location
that was ending up there was for the previous function's last
instruction. This produced debug info for another function within this
function, which is something I'm trying to remove all cases of as its a
substantial source of bugs, especially around inlining (see r219215).
llvm-svn: 219690
Todd Fiala [Tue, 14 Oct 2014 16:17:02 +0000 (16:17 +0000)]
Fix dotest.py test runner exit code to return non-zero on failure/error.
This addresses this bug:
http://www.llvm.org/bugs/show_bug.cgi?id=21267
Which has been broken since svn r215256 on Aug 8 2014.
DO NOT REVERT THIS COMMIT EVEN IF IT CREATES TEST FAILURES.
The test failures are a result of accumulation of hidden failures
that were masked by the bug this change fixes. Most of our test
runners as part of build testing rely on dotest.py returning non-zero to indicate
some kind of errant test run. Thus, we have been flying blind
since Aug 8 2014.
llvm-svn: 219689
Hal Finkel [Tue, 14 Oct 2014 16:04:49 +0000 (16:04 +0000)]
[LVI] Check for @llvm.assume dominating the edge branch
When LazyValueInfo uses @llvm.assume intrinsics to provide edge-value
constraints, we should check for intrinsics that dominate the edge's branch,
not just any potential context instructions. An assumption that dominates the
edge's branch represents a truth on that edge. This is specifically useful, for
example, if multiple predecessors assume a pointer to be nonnull, allowing us
to simplify a later null comparison.
The test case, and an initial patch, were provided by Philip Reames. Thanks!
llvm-svn: 219688
NAKAMURA Takumi [Tue, 14 Oct 2014 15:58:16 +0000 (15:58 +0000)]
Revert r219638, (r219640 and r219676), "Removing the static destructor from ManagedStatic.cpp by controlling the allocation and de-allocation of the mutex."
It caused hang-up on msc17 builder, probably deadlock.
llvm-svn: 219687
Robert Khasanov [Tue, 14 Oct 2014 15:13:56 +0000 (15:13 +0000)]
[AVX512] Extended avx512_binop_rm to DQ/VL subsets.
Added encoding tests.
llvm-svn: 219686
Robert Khasanov [Tue, 14 Oct 2014 14:36:19 +0000 (14:36 +0000)]
[AVX512] Extended avx512_binop_rm to BW/VL subsets.
Added encoding tests.
llvm-svn: 219685
Bradley Smith [Tue, 14 Oct 2014 14:02:41 +0000 (14:02 +0000)]
[AArch64] Fix crash with empty/pseudo-only blocks in A53 erratum (835769) workaround
llvm-svn: 219684
Evgeniy Stepanov [Tue, 14 Oct 2014 13:46:07 +0000 (13:46 +0000)]
[sanitizer] Fix a crash in FP unwinder on ARM.
This change fixes 2 issues in the fast unwinder from r217079:
* A crash if a frame pointer points below current stack head, but
inside the current thread stack limits. That memory may be
unmapped. A check for this was lost in r217079.
* The last valid stack frame (the first one with an invalid next
frame pointer) is always interpreted as a GCC layout frame. This
results in garbled last PC in the (expected) case when the last
frame has LLVM layout.
llvm-svn: 219683
Alexander Potapenko [Tue, 14 Oct 2014 13:40:44 +0000 (13:40 +0000)]
[llvm-symbolizer] Minor typedef cleanup. NFC.
llvm-svn: 219682
Renato Golin [Tue, 14 Oct 2014 12:32:47 +0000 (12:32 +0000)]
Fix silly commit to disable test on ARM
llvm-svn: 219681
Renato Golin [Tue, 14 Oct 2014 12:24:28 +0000 (12:24 +0000)]
Disable failing ASAN LongJump test on ARM
Updated the URL to reflect information on the problem as well as build the
case for ARM. This seems to be a wider problem, not ARM or PPC specific.
llvm-svn: 219680
Ulrich Weigand [Tue, 14 Oct 2014 11:45:53 +0000 (11:45 +0000)]
[SystemZ] Add test case to verify default use of integrated assembler
llvm-svn: 219679
Dmitry Vyukov [Tue, 14 Oct 2014 09:46:56 +0000 (09:46 +0000)]
tsan: remove trailing whitespace
llvm-svn: 219678
Evgeniy Stepanov [Tue, 14 Oct 2014 09:36:24 +0000 (09:36 +0000)]
[asan] Add fast_unwind_on_check flag.
Allows to specify the unwinder to use for CHECK failures. Previous behaviour
was to use the "fatal" unwinder.
As compiler-rt is built without frame pointers, only the slow unwinder
really makes sense here, and it is the default.
llvm-svn: 219677
NAKAMURA Takumi [Tue, 14 Oct 2014 09:34:16 +0000 (09:34 +0000)]
Threading.h: Use \tparam for template parameters. [-Wdocumentation]
llvm-svn: 219676
Dmitry Vyukov [Tue, 14 Oct 2014 09:32:45 +0000 (09:32 +0000)]
tsan: refactor atexit handling
The current handling (manual execution of atexit callbacks)
is overly complex and leads to constant problems due to mutual ordering of callbacks.
Instead simply wrap callbacks into our wrapper to establish
the necessary synchronization.
Fixes issue https://code.google.com/p/thread-sanitizer/issues/detail?id=80
llvm-svn: 219675
Eric Christopher [Tue, 14 Oct 2014 08:44:19 +0000 (08:44 +0000)]
Grab the subtarget info off of the MachineFunction rather than
indirecting through the TargetMachine.
llvm-svn: 219674
Eric Christopher [Tue, 14 Oct 2014 08:25:26 +0000 (08:25 +0000)]
Use the triple to figure out if this is a darwin target, not
the subtarget.
llvm-svn: 219673
Eric Christopher [Tue, 14 Oct 2014 07:22:08 +0000 (07:22 +0000)]
Remove unnecessary TargetMachine.h includes.
llvm-svn: 219672
Eric Christopher [Tue, 14 Oct 2014 07:22:00 +0000 (07:22 +0000)]
Grab the subtarget and subtarget dependent variables off of
MachineFunction rather than TargetMachine.
llvm-svn: 219671
Eric Christopher [Tue, 14 Oct 2014 07:17:23 +0000 (07:17 +0000)]
Grab the subtarget and subtarget dependent variables off of
MachineFunction rather than TargetMachine.
llvm-svn: 219670
Eric Christopher [Tue, 14 Oct 2014 07:17:20 +0000 (07:17 +0000)]
Instead of the TargetMachine cache the MachineFunction
and TargetRegisterInfo in the peephole optimizer. This
makes it easier to grab subtarget dependent variables off
of the MachineFunction rather than the TargetMachine.
llvm-svn: 219669
Eric Christopher [Tue, 14 Oct 2014 07:00:33 +0000 (07:00 +0000)]
Access subtarget specific variables off of the MachineFunction's
cached subtarget and not the TargetMachine.
llvm-svn: 219668
Eric Christopher [Tue, 14 Oct 2014 06:56:28 +0000 (06:56 +0000)]
Add lld to the parallel set of directories since it doesn't depend
on any of the other tools directories.
llvm-svn: 219667
Eric Christopher [Tue, 14 Oct 2014 06:56:25 +0000 (06:56 +0000)]
Access the subtarget off of the MachineFunction via the DAG
scheduler or via the SelectionDAG if available. Otherwise
grab the subtarget off of the MachineFunction by going up
the parent chain.
llvm-svn: 219666
Hao Liu [Tue, 14 Oct 2014 06:50:36 +0000 (06:50 +0000)]
[AArch64]Select wide immediate offset into [Base+XReg] addressing mode
e.g Currently we'll generate following instructions if the immediate is too wide:
MOV X0, WideImmediate
ADD X1, BaseReg, X0
LDR X2, [X1, 0]
Using [Base+XReg] addressing mode can save one ADD as following:
MOV X0, WideImmediate
LDR X2, [BaseReg, X0]
Differential Revision: http://reviews.llvm.org/D5477
llvm-svn: 219665
Justin Bogner [Tue, 14 Oct 2014 06:30:31 +0000 (06:30 +0000)]
Re-apply "Frontend: Extract SerializedDiagnosticReader out of CXLoadedDiagnostic (NFC)"
I'd mispelled "Bitcode/BitCodes.h" before, and tested on a case
insensitive filesystem.
This reverts commit r219649, effectively re-applying r219647 and
r219648.
llvm-svn: 219664
Eric Christopher [Tue, 14 Oct 2014 06:26:57 +0000 (06:26 +0000)]
Remove the use and member variable of the TargetMachine from
MachineLICM as we can get the same data off of the MachineFunction.
llvm-svn: 219663
Eric Christopher [Tue, 14 Oct 2014 06:26:55 +0000 (06:26 +0000)]
Have MachineInstrBundle use the MachineFunction for subtarget
access rather than the TargetMachine.
llvm-svn: 219662