Sagar Thakur [Wed, 6 May 2015 05:38:21 +0000 (05:38 +0000)]
[sanitizer][MIPS] Implement clone for MIPS
Reviewers: kcc, samsonov, earthdok
Subscribers: dsanders, jaydeep, Anand.Takale, mohit.bhakkad, llvm-commits
Differential Revision: http://reviews.llvm.org/D8318
llvm-svn: 236570
Ahmed Bougacha [Wed, 6 May 2015 04:14:02 +0000 (04:14 +0000)]
[ARM][FastISel] Use TST #1 instead of CMP #0 for select.
Since r234249, i1 are sext instead of zext; because of that, doing
"CMP rN, #0; IT EQ/NE" isn't correct anymore.
"TST #1" is the conservatively correct alternative - the tradeoff being
that it doesn't have a 16-bit encoding -, so use that instead.
llvm-svn: 236569
Sanjoy Das [Wed, 6 May 2015 02:51:46 +0000 (02:51 +0000)]
[Statepoints] Remove broken test case.
statepoint-indirect-return.ll breaks on linux systems. Delete the test
case to make the bots green while I figure out what the right fix is.
llvm-svn: 236568
Sanjoy Das [Wed, 6 May 2015 02:36:34 +0000 (02:36 +0000)]
[IRBuilder] Fix indentation. NFC.
Whitespace-only change.
llvm-svn: 236567
Sanjoy Das [Wed, 6 May 2015 02:36:31 +0000 (02:36 +0000)]
[Statepoint] Clean up StatepointLowering: symbolic constants.
For accessors in the `Statepoint` class, use symbolic constants for
offsets into the argument vector instead of literals. This makes the
code intent clearer and simpler to change.
llvm-svn: 236566
Sanjoy Das [Wed, 6 May 2015 02:36:28 +0000 (02:36 +0000)]
[Statepoint] Clean up Statepoint.h: clang-format.
llvm-svn: 236565
Sanjoy Das [Wed, 6 May 2015 02:36:26 +0000 (02:36 +0000)]
[Statepoint] Clean up Statepoint.h: accessor names.
Use getFoo() as accessors consistently and some other naming changes.
llvm-svn: 236564
Sanjoy Das [Wed, 6 May 2015 02:36:20 +0000 (02:36 +0000)]
[StatepointLowering] Don't create temporary instructions. NFCI.
Summary:
Instead of creating a temporary call instruction and lowering that, use
SelectionDAGBuilder::lowerCallOperands.
Reviewers: reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9480
llvm-svn: 236563
Ahmed Bougacha [Wed, 6 May 2015 02:08:27 +0000 (02:08 +0000)]
Revert "[analyzer] scan-build: support spaces in compiler path and arguments."
This reverts commit r236423 and its followup r236533, as indiscriminate
quoting makes for too much quoting (and clang doesn't like both '"-c"'
and -D"FOO=bar").
llvm-svn: 236562
Ahmed Bougacha [Wed, 6 May 2015 01:28:58 +0000 (01:28 +0000)]
[WinEH] Reset WinEHPrepare::SEHExceptionCodeSlot when we're done.
This caused a use-after-free on test/CodeGen/X86/win32-eh.ll
No functional change intended.
llvm-svn: 236561
Chaoren Lin [Wed, 6 May 2015 01:28:04 +0000 (01:28 +0000)]
Update gdbremote_testcase to accomodate new adb:// scheme.
Reviewers: chying, ovyalov
Reviewed By: chying, ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9510
llvm-svn: 236560
Evgeniy Stepanov [Wed, 6 May 2015 00:29:57 +0000 (00:29 +0000)]
[asan] Fix dynamic-runtime tests.
They are not part of check-all :(
This change adds sized-delete operators to the version list, and disables the
hack that excluded versioned symbols from the dynamic list - this is not an
issue in this case.
llvm-svn: 236559
Justin Bogner [Tue, 5 May 2015 23:44:48 +0000 (23:44 +0000)]
InstrProf: Strip filename prefixes from the names we display for coverage
For consumers of coverage data, any filename prefixes we store in the
profile data are just noise. Strip this prefix if it exists.
llvm-svn: 236558
Pete Cooper [Tue, 5 May 2015 23:41:53 +0000 (23:41 +0000)]
[X86 fast-isel] Constrain the index reg class to not include SP.
The index reg on instructions with complex address modes is a GPR64_NOSP. Constrain it to appease the machine verifier.
llvm-svn: 236557
Evgeniy Stepanov [Tue, 5 May 2015 23:13:50 +0000 (23:13 +0000)]
[asan] Fix compiler-rt build.
i386 runtime library was accidentally using the x86_64 version script without a dependency.
llvm-svn: 236556
Sanjoy Das [Tue, 5 May 2015 23:06:57 +0000 (23:06 +0000)]
[SelectionDAG] Make an argument optional in RFV::getCopyToRegs. NFC.
Summary:
We default the value argument to nullptr. The only use of the value is
in diagnosePossiblyInvalidConstraint and that seems to be resilient to
it being nullptr.
Reviewers: atrick, reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9479
llvm-svn: 236555
Sanjoy Das [Tue, 5 May 2015 23:06:54 +0000 (23:06 +0000)]
[SelectionDAG] Move RegsForValue into SelectionDAGBuilder.h. NFC.
Summary:
The exported class will be used in later change, in
StatepointLowering.cpp. It is still internal to SelectionDAG (not
exported via include/).
Reviewers: reames, atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9478
llvm-svn: 236554
Sanjoy Das [Tue, 5 May 2015 23:06:52 +0000 (23:06 +0000)]
[SelectionDAG] Pass explicit type to lowerCallOperands. NFC.
Summary:
Currently this does not change anything, but change will be used in a
later change to StatepointLowering.cpp
Reviewers: reames, atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9477
llvm-svn: 236553
Sanjoy Das [Tue, 5 May 2015 23:06:49 +0000 (23:06 +0000)]
[StatepointLowering] Rename variable, NFC.
Rename LoweredArgs to LoweredMetaArgs to clarify intent.
llvm-svn: 236552
Evgeniy Stepanov [Tue, 5 May 2015 22:51:35 +0000 (22:51 +0000)]
[asan] Use a version script to limit the symbols exported by the ASan shared runtime library.
llvm-svn: 236551
Pete Cooper [Tue, 5 May 2015 22:09:41 +0000 (22:09 +0000)]
Fix IfConverter to handle regmask machine operands.
Note, this is a recommit of r236515 after fixing an error in r236514. The buildbot ran fast enough that it picked up r236514 prior to r236515 and threw an error. r236515 itself ran 'make check' without errors.
Original commit message follows:
A regmask (typically seen on a call) clobbers the set of registers it lists. The IfConverter, in UpdatePredRedefs, was handling register defs, but not regmasks.
These are slightly different to a def in that we need to add both an implicit use and def to appease the machine verifier. Otherwise, uses after the if converted call could think they are reading an undefined register.
Reviewed by Matthias Braun and Quentin Colombet.
llvm-svn: 236550
Oleksiy Vyalov [Tue, 5 May 2015 22:02:56 +0000 (22:02 +0000)]
Mark TestMultithreaded.test_sb_api_listener_resume as XFAIL with gcc 4.8 and higher.
llvm-svn: 236549
Kostya Serebryany [Tue, 5 May 2015 21:59:51 +0000 (21:59 +0000)]
[lib/Fuzzer] on crash print the contents of the crashy input as base64
llvm-svn: 236548
Justin Bogner [Tue, 5 May 2015 21:46:14 +0000 (21:46 +0000)]
InstrProf: Don't start or end coverage regions inside of system macros
It doesn't make much sense to try to show coverage inside system
macros, and source locations in builtins confuses the coverage
mapping. Just avoid doing this.
Fixes an assert that fired when a __block storage specifier starts a
region.
llvm-svn: 236547
Sanjay Patel [Tue, 5 May 2015 21:40:38 +0000 (21:40 +0000)]
propagate IR-level fast-math-flags to DAG nodes (NFC)
This patch adds the minimum plumbing necessary to use IR-level
fast-math-flags (FMF) in the backend without actually using
them for anything yet. This is a follow-on to:
http://reviews.llvm.org/rL235997
...which split the existing nsw / nuw / exact flags and FMF
into their own struct.
There are 2 structural changes here:
1. The main diff is that we're preparing to extend the optimization
flags to affect more than just binary SDNodes. Eg, IR intrinsics
( https://llvm.org/bugs/show_bug.cgi?id=21290 ) or non-binop nodes
that don't even exist in IR such as FMA, FNEG, etc.
2. The other change is that we're actually copying the FP fast-math-flags
from the IR instructions to SDNodes.
Differential Revision: http://reviews.llvm.org/D8900
llvm-svn: 236546
Kostya Serebryany [Tue, 5 May 2015 21:38:50 +0000 (21:38 +0000)]
[asan] fix IsDeadlySignal
llvm-svn: 236545
Sanjay Patel [Tue, 5 May 2015 21:20:52 +0000 (21:20 +0000)]
use range-based for-loop; NFC
llvm-svn: 236544
Chaoren Lin [Tue, 5 May 2015 20:34:36 +0000 (20:34 +0000)]
Fix typo. platfrom -> platform
llvm-svn: 236543
David Majnemer [Tue, 5 May 2015 20:34:29 +0000 (20:34 +0000)]
Update testcase to match r236539
llvm-svn: 236542
Greg Clayton [Tue, 5 May 2015 20:26:58 +0000 (20:26 +0000)]
Make sure that the following paths say they are equal:
/private/tmp/main.cpp
/private/tmp/..//tmp/main.cpp
We saw paths like this in makefile generate binaries when someone left an extra '/' on the end of a makefile variable.
<rdar://problem/
18945972>
llvm-svn: 236541
Andrey Churbanov [Tue, 5 May 2015 20:17:53 +0000 (20:17 +0000)]
Added Andrey Churbanov as the owner of the OpenMP runtime library code
llvm-svn: 236540
David Majnemer [Tue, 5 May 2015 20:14:22 +0000 (20:14 +0000)]
[Inliner] Discard empty COMDAT groups
COMDAT groups which have become rendered unused because of inline are
discardable if we can prove that we've made the group empty.
This fixes PR22285.
llvm-svn: 236539
Pete Cooper [Tue, 5 May 2015 20:14:22 +0000 (20:14 +0000)]
Refactor UpdatePredRedefs and StepForward to avoid duplication. NFC
Note, this is a reapplication of r236515 with a fix to not assert on non-register operands, but instead only handle them until the subsequent commit. Original commit message follows.
The code was basically the same here already. Just added an out parameter for a vector of seen defs so that UpdatePredRedefs can call StepForward first, then do its own post processing on the seen defs.
Will be used in the next commit to also handle regmasks.
llvm-svn: 236538
Evgeniy Stepanov [Tue, 5 May 2015 20:13:39 +0000 (20:13 +0000)]
Build ASan runtime library with -z global on Android.
llvm-svn: 236537
Peter Collingbourne [Tue, 5 May 2015 20:07:10 +0000 (20:07 +0000)]
Thumb2SizeReduction: Check the correct set of registers for LDMIA.
The register set for LDMIA begins at offset 3, not 4. We were previously
missing the short encoding of this instruction in the case where the base
register was the first register in the register set.
Also clean up some dead code:
- The isARMLowRegister check is redundant with what VerifyLowRegs does;
replace with an assert.
- Remove handling of LDMDB instruction, which has no short encoding (and
does not appear in ReduceTable).
Differential Revision: http://reviews.llvm.org/D9485
llvm-svn: 236535
Andrey Churbanov [Tue, 5 May 2015 20:02:52 +0000 (20:02 +0000)]
Integrate libiomp CMake into LLVM CMake build system.
This patch integrates the libiomp CMake build system into the LLVM CMake build
system so that users can checkout libiomp into the projects directory of llvm
and build llvm,clang, and libiomp all together. These changes specifically
introduce a new install target which will put libraries and headers into the
correct locations when either a standalone build or part of llvm.
The copy_recipe() method has been removed in favor of the POST_BUILD method
to move headers into the exports subdirectory. And lastly, the MicroTests.cmake
file was refactored which led to simpler target dependencies and a new target,
make libiomp-micro-tests, which performs the 5 small tests (test-relo,
test-touch, etc.) when called.
llvm-svn: 236534
Anton Yartsev [Tue, 5 May 2015 19:43:37 +0000 (19:43 +0000)]
[analyzer] This eliminates regression caused by r236423.
Wrap an argument with quotes only if it has spaces.
llvm-svn: 236533
Ulrich Weigand [Tue, 5 May 2015 19:36:42 +0000 (19:36 +0000)]
[SystemZ] Add support for z13 low-level vector builtins
This adds low-level builtins to allow access to all of the z13 vector
instructions. Note that instructions whose semantics can be described
by standard C (including clang extensions) do not get any builtins.
For each instructions whose semantics *cannot* (fully) be described, we
define a builtin named __builtin_s390_<insn> that directly maps to this
instruction. These are intended to be compatible with GCC.
For instructions that also set the condition code, the builtin will take
an extra argument of type "int *" at the end. The integer pointed to by
this argument will be set to the post-instruction CC value.
For many instructions, the low-level builtin is mapped to the corresponding
LLVM IR intrinsic. However, a number of instructions can be represented
in standard LLVM IR without requiring use of a target intrinsic.
Some instructions require immediate integer operands within a certain
range. Those are verified at the Sema level.
Based on a patch by Richard Sandiford.
llvm-svn: 236532
Ulrich Weigand [Tue, 5 May 2015 19:35:52 +0000 (19:35 +0000)]
[SystemZ] Add support for z13 and its vector facility
This patch adds support for the z13 architecture type. For compatibility
with GCC, a pair of options -mvx / -mno-vx can be used to selectively
enable/disable use of the vector facility.
When the vector facility is present, we default to the new vector ABI.
This is characterized by two major differences:
- Vector types are passed/returned in vector registers
(except for unnamed arguments of a variable-argument list function).
- Vector types are at most 8-byte aligned.
The reason for the choice of 8-byte vector alignment is that the hardware
is able to efficiently load vectors at 8-byte alignment, and the ABI only
guarantees 8-byte alignment of the stack pointer, so requiring any higher
alignment for vectors would require dynamic stack re-alignment code.
However, for compatibility with old code that may use vector types, when
*not* using the vector facility, the old alignment rules (vector types
are naturally aligned) remain in use.
These alignment rules are not only implemented at the C language level,
but also at the LLVM IR level. This is done by selecting a different
DataLayout string depending on whether the vector ABI is in effect or not.
Based on a patch by Richard Sandiford.
llvm-svn: 236531
Ulrich Weigand [Tue, 5 May 2015 19:34:10 +0000 (19:34 +0000)]
[DAGCombiner] Account for getVectorIdxTy() when narrowing vector load
This patch makes ReplaceExtractVectorEltOfLoadWithNarrowedLoad convert
the element number from getVectorIdxTy() to PtrTy before doing pointer
arithmetic on it. This is needed on z, where element numbers are i32
but pointers are i64.
Original patch by Richard Sandiford.
llvm-svn: 236530
Ulrich Weigand [Tue, 5 May 2015 19:33:37 +0000 (19:33 +0000)]
[DAGCombiner] Fix ReplaceExtractVectorEltOfLoadWithNarrowedLoad for BE
For little-endian, the function would convert (extract_vector_elt (load X), Y)
to X + Y*sizeof(elt). For big-endian it would instead use
X + sizeof(vec) - Y*sizeof(elt). The big-endian case wasn't right since
vector index order always follows memory/array order, even for big-endian.
(Note that the current handling has to be wrong for Y==0 since it would
access beyond the end of the vector.)
Original patch by Richard Sandiford.
llvm-svn: 236529
Ulrich Weigand [Tue, 5 May 2015 19:32:57 +0000 (19:32 +0000)]
[LegalizeVectorTypes] Allow single loads and stores for more short vectors
When lowering a load or store for TypeWidenVector, the type legalizer
would use a single load or store if the associated integer type was legal.
E.g. it would load a v4i8 as an i32 if i32 was legal.
This patch extends that behavior to promoted integers as well as legal ones.
If the integer type for the full vector width is TypePromoteInteger,
the element type is going to be TypePromoteInteger too, and it's still
better to use a single promoting load or truncating store rather than N
individual promoting loads or truncating stores. E.g. if you have a v2i8
on a target where i16 is promoted to i32, it's better to load the v2i8 as
an i16 rather than load both i8s individually.
Original patch by Richard Sandiford.
llvm-svn: 236528
Ulrich Weigand [Tue, 5 May 2015 19:31:09 +0000 (19:31 +0000)]
[SystemZ] Add vector intrinsics
This adds intrinsics to allow access to all of the z13 vector instructions.
Note that instructions whose semantics can be described by standard LLVM IR
do not get any intrinsics.
For each instructions whose semantics *cannot* (fully) be described, we
define an LLVM IR target-specific intrinsic that directly maps to this
instruction.
For instructions that also set the condition code, the LLVM IR intrinsic
returns the post-instruction CC value as a second result. Instruction
selection will attempt to detect code that compares that CC value against
constants and use the condition code directly instead.
Based on a patch by Richard Sandiford.
llvm-svn: 236527
Ulrich Weigand [Tue, 5 May 2015 19:30:05 +0000 (19:30 +0000)]
[SystemZ] Mark v1i128 and v1f128 as unsupported
The ABI specifies that <1 x i128> and <1 x fp128> are supposed to be
passed in vector registers. We do not yet support those types, and
some infrastructure is missing before we can do so.
In order to prevent accidentally generating code violating the ABI,
this patch adds checks to detect those types and error out if user
code attempts to use them.
llvm-svn: 236526
Ulrich Weigand [Tue, 5 May 2015 19:29:21 +0000 (19:29 +0000)]
[SystemZ] Handle sub-128 vectors
The ABI allows sub-128 vectors to be passed and returned in registers,
with the vector occupying the upper part of a register. We therefore
want to legalize those types by widening the vector rather than promoting
the elements.
The patch includes some simple tests for sub-128 vectors and also tests
that we can recognize various pack sequences, some of which use sub-128
vectors as temporary results. One of these forms is based on the pack
sequences generated by llvmpipe when no intrinsics are used.
Signed unpacks are recognized as BUILD_VECTORs whose elements are
individually sign-extended. Unsigned unpacks can have the equivalent
form with zero extension, but they also occur as shuffles in which some
elements are zero.
Based on a patch by Richard Sandiford.
llvm-svn: 236525
Ulrich Weigand [Tue, 5 May 2015 19:28:34 +0000 (19:28 +0000)]
[SystemZ] Add CodeGen support for scalar f64 ops in vector registers
The z13 vector facility includes some instructions that operate only on the
high f64 in a v2f64, effectively extending the FP register set from 16
to 32 registers. It's still better to use the old instructions if the
operands happen to fit though, since the older instructions have a shorter
encoding.
Based on a patch by Richard Sandiford.
llvm-svn: 236524
Ulrich Weigand [Tue, 5 May 2015 19:27:45 +0000 (19:27 +0000)]
[SystemZ] Add CodeGen support for v4f32
The architecture doesn't really have any native v4f32 operations except
v4f32->v2f64 and v2f64->v4f32 conversions, with only half of the v4f32
elements being used. Even so, using vector registers for <4 x float>
and scalarising individual operations is much better than generating
completely scalar code, since there's much less register pressure.
It's also more efficient to do v4f32 comparisons by extending to 2
v2f64s, comparing those, then packing the result.
This particularly helps with llvmpipe.
Based on a patch by Richard Sandiford.
llvm-svn: 236523
Ulrich Weigand [Tue, 5 May 2015 19:26:48 +0000 (19:26 +0000)]
[SystemZ] Add CodeGen support for v2f64
This adds ABI and CodeGen support for the v2f64 type, which is natively
supported by z13 instructions.
Based on a patch by Richard Sandiford.
llvm-svn: 236522
Ulrich Weigand [Tue, 5 May 2015 19:25:42 +0000 (19:25 +0000)]
[SystemZ] Add CodeGen support for integer vector types
This the first of a series of patches to add CodeGen support exploiting
the instructions of the z13 vector facility. This patch adds support
for the native integer vector types (v16i8, v8i16, v4i32, v2i64).
When the vector facility is present, we default to the new vector ABI.
This is characterized by two major differences:
- Vector types are passed/returned in vector registers
(except for unnamed arguments of a variable-argument list function).
- Vector types are at most 8-byte aligned.
The reason for the choice of 8-byte vector alignment is that the hardware
is able to efficiently load vectors at 8-byte alignment, and the ABI only
guarantees 8-byte alignment of the stack pointer, so requiring any higher
alignment for vectors would require dynamic stack re-alignment code.
However, for compatibility with old code that may use vector types, when
*not* using the vector facility, the old alignment rules (vector types
are naturally aligned) remain in use.
These alignment rules are not only implemented at the C language level
(implemented in clang), but also at the LLVM IR level. This is done
by selecting a different DataLayout string depending on whether the
vector ABI is in effect or not.
Based on a patch by Richard Sandiford.
llvm-svn: 236521
Ulrich Weigand [Tue, 5 May 2015 19:23:40 +0000 (19:23 +0000)]
[SystemZ] Add z13 vector facility and MC support
This patch adds support for the z13 processor type and its vector facility,
and adds MC support for all new instructions provided by that facilily.
Apart from defining the new instructions, the main changes are:
- Adding VR128, VR64 and VR32 register classes.
- Making FP64 a subclass of VR64 and FP32 a subclass of VR32.
- Adding a D(V,B) addressing mode for scatter/gather operations
- Adding 1-, 2-, and 3-bit immediate operands for some 4-bit fields.
Until now all immediate operands have been the same width as the
underlying field (hence the assert->return change in decode[SU]ImmOperand).
In addition, sys::getHostCPUName is extended to detect running natively
on a z13 machine.
Based on a patch by Richard Sandiford.
llvm-svn: 236520
Kaelyn Takata [Tue, 5 May 2015 19:17:03 +0000 (19:17 +0000)]
Allow TransformTypos to ignore corrections to a specified VarDecl.
This is needed to prevent a TypoExpr from being corrected to a variable
when the TypoExpr is a subexpression of that variable's initializer.
Also exclude more keywords from the correction candidate pool when the
subsequent token is .* or ->* since keywords like "new" or "return"
aren't valid on the left side of those operators.
Fixes PR23140.
llvm-svn: 236519
Pete Cooper [Tue, 5 May 2015 18:49:08 +0000 (18:49 +0000)]
Revert "Refactor UpdatePredRedefs and StepForward to avoid duplication. NFC"
This reverts commit
963cdbccf6e5578822836fd9b2ebece0ba9a60b7 (ie r236514)
This is to get the bots green while i investigate.
llvm-svn: 236518
Pete Cooper [Tue, 5 May 2015 18:49:05 +0000 (18:49 +0000)]
Revert "Fix IfConverter to handle regmask machine operands."
This reverts commit
b27413cbfd78d959c18e713bfa271fb69e6b3303 (ie r236515).
This is to get the bots green while i investigate the failures.
llvm-svn: 236517
Chaoren Lin [Tue, 5 May 2015 18:43:19 +0000 (18:43 +0000)]
Fix process launch from Windows host to Android target.
Summary:
- Denormalized path on Windows host causes bad `A` packet.
- Executables copied from Windows host doesn't have executable bits.
Reviewers: tberghammer, zturner, ovyalov
Reviewed By: ovyalov
Subscribers: tberghammer, lldb-commits
Differential Revision: http://reviews.llvm.org/D9492
llvm-svn: 236516
Pete Cooper [Tue, 5 May 2015 18:31:36 +0000 (18:31 +0000)]
Fix IfConverter to handle regmask machine operands.
A regmask (typically seen on a call) clobbers the set of registers it lists. The IfConverter, in UpdatePredRedefs, was handling register defs, but not regmasks.
These are slightly different to a def in that we need to add both an implicit use and def to appease the machine verifier. Otherwise, uses after the if converted call could think they are reading an undefined register.
Reviewed by Matthias Braun and Quentin Colombet.
llvm-svn: 236515
Pete Cooper [Tue, 5 May 2015 18:31:31 +0000 (18:31 +0000)]
Refactor UpdatePredRedefs and StepForward to avoid duplication. NFC
The code was basically the same here already. Just added an out parameter for a vector of seen defs so that UpdatePredRedefs can call StepForward first, then do its own post processing on the seen defs.
Will be used in the next commit to also handle regmasks.
llvm-svn: 236514
Diego Novillo [Tue, 5 May 2015 18:24:47 +0000 (18:24 +0000)]
Fix typo in assert message. NFC.
llvm-svn: 236513
David Blaikie [Tue, 5 May 2015 18:12:33 +0000 (18:12 +0000)]
Fix the clang -Werror build, use of uninitialized variable.
llvm-svn: 236512
Daniel Berlin [Tue, 5 May 2015 18:10:49 +0000 (18:10 +0000)]
Update BasicAliasAnalysis to understand that nothing aliases with undef values.
It got this in some cases (if one of them was an identified object), but not in all cases.
This caused stores to undef to block load-forwarding in some cases, etc.
Added test to Transforms/GVN to verify optimization occurs as expected.
llvm-svn: 236511
David Blaikie [Tue, 5 May 2015 18:03:48 +0000 (18:03 +0000)]
[opaque pointer type] Track explicit GEP pointee type through in-memory IR
llvm-svn: 236510
Chaoren Lin [Tue, 5 May 2015 17:50:53 +0000 (17:50 +0000)]
Fix Android build.
llvm-svn: 236509
Reid Kleckner [Tue, 5 May 2015 17:44:16 +0000 (17:44 +0000)]
Re-land "[WinEH] Add an EH registration and state insertion pass for 32-bit x86"
This reverts commit r236360.
This change exposed a bug in WinEHPrepare by opting win32 code into EH
preparation. We already knew that WinEHPrepare has bugs, and is the
status quo for x64, so I don't think that's a reason to hold off on this
change. I disabled exceptions in the sanitizer tests in r236505 and an
earlier revision.
llvm-svn: 236508
Quentin Colombet [Tue, 5 May 2015 17:38:16 +0000 (17:38 +0000)]
[ShrinkWrap] Add (a simplified version) of shrink-wrapping.
This patch introduces a new pass that computes the safe point to insert the
prologue and epilogue of the function.
The interest is to find safe points that are cheaper than the entry and exits
blocks.
As an example and to avoid regressions to be introduce, this patch also
implements the required bits to enable the shrink-wrapping pass for AArch64.
** Context **
Currently we insert the prologue and epilogue of the method/function in the
entry and exits blocks. Although this is correct, we can do a better job when
those are not immediately required and insert them at less frequently executed
places.
The job of the shrink-wrapping pass is to identify such places.
** Motivating example **
Let us consider the following function that perform a call only in one branch of
a if:
define i32 @f(i32 %a, i32 %b) {
%tmp = alloca i32, align 4
%tmp2 = icmp slt i32 %a, %b
br i1 %tmp2, label %true, label %false
true:
store i32 %a, i32* %tmp, align 4
%tmp4 = call i32 @doSomething(i32 0, i32* %tmp)
br label %false
false:
%tmp.0 = phi i32 [ %tmp4, %true ], [ %a, %0 ]
ret i32 %tmp.0
}
On AArch64 this code generates (removing the cfi directives to ease
readabilities):
_f: ; @f
; BB#0:
stp x29, x30, [sp, #-16]!
mov x29, sp
sub sp, sp, #16 ; =16
cmp w0, w1
b.ge LBB0_2
; BB#1: ; %true
stur w0, [x29, #-4]
sub x1, x29, #4 ; =4
mov w0, wzr
bl _doSomething
LBB0_2: ; %false
mov sp, x29
ldp x29, x30, [sp], #16
ret
With shrink-wrapping we could generate:
_f: ; @f
; BB#0:
cmp w0, w1
b.ge LBB0_2
; BB#1: ; %true
stp x29, x30, [sp, #-16]!
mov x29, sp
sub sp, sp, #16 ; =16
stur w0, [x29, #-4]
sub x1, x29, #4 ; =4
mov w0, wzr
bl _doSomething
add sp, x29, #16 ; =16
ldp x29, x30, [sp], #16
LBB0_2: ; %false
ret
Therefore, we would pay the overhead of setting up/destroying the frame only if
we actually do the call.
** Proposed Solution **
This patch introduces a new machine pass that perform the shrink-wrapping
analysis (See the comments at the beginning of ShrinkWrap.cpp for more details).
It then stores the safe save and restore point into the MachineFrameInfo
attached to the MachineFunction.
This information is then used by the PrologEpilogInserter (PEI) to place the
related code at the right place. This pass runs right before the PEI.
Unlike the original paper of Chow from PLDI’88, this implementation of
shrink-wrapping does not use expensive data-flow analysis and does not need hack
to properly avoid frequently executed point. Instead, it relies on dominance and
loop properties.
The pass is off by default and each target can opt-in by setting the
EnableShrinkWrap boolean to true in their derived class of TargetPassConfig.
This setting can also be overwritten on the command line by using
-enable-shrink-wrap.
Before you try out the pass for your target, make sure you properly fix your
emitProlog/emitEpilog/adjustForXXX method to cope with basic blocks that are not
necessarily the entry block.
** Design Decisions **
1. ShrinkWrap is its own pass right now. It could frankly be merged into PEI but
for debugging and clarity I thought it was best to have its own file.
2. Right now, we only support one save point and one restore point. At some
point we can expand this to several save point and restore point, the impacted
component would then be:
- The pass itself: New algorithm needed.
- MachineFrameInfo: Hold a list or set of Save/Restore point instead of one
pointer.
- PEI: Should loop over the save point and restore point.
Anyhow, at least for this first iteration, I do not believe this is interesting
to support the complex cases. We should revisit that when we motivating
examples.
Differential Revision: http://reviews.llvm.org/D9210
<rdar://problem/3201744>
llvm-svn: 236507
Lang Hames [Tue, 5 May 2015 17:37:18 +0000 (17:37 +0000)]
[Orc] Reapply r236465 with fixes for the MSVC bots.
llvm-svn: 236506
Reid Kleckner [Tue, 5 May 2015 16:52:50 +0000 (16:52 +0000)]
Disable exceptions with Clang on Windows in lib/sanitizer-common/tests
While I'm here, fix a copy-paste bug so we get debug info for these
tests.
llvm-svn: 236505
Daniel Sanders [Tue, 5 May 2015 16:29:40 +0000 (16:29 +0000)]
[bugpoint] Increase default memory limit to 400MB to fix bugpoint tests.
I tracked down the bug to an unchecked malloc in SmallVectorBase::grow_pod().
This malloc is returning NULL on my machine when running under bugpoint but not
when -enable-valgrind is given.
llvm-svn: 236504
Kit Barton [Tue, 5 May 2015 16:10:44 +0000 (16:10 +0000)]
This patch adds ABI support for v1i128 data type.
It adds v1i128 to the appropriate register classes and checks parameter passing
and return values.
This is related to http://reviews.llvm.org/D9081, which will add instructions
that exploit the v1i128 datatype.
Phabricator review: http://reviews.llvm.org/D9475
llvm-svn: 236503
Pavel Labath [Tue, 5 May 2015 15:05:50 +0000 (15:05 +0000)]
[NativeProcessLinux] Get rid of the thread state coordinator thread
Summary:
This change removes the thread state coordinator thread by making all the operations it was
performing synchronous. In order to prevent deadlock, NativeProcessLinux must now always call
m_monitor->DoOperation with the m_threads_mutex released. This is needed because HandleWait
callbacks lock the mutex (which means the monitor thread will block waiting on whoever holds the
lock). If the other thread now requests a monitor operation, it will wait for the monitor thread
do process it, creating a deadlock.
To preserve this invariant I have introduced two new Monitor commands: "begin operation block"
and "end operation block". They begin command blocks the monitor from processing waitpid
events until the corresponding end command, thereby assuring the monitor does not attempt to
acquire the mutex.
Test Plan: Run the test suite locally, verify no tests fail.
Reviewers: vharron, chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9227
llvm-svn: 236501
Pavel Labath [Tue, 5 May 2015 14:54:23 +0000 (14:54 +0000)]
Revert "Enable TestConvenienceVariables on Linux"
This reverts commit
193ac6993b64a502db6dc7f2d69dafc47c318407.
The buildbot says the test still fails. :)
llvm-svn: 236500
Pavel Labath [Tue, 5 May 2015 13:48:58 +0000 (13:48 +0000)]
Enable TestConvenienceVariables on Linux
The test has passed in the last 300 runs for me, enabling to see what the buildbot says.
llvm-svn: 236498
Igor Laevsky [Tue, 5 May 2015 13:20:42 +0000 (13:20 +0000)]
Emit comment for gc.relocate showing base and derived pointers in human readable form.
Differential Revision: http://reviews.llvm.org/D9326
llvm-svn: 236497
Pavel Labath [Tue, 5 May 2015 12:10:13 +0000 (12:10 +0000)]
Enable TestChangeValueAPI on Linux
the test has passed in the last 300 runs, enabling to see what the build bot says. Also,
downgrading skipIfGcc to XFAIL, with plans of enabling it in the future if it shows to be
working.
llvm-svn: 236496
Pavel Labath [Tue, 5 May 2015 11:08:08 +0000 (11:08 +0000)]
Enable TestCallStopAndContinue on Linux
This test has been working reliably for me in the last 300 test runs. Enabling to see what the
buildbot thinks...
llvm-svn: 236495
Daniel Sanders [Tue, 5 May 2015 10:32:24 +0000 (10:32 +0000)]
[mips] Generate code for insert/extract operations when using the N64 ABI and MSA.
Summary:
When using the N64 ABI, element-indices use the i64 type instead of i32.
In many cases, we can use iPTR to account for this but additional patterns
and pseudo's are also required.
This fixes most (but not quite all) failures in the test-suite when using
N64 and MSA together.
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9342
llvm-svn: 236494
Alexey Bataev [Tue, 5 May 2015 09:53:25 +0000 (09:53 +0000)]
[OPENMP] Allow use of macros in OpenMP directives/clauses.
llvm-svn: 236493
Ismail Donmez [Tue, 5 May 2015 09:29:43 +0000 (09:29 +0000)]
Fix regression in parsing armv{6,7}hl- triples. These are used by SUSE
and Redhat currently.
Reviewed by Jonathan Roelofs.
llvm-svn: 236492
Alexey Bataev [Tue, 5 May 2015 09:24:37 +0000 (09:24 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.
Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399
llvm-svn: 236491
Alexey Bataev [Tue, 5 May 2015 08:48:39 +0000 (08:48 +0000)]
Revert revision 236487: [OPENMP] Fixed incorrect work with cleanups, NFC.
llvm-svn: 236490
Daniel Sanders [Tue, 5 May 2015 08:48:35 +0000 (08:48 +0000)]
[mips][msa] Test basic operations for the N32 ABI too.
Summary:
This required adding instruction aliases for dneg.
N64 will be enabled shortly but requires additional bugfixes.
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9341
llvm-svn: 236489
Daniel Jasper [Tue, 5 May 2015 08:40:32 +0000 (08:40 +0000)]
clang-format: [JS] support optional methods.
Optional methods use ? tokens like this:
interface X { y?(): z; }
It seems easiest to detect and disambiguate these from ternary
expressions by checking if the code is in a declaration context. Turns
out that that didn't quite work properly for interfaces in Java and JS,
and for JS file root contexts.
Patch by Martin Probst, thank you.
llvm-svn: 236488
Alexey Bataev [Tue, 5 May 2015 08:38:22 +0000 (08:38 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.
Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399
llvm-svn: 236487
Aidan Dodds [Tue, 5 May 2015 08:31:55 +0000 (08:31 +0000)]
Fix GetModuleInfo() not checking for unsupported RSP response.
http://reviews.llvm.org/D9473
llvm-svn: 236486
Daniel Jasper [Tue, 5 May 2015 08:12:50 +0000 (08:12 +0000)]
clang-format: [JS] Do not collapse short interfaces.
Patch by Martin Probst.
llvm-svn: 236485
Dmitry Vyukov [Tue, 5 May 2015 08:09:46 +0000 (08:09 +0000)]
tsan: add memory access functions that accept pc
This is required for Java support, as real PCs don't work for Java.
llvm-svn: 236484
Alexey Bataev [Tue, 5 May 2015 06:32:45 +0000 (06:32 +0000)]
Revert revision 236482: [OPENMP] Fixed incorrect work with cleanups, NFC.
Due to some incompatibilities with Windows.
llvm-svn: 236483
Alexey Bataev [Tue, 5 May 2015 06:21:01 +0000 (06:21 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.
Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399
llvm-svn: 236482
Alexey Bataev [Tue, 5 May 2015 04:56:26 +0000 (04:56 +0000)]
Revert revision 236480: [OPENMP] Fixed incorrect work with cleanups, NFC.
Due to some incompatibilities with Windows.
llvm-svn: 236481
Alexey Bataev [Tue, 5 May 2015 04:42:07 +0000 (04:42 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.
Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399
llvm-svn: 236480
Alexey Bataev [Tue, 5 May 2015 04:05:12 +0000 (04:05 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'task' directive.
For tasks codegen for private/firstprivate variables are different rather than for other directives.
1. Build an internal structure of privates for each private variable:
struct .kmp_privates_t. {
Ty1 var1;
...
Tyn varn;
};
2. Add a new field to kmp_task_t type with list of privates.
struct kmp_task_t {
void * shareds;
kmp_routine_entry_t routine;
kmp_int32 part_id;
kmp_routine_entry_t destructors;
.kmp_privates_t. privates;
};
3. Create a function with destructors calls for all privates after end of task region.
kmp_int32 .omp_task_destructor.(kmp_int32 gtid, kmp_task_t *tt) {
~Destructor(&tt->privates.var1);
...
~Destructor(&tt->privates.varn);
return 0;
}
4. Perform initialization of all firstprivate fields (by simple copying for POD data, copy constructor calls for classes) + provide address of a destructor function after kmpc_omp_task_alloc() and before kmpc_omp_task() calls.
kmp_task_t *new_task = __kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry);
CopyConstructor(new_task->privates.var1, *new_task->shareds.var1_ref);
new_task->shareds.var1_ref = &new_task->privates.var1;
...
CopyConstructor(new_task->privates.varn, *new_task->shareds.varn_ref);
new_task->shareds.varn_ref = &new_task->privates.varn;
new_task->destructors = .omp_task_destructor.;
kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task)
Differential Revision: http://reviews.llvm.org/D9370
llvm-svn: 236479
Jason Molenda [Tue, 5 May 2015 02:05:53 +0000 (02:05 +0000)]
Fix an uninitialized memory use error when interpreting
compact unwind encodings for x86_64 / i386 omit-frame-pointer
code. It was possible for lldb to get the location of saved
registers incorrect for some of these functions.
<rdar://problem/
20753264>
llvm-svn: 236478
Jason Molenda [Tue, 5 May 2015 02:03:37 +0000 (02:03 +0000)]
Add CommandObjectLanguage to the xcode project file.
llvm-svn: 236477
Kostya Serebryany [Tue, 5 May 2015 01:42:55 +0000 (01:42 +0000)]
[lib/Fuzzer] use handle_abort=1 by default so that when assert() fires we save the test case
llvm-svn: 236476
David Majnemer [Tue, 5 May 2015 01:39:20 +0000 (01:39 +0000)]
[MS ABI] Cleanup selectBasePath
Handle some common cases quickly when deeper introspection into the path
has no effect on the final result.
No functional change intended.
llvm-svn: 236475
Kostya Serebryany [Tue, 5 May 2015 01:37:33 +0000 (01:37 +0000)]
[asan] under handle_abort=1 option intercept SIGABRT in addition to SIGSEGV/SIGBUS. Among other things this will allow to set up a death callback for SIGABRT and thus properly handle assert() in lib/Fuzzer
llvm-svn: 236474
Siva Chandra [Tue, 5 May 2015 00:41:35 +0000 (00:41 +0000)]
[ValueObject::GetPointeeData] Get addr from value for eValueHostAddress values.
Summary:
After r236447, ValueObject::GetAddressOf returns LLDB_INVALID_ADDRESS
when the value type is eValueHostAddress. For such a case, clients of
GetAddressOf should get the address from the scalar part of the value
instead of using the value returned by GetAddressOf directly.
This change also makes ValueObject::GetAddressOf set the address type to
eAddressTypeHost for values of eValueHostAddress so that clients can
recognize that they need to fetch the address from the scalar part
of the value.
Test Plan: ninja check-lldb on linux
Reviewers: clayborg, ovyalov
Reviewed By: ovyalov
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9490
llvm-svn: 236473
Lang Hames [Mon, 4 May 2015 23:30:01 +0000 (23:30 +0000)]
[Orc] Revert r236465 - It broke the Windows bots.
Looks like the usual missing explicit move-constructor issue with MSVC. I should
have a fix shortly.
llvm-svn: 236472
Reid Kleckner [Mon, 4 May 2015 23:22:36 +0000 (23:22 +0000)]
[X86] Fix assertion while DAG combining offsets and ExternalSymbols
ExternalSymbol nodes do not contain offsets, unlike GlobalValue nodes.
llvm-svn: 236471
Pete Cooper [Mon, 4 May 2015 22:44:47 +0000 (22:44 +0000)]
[ARM] IT block insertion needs to update kill flags
When forming an IT block from the first MOV here:
%R2<def> = t2MOVr %R0, pred:1, pred:%CPSR, opt:%noreg
%R3<def> = tMOVr %R0<kill>, pred:14, pred:%noreg
the move in to R3 is moved out of the IT block so that later instructions on the same predicate can be inside this block, and we can share the IT instruction.
However, when moving the R3 copy out of the IT block, we need to clear its kill flags for anything in use at this point in time, ie, R0 here.
This appeases the machine verifier which thought that R0 wasn't defined when used.
I have a test case, but its extremely register allocator specific. It would be too fragile to commit a test which depends on the register allocator here.
llvm-svn: 236468
Pete Cooper [Mon, 4 May 2015 22:33:39 +0000 (22:33 +0000)]
Add TransformUtils dependency to lli.
After r236465, Orc uses ValueMaterializer and so needs to link against TransformUtils to get the ValueMaterializer::anchor().
llvm-svn: 236467
Kostya Serebryany [Mon, 4 May 2015 22:30:29 +0000 (22:30 +0000)]
Fix buffer overflow in Lexer
Summary:
Fix PR22407, where the Lexer overflows the buffer when parsing
#include<\
(end of file after slash)
Test Plan:
Added a test that will trigger in asan build.
This case is also covered by the clang-fuzzer bot.
Reviewers: rnk
Reviewed By: rnk
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D9489
llvm-svn: 236466