Jingyue Wu [Fri, 24 Apr 2015 02:54:06 +0000 (02:54 +0000)]
[NVPTX] enable NaryReassociate in NVPTX
Summary:
We run NaryReassociate right after SLSR because SLSR enables many
opportunities for NaryReassociate. For example, in nary-slsr.ll
foo((a + b) + c);
foo((a + b * 2) + c);
foo((a + b * 3) + c); // 2 muls and 6 adds
after SLSR:
ab = a + b;
foo(ab + c);
ab2 = ab + b;
foo(ab2 + c);
ab3 = ab2 + b;
foo(ab3 + c); // 6 adds
after NaryReassociate:
abc = (a + b) + c;
foo(abc);
ab2c = abc + b;
foo(ab2c);
ab3c = ab2c + b;
foo(ab3c); // 4 adds
Test Plan: nary-slsr.ll
Reviewers: jholewinski, eliben
Reviewed By: eliben
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9066
llvm-svn: 235688
Matt Arsenault [Fri, 24 Apr 2015 01:57:58 +0000 (01:57 +0000)]
R600/SI: Fix verifier error when producing v_madmk_f32
Copy the kill flags when swapping the operands.
llvm-svn: 235687
David Majnemer [Fri, 24 Apr 2015 01:25:08 +0000 (01:25 +0000)]
Replace getPointeeType()->isFunctionType with isMemberDataPointerType
llvm-svn: 235682
David Majnemer [Fri, 24 Apr 2015 01:25:05 +0000 (01:25 +0000)]
[MS ABI] Fix the preferred alignment of member pointers
Member pointers in the MS ABI have different alignment depending on
whether they were created on the stack or live in a record.
llvm-svn: 235681
David Majnemer [Fri, 24 Apr 2015 01:24:59 +0000 (01:24 +0000)]
Cleanup some MS-ABI specific code
No functional change intended.
llvm-svn: 235680
Matthias Braun [Fri, 24 Apr 2015 01:15:27 +0000 (01:15 +0000)]
Improve isTriviallyReMaterializable() documentation.
This should make it clear under which narrow circumstances implicit
physreg uses are okay when rematerializing and prevent people from
accidentally allowing too much when overriding
isReallyTriviallyReMaterializable() even with the weaker assert in the
RegisterCoalescer.
llvm-svn: 235679
Richard Smith [Fri, 24 Apr 2015 00:41:09 +0000 (00:41 +0000)]
[modules] Partial revert of r235669: don't create ModuleMacros for imported local macros.
The surrounding infrastructure isn't quite ready for this yet.
llvm-svn: 235677
Bruce Mitchener [Fri, 24 Apr 2015 00:38:53 +0000 (00:38 +0000)]
Start to share SWIG interface files between languages.
Summary:
Move scripts/Python/interface to scripts/interface so that we
can start making iterative improvements towards sharing the
interface files between multiple languages (each of which would
have their own directory as now).
Test Plan: Build and see.
Reviewers: zturner, emaste, clayborg
Reviewed By: clayborg
Subscribers: mjsabby, lldb-commits
Differential Revision: http://reviews.llvm.org/D9212
llvm-svn: 235676
Matthias Braun [Fri, 24 Apr 2015 00:25:50 +0000 (00:25 +0000)]
R600/RegisterCoalescer: Enable more rematerialization/add missing testcase
This enables the rematerialization of some R600 MOV instructions in the
RegisterCoalescer and adds a testcase for r235668.
llvm-svn: 235675
Michael Zolotukhin [Fri, 24 Apr 2015 00:10:27 +0000 (00:10 +0000)]
Fix a couple of typos in comments.
llvm-svn: 235674
Matthias Braun [Fri, 24 Apr 2015 00:01:37 +0000 (00:01 +0000)]
RegisterCoalescer: implicit phsreg uses are fine when rematerializing
The target hooks should have already checked them. This change is
necessary to enable the remateriailzation on R600.
llvm-svn: 235673
Matt Arsenault [Thu, 23 Apr 2015 23:34:51 +0000 (23:34 +0000)]
Revert accidentally committed "MC: Allow targets to stop symbol name quoting"
llvm-svn: 235672
Matt Arsenault [Thu, 23 Apr 2015 23:34:48 +0000 (23:34 +0000)]
R600/SI: Special case v_mov_b32 as really rematerializable
This should be fixed to properly understand all rematerializable
instructions while ignoring implicit reads of exec.
llvm-svn: 235671
Matt Arsenault [Thu, 23 Apr 2015 23:34:05 +0000 (23:34 +0000)]
MC: Allow targets to stop symbol name quoting
Currently symbol names are printed in quotes if it contains something
outside of the arbitrary set of characters that isAcceptableChar tests
for. On somem targets, it is never OK to print a symbol name in quotes
so allow targets to opt out of this behavior.
llvm-svn: 235670
Richard Smith [Thu, 23 Apr 2015 23:29:05 +0000 (23:29 +0000)]
[modules] Refactor creation of ModuleMacros and create them when importing from local submodules.
llvm-svn: 235669
Matthias Braun [Thu, 23 Apr 2015 23:24:36 +0000 (23:24 +0000)]
RegisterCoalescer: Avoid unnecessary register class widening for some rematerializations
I couldn't provide a testcase as none of the public targets has wide
register classes with alot of subregisters and at the same time an
instruction which "ReMaterializable" and "AsCheapAsAMove" (could
probably be added for R600).
llvm-svn: 235668
Reid Kleckner [Thu, 23 Apr 2015 23:22:33 +0000 (23:22 +0000)]
Re-commit "[SEH] Remove the old __C_specific_handler code now that WinEHPrepare works"
This reverts commit r235617.
r235649 should have addressed the problems.
llvm-svn: 235667
Richard Smith [Thu, 23 Apr 2015 23:22:26 +0000 (23:22 +0000)]
Fix modules build post-r235612.
llvm-svn: 235666
Hal Finkel [Thu, 23 Apr 2015 23:16:22 +0000 (23:16 +0000)]
[PowerPC] Support register name prefixes for vector registers
Match binutils by supporting the optional register name prefix for new vector
registers ("vs" for VSX registers and "q" for QPX registers).
llvm-svn: 235665
Justin Bogner [Thu, 23 Apr 2015 23:06:47 +0000 (23:06 +0000)]
InstrProf: Stop using RegionCounter outside of CodeGenPGO (NFC)
The RegionCounter type does a lot of legwork, but most of it is only
meaningful within the implementation of CodeGenPGO. The uses elsewhere
in CodeGen generally just want to increment or read counters, so do
that directly.
llvm-svn: 235664
Hal Finkel [Thu, 23 Apr 2015 23:05:08 +0000 (23:05 +0000)]
[PowerPC] Use sync inst alias when printing
So long as the choice between printing msync and sync is not ambiguous, we can
print 'sync 0' and just 'sync'.
llvm-svn: 235663
Tom Stellard [Thu, 23 Apr 2015 22:59:24 +0000 (22:59 +0000)]
R600: Correctly lower CONCAT_VECTOR nodes with more than 2 operands
llvm-svn: 235662
Richard Smith [Thu, 23 Apr 2015 22:58:06 +0000 (22:58 +0000)]
[modules] Properly attribute macros to modules if they're in a file textually included into a file in the module.
llvm-svn: 235661
Michael Zolotukhin [Thu, 23 Apr 2015 22:55:48 +0000 (22:55 +0000)]
Fix comment for NoCommonBits.
Maybe there is a better wording, but at least it should be technically
correct now.
llvm-svn: 235660
Hal Finkel [Thu, 23 Apr 2015 22:47:57 +0000 (22:47 +0000)]
[PowerPC] Add asm/disasm support for dcbt with hint
Add assembler/disassembler support for dcbt/dcbtst (and aliases) with the hint
field specified (non-zero). Unforunately, the syntax for this instruction is
special in that it differs for server vs. embedded cores:
dcbt ra, rb, th [server]
dcbt th, ra, rb [embedded]
where th can be omitted when it is 0. dcbtst is the same. Thus we need to play
games in the parser and the printer to flip the operands around on the embedded
cores. We'll use the server syntax as the default (binutils currently uses the
embedded form by default, but IBM is changing that).
We also stop marking dcbtst as having unmodeled side effects (this is not
necessary, it is just a hint like dcbt -- noticed by inspection, so no separate
test case).
llvm-svn: 235657
Andrew Kaylor [Thu, 23 Apr 2015 22:38:36 +0000 (22:38 +0000)]
[WinEH] Ignore filter clauses while mapping landing pad blocks.
llvm-svn: 235656
Jay Foad [Thu, 23 Apr 2015 22:20:33 +0000 (22:20 +0000)]
[Sanitizer] Fix getpwnam test on ppc64le Fedora 21.
Summary:
On ppc64le Fedora 21, getpwnam_r("no-such-user", ...) returns ENOENT
instead of 0. Tolerate this in the test case.
Reviewers: eugenis
Reviewed By: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9233
llvm-svn: 235654
Chaoren Lin [Thu, 23 Apr 2015 22:19:29 +0000 (22:19 +0000)]
Fix build.
llvm-svn: 235653
Reid Kleckner [Thu, 23 Apr 2015 21:36:32 +0000 (21:36 +0000)]
Remove trivial assert to fix NDEBUG Werror builds
llvm-svn: 235652
David Blaikie [Thu, 23 Apr 2015 21:36:23 +0000 (21:36 +0000)]
Recommit r235458: [opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst
(reverted in r235533)
Original commit message:
"Calls to llvm::Value::mutateType are becoming extra-sensitive now that
instructions have extra type information that will not be derived from
operands or result type (alloca, gep, load, call/invoke, etc... ). The
special-handling for mutateType will get more complicated as this work
continues - it might be worth making mutateType virtual & pushing the
complexity down into the classes that need special handling. But with
only two significant uses of mutateType (vectorization and linking) this
seems OK for now.
Totally open to ideas/suggestions/improvements, of course.
With this, and a bunch of exceptions, we can roundtrip an indirect call
site through bitcode and IR. (a direct call site is actually trickier...
I haven't figured out how to deal with the IR deserializer's lazy
construction of Function/GlobalVariable decl's based on the type of the
entity which means looking through the "pointer to T" type referring to
the global)"
The remapping done in ValueMapper for LTO was insufficient as the types
weren't correctly mapped (though I was using the post-mapped operands,
some of those operands might not have been mapped yet so the type
wouldn't be post-mapped yet). Instead use the pre-mapped type and
explicitly map all the types.
llvm-svn: 235651
Sergey Matveev [Thu, 23 Apr 2015 21:29:37 +0000 (21:29 +0000)]
Fix clang docs build.
llvm-svn: 235650
Reid Kleckner [Thu, 23 Apr 2015 21:22:30 +0000 (21:22 +0000)]
[WinEH] Replace more lpad value uses with undef
We were asserting on code like this:
extern "C" unsigned long _exception_code();
void might_crash(unsigned long);
void foo() {
__try {
might_crash(0);
} __except(1) {
might_crash(_exception_code());
}
}
Gtest and many other libraries get the exception code from the __except
block. What's supposed to happen here is that EAX is live into the
__except block, and it contains the exception code. Eventually we'll
represent that as a use of the landingpad ehptr value, but for now we
can replace it with undef.
llvm-svn: 235649
Richard Smith [Thu, 23 Apr 2015 21:20:19 +0000 (21:20 +0000)]
[modules] Remove the now-redundant import of all pending macros at the end of building a module.
Since we now track module macros separately from their visibility state, this
is no longer necessary.
llvm-svn: 235648
Quentin Colombet [Thu, 23 Apr 2015 21:17:39 +0000 (21:17 +0000)]
[MachineCopyPropagation] Handle undef flags conservatively so that we do not
remove copies that are useful after breaking some hardware dependencies.
In other words, handle this kind of situations conservatively by assuming reg2
is redefined by the undef flag.
reg1 = copy reg2
= inst reg2<undef>
reg2 = copy reg1
Copy propagation used to remove the last copy.
This is incorrect because the undef flag on reg2 in inst, allows next
passes to put whatever trashed value in reg2 that may help.
In practice we end up with this code:
reg1 = copy reg2
reg2 = 0
= inst reg2<undef>
reg2 = copy reg1
This fixes PR21743.
llvm-svn: 235647
Krzysztof Parzyszek [Thu, 23 Apr 2015 20:57:39 +0000 (20:57 +0000)]
Unbreak build
llvm-svn: 235646
Krzysztof Parzyszek [Thu, 23 Apr 2015 20:42:20 +0000 (20:42 +0000)]
[Hexagon] Minor cleanup in HexagonFrameLowering
llvm-svn: 235645
Richard Smith [Thu, 23 Apr 2015 20:40:50 +0000 (20:40 +0000)]
[modules] Store a ModuleMacro* on an imported macro directive rather than duplicating the info within it.
llvm-svn: 235644
Sergey Matveev [Thu, 23 Apr 2015 20:40:04 +0000 (20:40 +0000)]
Add clang/docs/SanitizerCoverage.rst
Moved from https://code.google.com/p/address-sanitizer/wiki/AsanCoverage
llvm-svn: 235643
Richard Smith [Thu, 23 Apr 2015 20:38:48 +0000 (20:38 +0000)]
Fix clang-tools-extra build after clang r235614.
llvm-svn: 235642
Tom Stellard [Thu, 23 Apr 2015 20:32:01 +0000 (20:32 +0000)]
R600/SI: Fix indirect addressing with a negative constant offset
When the base register index of the vector plus the constant offset
was less than zero, we were passing the wrong base register to the indirect
addressing instruction.
In this case, we need to set the base register to v0 and then add
the computed (negative) index to m0.
llvm-svn: 235641
Peter Collingbourne [Thu, 23 Apr 2015 20:31:35 +0000 (20:31 +0000)]
Thumb2: When applying branch optimizations, visit branches in reverse order.
The order in which branches appear in ImmBranches is approximately their
order within the function body. By visiting later branches first, we reduce
the distance between earlier forward branches and their targets, making it
more likely that the cbn?z optimization, which can only apply to forward
branches, will succeed for those earlier branches.
Differential Revision: http://reviews.llvm.org/D9185
llvm-svn: 235640
Peter Collingbourne [Thu, 23 Apr 2015 20:31:32 +0000 (20:31 +0000)]
ARM: When re-creating a branch via InsertBranch, preserve CPSR flags.
In particular, this preserves the kill flag, which allows the Thumb2 cbn?z
optimization to be applied in cases where a branch has been re-created after
the live variables analysis pass, e.g. by the machine block placement pass.
This appears to be low risk; a number of other targets seem to already be
doing something similar, e.g. AArch64, PowerPC.
Differential Revision: http://reviews.llvm.org/D9184
llvm-svn: 235639
Peter Collingbourne [Thu, 23 Apr 2015 20:31:30 +0000 (20:31 +0000)]
Thumb2: When optimizing for size, do not if-convert branches involving comparisons with zero.
This allows the constant island pass to lower these branches to cbn?z
instructions, resulting in a shorter instruction sequence.
Differential Revision: http://reviews.llvm.org/D9183
llvm-svn: 235638
Peter Collingbourne [Thu, 23 Apr 2015 20:31:26 +0000 (20:31 +0000)]
ARM: When spilling extra registers for alignment, prefer low registers on all Thumb targets.
This makes it more likely that we can use the 16-bit push and pop instructions
on Thumb-2, saving around 4 bytes per function.
Differential Revision: http://reviews.llvm.org/D9165
llvm-svn: 235637
Peter Collingbourne [Thu, 23 Apr 2015 20:31:22 +0000 (20:31 +0000)]
ARM: Only enforce 4-byte alignment on Thumb-2 functions with constant pools.
This appears to have been introduced back in r76698 as part of an unrelated
change. I can find no official ARM documentation stating that Thumb-2 functions
require 4-byte alignment; in fact, ARM documentation appears to contradict
this (see, e.g., ARM Architecture Reference Manual Thumb-2 Supplement,
section 2.6.1: "Thumb-2 enforces 16-bit alignment on all instructions.").
Also remove code that sets alignment for ARM functions, which is redundant
with code in the MachineFunction constructor, and remove the hidden
-arm-align-constant-islands flag, which has been enabled by default since
r146739 (Dec 2011) and has probably received sufficient testing by now.
Differential Revision: http://reviews.llvm.org/D9138
llvm-svn: 235636
Krzysztof Parzyszek [Thu, 23 Apr 2015 20:26:21 +0000 (20:26 +0000)]
[Hexagon] Fix compiler warnings in release build
Patch by Aditya Nandakumar.
llvm-svn: 235635
Adam Nemet [Thu, 23 Apr 2015 20:09:20 +0000 (20:09 +0000)]
[getUnderlyingOjbects] Analyze loop PHIs further to remove false positives
Specifically, if a pointer accesses different underlying objects in each
iteration, don't look through the phi node defining the pointer.
The motivating case is the underlyling-objects-2.ll testcase. Consider
the loop nest:
int **A;
for (i)
for (j)
A[i][j] = A[i-1][j] * B[j]
This loop is transformed by Load-PRE to stash away A[i] for the next
iteration of the outer loop:
Curr = A[0]; // Prev_0
for (i: 1..N) {
Prev = Curr; // Prev = PHI (Prev_0, Curr)
Curr = A[i];
for (j: 0..N)
Curr[j] = Prev[j] * B[j]
}
Since A[i] and A[i-1] are likely to be independent pointers,
getUnderlyingObjects should not assume that Curr and Prev share the same
underlying object in the inner loop.
If it did we would try to dependence-analyze Curr and Prev and the
analysis of the corresponding SCEVs would fail with non-constant
distance.
To fix this, the getUnderlyingObjects API is extended with an optional
LoopInfo parameter. This is effectively what controls whether we want
the above behavior or the original. Currently, I only changed to use
this approach for LoopAccessAnalysis.
The other testcase is to guard the opposite case where we do want to
look through the loop PHI. If we step through an array by incrementing
a pointer, the underlying object is the incoming value of the phi as the
loop is entered.
Fixes rdar://problem/
19566729
llvm-svn: 235634
Adrian McCarthy [Thu, 23 Apr 2015 20:00:25 +0000 (20:00 +0000)]
Factor resolution of abbreviations and aliases so that they can be tested directly. reviews.llvm.org/D9033
llvm-svn: 235633
Jingyue Wu [Thu, 23 Apr 2015 20:00:04 +0000 (20:00 +0000)]
[NVPTX] run SeparateConstOffsetFromGEP before SLSR
Summary:
We pick this order because SeparateConstOffsetFromGEP may create more
opportunities for SLSR.
Test Plan:
reassociate-geps-and-slsr.ll
no performance regression on internal benchmarks
Reviewers: meheff
Subscribers: llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D9230
llvm-svn: 235632
Richard Smith [Thu, 23 Apr 2015 19:36:34 +0000 (19:36 +0000)]
Fix build of lldb after clang r235614.
llvm-svn: 235631
Tom Stellard [Thu, 23 Apr 2015 19:33:55 +0000 (19:33 +0000)]
R600/SI: Add missing -mcpu=SI to assembler test
llvm-svn: 235630
Tom Stellard [Thu, 23 Apr 2015 19:33:54 +0000 (19:33 +0000)]
R600/SI: Add assembler support for all CI and VI VOP1 instructions
llvm-svn: 235629
Tom Stellard [Thu, 23 Apr 2015 19:33:52 +0000 (19:33 +0000)]
R600/SI: v_mov_fed_b32 does not exist on VI
llvm-svn: 235628
Tom Stellard [Thu, 23 Apr 2015 19:33:51 +0000 (19:33 +0000)]
R600/SI: Use a better error message for unsupported instructions in the assembler
llvm-svn: 235627
Tom Stellard [Thu, 23 Apr 2015 19:33:48 +0000 (19:33 +0000)]
R600/SI: Improve AsmParser support for forced e64 encoding
We can now force e64 encoding even when the operands would be legal
for e32 encoding.
llvm-svn: 235626
Tom Stellard [Thu, 23 Apr 2015 18:50:14 +0000 (18:50 +0000)]
Implement fract builtin
This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.
llvm-svn: 235620
Alexey Samsonov [Thu, 23 Apr 2015 18:43:08 +0000 (18:43 +0000)]
[ASan] Relax test modified in r235540 to pacify ARM buildbots.
llvm-svn: 235619
Andrew Kaylor [Thu, 23 Apr 2015 18:37:39 +0000 (18:37 +0000)]
[WinEH] Handle stubs for outlined functions that have only unreached terminators.
llvm-svn: 235618
Reid Kleckner [Thu, 23 Apr 2015 18:34:01 +0000 (18:34 +0000)]
Revert "[SEH] Remove the old __C_specific_handler code now that WinEHPrepare works"
We still have some "uses remain after removal" issues in -O0 builds.
This reverts commit r235557.
llvm-svn: 235617
Hal Finkel [Thu, 23 Apr 2015 18:30:38 +0000 (18:30 +0000)]
[PowerPC] Enable printing instructions using aliases
TableGen had been nicely generating code to print a number of instructions using
shorter aliases (and PowerPC has plenty of short mnemonics), but we were not
calling it. For some of the aliases we support in the parser, TableGen can't
infer the "inverse" alias relationship, so there is still more to do.
Thus, after some hours of updating test cases...
llvm-svn: 235616
Chaoren Lin [Thu, 23 Apr 2015 18:28:04 +0000 (18:28 +0000)]
Fix TestFdLeak on Linux.
Summary:
LLGS leaks pipes (when launched by lldb), sockets (when launched by platform),
and/or log file to the inferior. This should prevent all possible leaks.
Reviewers: vharron, clayborg
Reviewed By: clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9211
llvm-svn: 235615
Richard Smith [Thu, 23 Apr 2015 18:18:26 +0000 (18:18 +0000)]
[modules] Determine the set of macros exported by a submodule at the end of that submodule.
Previously we'd defer this determination until writing the AST, which doesn't
allow us to use this information when building other submodules of the same
module. This change also allows us to use a uniform mechanism for writing
module macro records, independent of whether they are local or imported.
llvm-svn: 235614
Reid Kleckner [Thu, 23 Apr 2015 18:07:13 +0000 (18:07 +0000)]
Don't emit lifetime markers when msan is enabled
In r235553, Clang started emitting lifetime markers more often. This
caused false negative in MSan, because MSan only poisons all allocas
once at function entry. Eventually, MSan should poison allocas at
lifetime start and probably also lifetime end, but until then, let's not
emit markers that aren't going to be useful.
llvm-svn: 235613
Zachary Turner [Thu, 23 Apr 2015 17:37:47 +0000 (17:37 +0000)]
Move DIContext.h to common DebugInfo location.
This will enable us to create a PDBContext so as to expose some
amount of debug info functionality through a common interace.
Differential Revision: http://reviews.llvm.org/D9205
Reviewed by: Alexey Samsonov
llvm-svn: 235612
Philip Reames [Thu, 23 Apr 2015 17:36:48 +0000 (17:36 +0000)]
Move Value.isDereferenceablePointer to ValueTracking [NFC]
Move isDereferenceablePointer function to Analysis. This function recursively tracks dereferencability over a chain of values like other functions in ValueTracking.
This refactoring is motivated by further changes to support dereferenceable_or_null attribute (http://reviews.llvm.org/D8650). isDereferenceablePointer will be extended to perform context-sensitive analysis and IR is not a good place to have such functionality.
Patch by: Artur Pilipenko <apilipenko@azulsystems.com>
Differential Revision: reviews.llvm.org/D9075
llvm-svn: 235611
Pirama Arumuga Nainar [Thu, 23 Apr 2015 17:32:25 +0000 (17:32 +0000)]
[AArch64] Add nvcast patterns for v4f16 and v8f16
Summary:
Constant stores of f16 vectors can create NvCast nodes from various
operand types to v4f16 or v8f16 depending on patterns in the stored
constants. This patch adds nvcast rules with v4f16 and v8f16 values.
AArchISelLowering::LowerBUILD_VECTOR has the details on which constant
patterns generate the nvcast nodes.
Reviewers: jmolloy, srhines, ab
Subscribers: rengolin, aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D9201
llvm-svn: 235610
Pirama Arumuga Nainar [Thu, 23 Apr 2015 17:16:27 +0000 (17:16 +0000)]
[AArch64] Handle vec4, vec8, vec16 *itofp for half
Summary:
Set operation action for SINT_TO_FP and UINT_TO_FP nodes with v4i32,
v8i8, v8i16 inputs to allow promotion of v4f16 results.
Add tests for sitofp and uitofp for vec4, vec8, vec16, and i8, i16, i32,
and i64 vectors. Only missing tests are for v16i8 and v16i16 as the
shift operations are too complicated to write a proper check sequence.
The conversions from v4i64 to v4f16 do not depend on this patch - v4i64
is split and the conversion gets handled while lowering v2i64. I am
adding a test here for completeness.
Reviewers: aemerson, rengolin, ab, jmolloy, srhines
Subscribers: rengolin, aemerson, llvm-commits
Differential Revision: http://reviews.llvm.org/D9166
llvm-svn: 235609
Hans Wennborg [Thu, 23 Apr 2015 16:45:24 +0000 (16:45 +0000)]
Re-commit r235560: Switch lowering: extract jump tables and bit tests before building binary tree (PR22262)
Third time's the charm. The previous commit was reverted as a
reverse for-loop in SelectionDAGBuilder::lowerWorkItem did 'I--'
on an iterator at the beginning of a vector, causing asserts
when using debugging iterators. This commit fixes that.
llvm-svn: 235608
Marshall Clow [Thu, 23 Apr 2015 16:45:08 +0000 (16:45 +0000)]
Fixed an 'extra tokens at end of #endif directive' warning in experimental/ratio
llvm-svn: 235607
Aaron Ballman [Thu, 23 Apr 2015 16:14:19 +0000 (16:14 +0000)]
Extend format specifier checking to include field function pointers in addition to variable function pointers. Addresses PR21082.
llvm-svn: 235606
Aaron Ballman [Thu, 23 Apr 2015 16:12:42 +0000 (16:12 +0000)]
Diagnose variadic main() as an extension; addresses PR17905.
llvm-svn: 235605
Sanjay Patel [Thu, 23 Apr 2015 16:07:50 +0000 (16:07 +0000)]
use update_llc_test_checks.py to tighten checking; remove unnecessary CPU param
llvm-svn: 235604
Krzysztof Parzyszek [Thu, 23 Apr 2015 16:05:39 +0000 (16:05 +0000)]
[Hexagon] Shrink-wrap stack frame (Hexagon-specific)
llvm-svn: 235603
Krzysztof Parzyszek [Thu, 23 Apr 2015 15:12:49 +0000 (15:12 +0000)]
[Hexagon] Add testcases for stack alignment and variable-sized objects
llvm-svn: 235602
Toma Tabacu [Thu, 23 Apr 2015 14:48:38 +0000 (14:48 +0000)]
[mips] [IAS] Move NOP emission after pseudo-instruction expansion. NFC.
As suggested in the review for http://reviews.llvm.org/D8537.
llvm-svn: 235601
Daniel Jasper [Thu, 23 Apr 2015 13:58:40 +0000 (13:58 +0000)]
clang-format: Properly detect variable declarations with ObjC.
Before:
LoooooooooooooooooooooooooooooooooooooooongType
LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
After:
LoooooooooooooooooooooooooooooooooooooooongType
LoooooooooooooooooooooooooooooooooooooongVariable([A a]);
llvm-svn: 235599
Aidan Dodds [Thu, 23 Apr 2015 13:57:30 +0000 (13:57 +0000)]
Replace use of %zu with PRIu64 in DYDL logging message.
llvm-svn: 235598
Aaron Ballman [Thu, 23 Apr 2015 13:41:59 +0000 (13:41 +0000)]
Revert r235560; this commit was causing several failed assertions in Debug builds using MSVC's STL. The iterator is being used outside of its valid range.
llvm-svn: 235597
Filipe Cabecinhas [Thu, 23 Apr 2015 13:38:21 +0000 (13:38 +0000)]
Be more strict about the operand for the array type in BitcodeReader
Summary: Bug found with AFL fuzz.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9016
llvm-svn: 235596
Filipe Cabecinhas [Thu, 23 Apr 2015 13:25:35 +0000 (13:25 +0000)]
Verify sizes when trying to read a BitcodeAbbrevOp
Summary:
Make sure the abbrev operands are valid and that we can read/skip them
afterwards.
Bug found with AFL fuzz.
Reviewers: rafael
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9030
llvm-svn: 235595
Daniel Sanders [Thu, 23 Apr 2015 13:23:21 +0000 (13:23 +0000)]
[asan] debug_mapping.cc should also pass when the leading digit of SHADOW_SCALE is hexadecimal.
Summary:
Previously the CHECK directive for SHADOW_SCALE only matched decimal digits
causing it to match '7' on x86_64 instead of the whole value.
This fixes a failure on mips-linux-gnu targets where the leading digit is 'a'.
Reviewers: kcc, sagar, timurrrr
Reviewed By: timurrrr
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9199
llvm-svn: 235594
Timur Iskhodzhanov [Thu, 23 Apr 2015 13:18:50 +0000 (13:18 +0000)]
[Sanitizer coverage] Print out the error number if OpenFile fails
llvm-svn: 235593
Daniel Jasper [Thu, 23 Apr 2015 12:59:09 +0000 (12:59 +0000)]
clang-format: Allow splitting "= default" and "= delete".
Otherwise, this can violate the column limit.
llvm-svn: 235592
Timur Iskhodzhanov [Thu, 23 Apr 2015 12:58:11 +0000 (12:58 +0000)]
[ASan/Win] Initialize sandbox-related stuff when asked to
llvm-svn: 235591
Timur Iskhodzhanov [Thu, 23 Apr 2015 12:57:29 +0000 (12:57 +0000)]
[ASan/Win] Don't forget to set *last_error if OpenFile fails
llvm-svn: 235590
Ilia K [Thu, 23 Apr 2015 12:48:42 +0000 (12:48 +0000)]
MI fix allowing multiple logging instances of lldb-mi to run simultaneously.
Summary:
Currently if two instances of lldb-mi are running with logging enabled using '--log' the log file conflicts. This produces the following error
MI: Error: File Handler. Error Permission denied opening 'C:\Users\Ewan\LLVM\build\Debug\bin\lldb-mi-log.txt'
Fixed in this patch by renaming lldb-mi-log.txt based on the date, e.g. lldb-mi-log.txt-
20150316163631.log, and moving the file into the temp directory by using the --log-dir option.
Regrading previous review comments the P_tmpdir macro is defined in Windows but always points to "\", which doesn't help much. Also when using the Windows API for GetTempPath() dynamic memory seems much more messy.
Patch from ewan@codeplay.com
Reviewers: abidh, EwanCrawford
Subscribers: zturner, lldb-commits, deepak2427
Differential Revision: http://reviews.llvm.org/D9054
llvm-svn: 235589
Tobias Grosser [Thu, 23 Apr 2015 12:23:56 +0000 (12:23 +0000)]
JScoP Import/Export: Ensure parameters have the same isl_id
When reading parameters from a JSON file parameters with identical names
may be related to different isl_ids, which then causes isl to treat them
as differnet objects. This does not cause issues at the moment, but has
shown problematic in subsequent schedule tree changes.
This commit will be tested by the following changes.
llvm-svn: 235588
Tamas Berghammer [Thu, 23 Apr 2015 10:56:51 +0000 (10:56 +0000)]
Update cpsr register in BLX instruction emulation
Write the new cpsr value into the cpsr register if the BL or the BLX
instruction change the instruction set on arm.
Differential revision: http://reviews.llvm.org/D9188
llvm-svn: 235585
Tamas Berghammer [Thu, 23 Apr 2015 10:54:27 +0000 (10:54 +0000)]
Fix test expectation in TestNoreturnUnwind
The test case lookinhg for the abort function in the stack trace.
Previously it lookd for a function which ends with "abort" but on some
system there are multiple such functions (e.g.: on android abort calls
__libc_android_abort) what made the test fail. This CL change the
behaviour to look for the abort function based on a fix list of names.
llvm-svn: 235584
Daniel Jasper [Thu, 23 Apr 2015 10:23:53 +0000 (10:23 +0000)]
clang-format: Don't add unwanted space when creating new arrays.
Before:
char** newargv = new char* [argc];
After:
char** newargv = new char*[argc];
llvm-svn: 235583
Daniel Jasper [Thu, 23 Apr 2015 09:54:10 +0000 (09:54 +0000)]
clang-format: [Proto] Don't linewrap top-level options.
They are very similar to import statements.
llvm-svn: 235582
Dmitry Vyukov [Thu, 23 Apr 2015 09:33:27 +0000 (09:33 +0000)]
tsan: support setuid call
Currently the call hangs because the background thread
does not handle SIGSETXID signal.
llvm-svn: 235581
Daniel Jasper [Thu, 23 Apr 2015 09:23:17 +0000 (09:23 +0000)]
clang-format: Support nested block formatting with ColumnLimit=0.
llvm-svn: 235580
Pavel Labath [Thu, 23 Apr 2015 09:04:35 +0000 (09:04 +0000)]
[NativeProcessLinux] Fix race condition during inferior thread creation
The following situation occured if we were stopping a process (due to breakpoint, watchpoint, ...
hit) while a new thread was being created.
- process has two threads: A and B.
- thread A hits a breakpoint: we send a STOP signal to thread B and register a callback with
ThreadStateCoordinator to send a stop notification after the thread stops.
- thread B stops, but not due to the SIGSTOP, but on a thread creation event (of a new thread C).
We are unaware of our desire to stop, so we queue ThreadStopped and RequestResume operations
with TSC, so the thread can continue running.
- TSC receives the ThreadStopped event, sees that all threads are stopped and fires the delayed
stop notification.
- immediately after that TSC gets the RequestResume operation, so it resumes the thread.
At this point the state is inconsistent because LLDB thinks the process is stopped and will start
issuing commands to it, but one of the threads is in fact running. Things eventually break.
I address this problem by omitting the two TSC events altogether and Resuming the thread B
directly. This way the short stop is invisible to the TSC and the delayed notification will not
fire. We will fire the notification when we actually process the SIGSTOP on thread B.
When we get the initial SIGSTOP for thread C, we also resume the thread and send a
ThreadWasCreated message (is_stopped = false) to the TSC. This way, the TSC can stop the thread
on its own and handle the stop event later. This way the state of the new thread is correctly
handled as well (thanks Chaoren for the idea).
This patch also removes the synchronisation between the thread creation notifications on threads
B and C. The need for this synchronisation is unclear (the comments seem to hint that the new
thread is "fully created" only after we process both events, but I have noticed no regressions in
treating it as "created" even after just processing the initial C event), but it is a source for
many kinds of obscure races, since it introduces a new thread state "Launching" and the rest of
the code does not handle this state at all (what happens if we get a resume request from LLDB
while this thread is launching? what happens if we get a stop request? etc.).
This fixes the "spurious $O packet" problem in TestPrintStackTraces.py. However, the test remains
disabled on i386 due to the VDSO issue.
Test Plan:
TestPrintStackTraces works on x86_64. No regressions in the rest of the test suite.
Reviewers: vharron, chaoren
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D9145
llvm-svn: 235579
Simon Pilgrim [Thu, 23 Apr 2015 08:43:13 +0000 (08:43 +0000)]
[DAGCombiner] Remove extra bitcasts surrounding vector shuffles
Patch to remove extra bitcasts from shuffles, this is often a legacy of XformToShuffleWithZero being used to combine bitmaskings (of float vectors bitcast to integer vectors) into shuffles: bitcast(shuffle(bitcast(s0),bitcast(s1))) -> shuffle(s0,s1)
Differential Revision: http://reviews.llvm.org/D9097
llvm-svn: 235578
Karthik Bhat [Thu, 23 Apr 2015 08:29:20 +0000 (08:29 +0000)]
Move common loop utility function isInductionPHI into LoopUtils.cpp
This patch refactors the definition of common utility function "isInductionPHI" to LoopUtils.cpp.
This fixes compilation error when configured with -DBUILD_SHARED_LIBS=ON
llvm-svn: 235577
Alexey Bataev [Thu, 23 Apr 2015 07:56:25 +0000 (07:56 +0000)]
[OPENMP] Fix for failed tests for 'omp atomic write' construct.
llvm-svn: 235576
David Majnemer [Thu, 23 Apr 2015 07:42:08 +0000 (07:42 +0000)]
[MS ABI] Add support for mangling VLA types
Treat a VLA type like an incomplete array type.
llvm-svn: 235575
Mohit K. Bhakkad [Thu, 23 Apr 2015 06:36:20 +0000 (06:36 +0000)]
[LLDB][MIPS] Add MIPS32 and MIPS64 core revisions
Patch by Jaydeep Patil
Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32.
DYLDRendezvous.cpp:
On Linux link map struct does not contain extra load offset field.
Reviewers: clayborg
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D9190
llvm-svn: 235574
Alexey Bataev [Thu, 23 Apr 2015 06:35:10 +0000 (06:35 +0000)]
[OPENMP] Codegen for 'atomic capture'.
Adds codegen for 'atomic capture' constructs with the following forms of expressions/statements:
v = x binop= expr;
v = x++;
v = ++x;
v = x--;
v = --x;
v = x = x binop expr;
v = x = expr binop x;
{v = x; x = binop= expr;}
{v = x; x++;}
{v = x; ++x;}
{v = x; x--;}
{v = x; --x;}
{x = x binop expr; v = x;}
{x binop= expr; v = x;}
{x++; v = x;}
{++x; v = x;}
{x--; v = x;}
{--x; v = x;}
{x = x binop expr; v = x;}
{x = expr binop x; v = x;}
{v = x; x = expr;}
If x and expr are integer and binop is associative or x is a LHS in a RHS of the assignment expression, and atomics are allowed for type of x on the target platform atomicrmw instruction is emitted.
Otherwise compare-and-swap sequence is emitted.
Update of 'v' is not required to be be atomic with respect to the read or write of the 'x'.
bb:
...
atomic load <x>
cont:
<expected> = phi [ <x>, label %bb ], [ <new_failed>, %cont ]
<desired> = <expected> binop <expr>
<res> = cmpxchg atomic &<x>, desired, expected
<new_failed> = <res>.field1;
br <res>field2, label %exit, label %cont
exit:
atomic store <old/new x>, <v>
...
Differential Revision: http://reviews.llvm.org/D9049
llvm-svn: 235573