David Blaikie [Thu, 13 Nov 2014 21:56:57 +0000 (21:56 +0000)]
Fix nested namespace with decltype to hopefully work with MSVC
Build failed here:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/14629/steps/build_Lld/logs/stdio
So I'm taking a shot in the dark that MSVC (whatever version that is)
can't cope with nested name specifiers with a decltype prefix.
llvm-svn: 221931
Rafael Espindola [Thu, 13 Nov 2014 21:54:59 +0000 (21:54 +0000)]
Make a few helper functions static. NFC.
llvm-svn: 221930
Jay Foad [Thu, 13 Nov 2014 21:53:00 +0000 (21:53 +0000)]
[ASan] Really fix zero_page_pc test for PowerPC
Summary:
As a follow-up to D6167, this patch fixes the test to account for
another difference between PowerPC and x86 systems.
On x86 if you branch to an invalid address, you get a SIGSEGV with PC
set to the invalid address (and si_addr in the siginfo struct also set
to the same address).
On PowerPC, you get a SIGSEGV with PC pointing at the branch
instruction, but si_addr set to the invalid address.
You can see this difference if you run the test case under gdb.
Reviewers: kcc, glider, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6226
llvm-svn: 221929
David Blaikie [Thu, 13 Nov 2014 21:40:02 +0000 (21:40 +0000)]
Use unique_ptr to handle ownership of TreePatterns in CodeGenDAGPatterns::PatternFragments
We might be able to use unique_ptr to handle ownership of the
TreePatternNodes too - looking into that next.
llvm-svn: 221928
Stephane Sezer [Thu, 13 Nov 2014 21:39:24 +0000 (21:39 +0000)]
Specify checksums properly for llgs test suite packets.
Summary: These checksums are ignored by llgs but some implementations require them to be specified properly.
Test Plan: Re-run llgs tests with the checksums and make sure we don't break anything.
Reviewers: tfiala, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D6254
llvm-svn: 221927
Aditya Nandakumar [Thu, 13 Nov 2014 21:29:21 +0000 (21:29 +0000)]
We can get the TLOF from the TargetMachine - so constructor no longer requires TargetLoweringObjectFile to be passed.
llvm-svn: 221926
Alexey Samsonov [Thu, 13 Nov 2014 21:19:53 +0000 (21:19 +0000)]
[CMake] Detect if -Wfoo is supported instead of -Wno-foo, as GCC occasionally silently discards unknown -Wno-foo flags.
llvm-svn: 221925
Chad Rosier [Thu, 13 Nov 2014 21:17:58 +0000 (21:17 +0000)]
[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE.
Phabricator Revision: http://reviews.llvm.org/D6103
Patch by "Balaram Makam" <bmakam@codeaurora.org>!
llvm-svn: 221924
Juergen Ributzka [Thu, 13 Nov 2014 20:50:44 +0000 (20:50 +0000)]
[FastISel][AArch64] Don't bail during simple GEP instruction selection.
The generic FastISel code would bail, because it can't emit a sign-extend for
AArch64. This copies the code over and uses AArch64 specific emit functions.
This is not ideal and 'computeAddress' should handles this, so it can fold the
address computation into the memory operation.
I plan to clean up 'computeAddress' anyways, so I will add that in a future
commit.
Related to rdar://problem/
18962471.
llvm-svn: 221923
Matt Arsenault [Thu, 13 Nov 2014 20:44:23 +0000 (20:44 +0000)]
R600/SI: Use s_movk_i32
llvm-svn: 221922
Matt Arsenault [Thu, 13 Nov 2014 20:23:36 +0000 (20:23 +0000)]
R600/SI: Fix definition for s_cselect_b32
These were directly using the old base instruction
class, and specifying the wrong register classes
for operands. The operands can be the other special
inputs besides SGPRs. The op name was also being
directly used for the asm string, so this was printed
without any operands.
llvm-svn: 221921
Matt Arsenault [Thu, 13 Nov 2014 20:07:40 +0000 (20:07 +0000)]
R600: Fix assert on empty function
If a function is just an unreachable, this would hit a
"this is not a MachO target" assertion because of setting
HasSubsectionViaSymbols.
llvm-svn: 221920
Rui Ueyama [Thu, 13 Nov 2014 20:07:06 +0000 (20:07 +0000)]
Un-break the big-endian buildbots
llvm-svn: 221919
Richard Smith [Thu, 13 Nov 2014 20:01:57 +0000 (20:01 +0000)]
PR21437, final part of DR1330: delay-parsing of exception-specifications. This
is a re-commit of Doug's r154844 (modernized and updated to fit into current
Clang).
llvm-svn: 221918
Matt Arsenault [Thu, 13 Nov 2014 19:56:13 +0000 (19:56 +0000)]
R600: Error on initializer for LDS.
Also give a proper error for other address spaces.
llvm-svn: 221917
Matt Arsenault [Thu, 13 Nov 2014 19:49:04 +0000 (19:49 +0000)]
R600/SI: Get rid of FCLAMP_SI pseudo
It's not necessary. Also use complex patterns to allow
src modifier usage.
llvm-svn: 221916
David Majnemer [Thu, 13 Nov 2014 19:48:56 +0000 (19:48 +0000)]
Object, Mach-O: Refactor and clean code up
Don't assert if we can return an error code, reuse existing
functionality like is64Bit().
llvm-svn: 221915
Roman Divacky [Thu, 13 Nov 2014 19:47:31 +0000 (19:47 +0000)]
Remove -Wcast-qual as it's inherited from llvm since r221913.
llvm-svn: 221914
Roman Divacky [Thu, 13 Nov 2014 19:45:27 +0000 (19:45 +0000)]
Use -Wcast-qual in cmake builds, not only autoconfo ones.
llvm-svn: 221913
Yury Gribov [Thu, 13 Nov 2014 19:37:30 +0000 (19:37 +0000)]
Removed r221896, it seems to break build in various ways.
llvm-svn: 221912
Matt Arsenault [Thu, 13 Nov 2014 19:26:50 +0000 (19:26 +0000)]
R600/SI: Allow commuting with src2_modifiers
llvm-svn: 221911
Matt Arsenault [Thu, 13 Nov 2014 19:26:47 +0000 (19:26 +0000)]
R600/SI: Allow commuting some 3 op instructions
e.g. v_mad_f32 a, b, c -> v_mad_f32 b, a, c
This simplifies matching v_madmk_f32.
This looks somewhat surprising, but it appears to be
OK to do this. We can commute src0 and src1 in all
of these instructions, and that's all that appears
to matter.
llvm-svn: 221910
Rafael Espindola [Thu, 13 Nov 2014 18:44:53 +0000 (18:44 +0000)]
Return word_t from read.
This removes the need for a special Read64.
llvm-svn: 221909
Greg Clayton [Thu, 13 Nov 2014 18:30:06 +0000 (18:30 +0000)]
Fixed "SBTarget SBDebugger::CreateTarget (const char *filename)" to use the same semantics as other SBDebugger::CreateTarget() functions.
The issues were:
- If you called this function with any arch other than the default target architecture, creating the target would fail because the Target::GetDefaultArchitecture() would not match the single architecture in the file specified. This caused running the test suite remotely with lldb-platform to fail many many tests due to the bad target.
- It would specify the currently selected platform which might not work for the specified platform
All other SBDebugger::CreateTarget calls do not assume an architecture or platform and if they aren't specified, they don't auto select the wrong one for you.
With this fix, SBTarget SBDebugger::CreateTarget (const char *filename) now behaves like the other SBDebugger::CreateTarget() variants.
llvm-svn: 221908
Greg Clayton [Thu, 13 Nov 2014 18:25:33 +0000 (18:25 +0000)]
Remove extra "/" character from paths resolved in iOS SDKs and also be sure to update the SDK directory infos if needed before we start using m_sdk_directory_infos.
llvm-svn: 221907
Oleksiy Vyalov [Thu, 13 Nov 2014 18:22:16 +0000 (18:22 +0000)]
Refactor NativeProcessLinux::AttachToProcess in order to avoid reinterpret_cast from NativeProcessProtocol* to NativeProcessLinux*.
llvm-svn: 221906
Tim Northover [Thu, 13 Nov 2014 17:58:53 +0000 (17:58 +0000)]
ARM: allow constpool entry to be moved to the user's block in all cases.
Normally entries can only move to a lower address, but when that wasn't viable,
the user's block was considered anyway. Unfortunately, it went via
createNewWater which wasn't designed to handle the case where there's already
an island after the block.
Unfortunately, the test we have is slow and fragile, and I couldn't reduce it
to anything sane even with the @llvm.arm.space intrinsic. The test change here
is recreating the previous one after the change.
rdar://problem/
18545506
llvm-svn: 221905
Tim Northover [Thu, 13 Nov 2014 17:58:51 +0000 (17:58 +0000)]
ARM: avoid duplicating branches during constant islands.
We were using a naive heuristic to determine whether a basic block already had
an unconditional branch at the end. This mostly corresponded to reality
(assuming branches got optimised) because there's not much point in a branch to
the next block, but could go wrong.
llvm-svn: 221904
Tim Northover [Thu, 13 Nov 2014 17:58:48 +0000 (17:58 +0000)]
ARM: add @llvm.arm.space intrinsic for testing ConstantIslands.
Creating tests for the ConstantIslands pass is very difficult, since it depends
on precise layout details. Having the ability to precisely inject a number of
bytes into the stream helps greatly.
llvm-svn: 221903
Rafael Espindola [Thu, 13 Nov 2014 17:12:19 +0000 (17:12 +0000)]
Fix the other build system.
llvm-svn: 221901
Ed Maste [Thu, 13 Nov 2014 16:55:42 +0000 (16:55 +0000)]
Hook up FreeBSD AArch64 support
Patch from Andrew Turner.
llvm-svn: 221900
Rafael Espindola [Thu, 13 Nov 2014 16:52:07 +0000 (16:52 +0000)]
Fix a regression on the disassembling C API.
The fix is easy. Unfortunately, we had 0 tests, so adding one was somewhat
complicated.
Thanks to Kevin Enderby for the report.
llvm-svn: 221899
Colin LeMahieu [Thu, 13 Nov 2014 16:36:30 +0000 (16:36 +0000)]
[Hexagon]
NFC Renaming reserved identifier.
llvm-svn: 221898
Nico Weber [Thu, 13 Nov 2014 16:25:37 +0000 (16:25 +0000)]
clang-format: Format extern "C" blocks like namespace blocks.
namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit. Do the same
for extern "C" blocks.
Before,
extern "C" {
void ExternCFunction();
}
was collapsed into `extern "C" { void ExternCFunction(); }`. Now it stays like
it was.
Fixes http://crbug.com/432640 and part of PR21419.
llvm-svn: 221897
Yury Gribov [Thu, 13 Nov 2014 16:01:23 +0000 (16:01 +0000)]
[ASan] Add process basename to log name and error message to simplify analysis of sanitized systems logs.
Reviewed at http://reviews.llvm.org/D5724
llvm-svn: 221896
Daniel Jasper [Thu, 13 Nov 2014 15:56:28 +0000 (15:56 +0000)]
clang-format: [Java] Support Java enums.
In Java, enums can contain a class body and enum constants can have
arguments as well as class bodies. Support most of that.
llvm-svn: 221895
Chad Rosier [Thu, 13 Nov 2014 15:40:20 +0000 (15:40 +0000)]
[Reassociate] Update comment. NFC.
llvm-svn: 221894
Simon Atanasyan [Thu, 13 Nov 2014 15:29:37 +0000 (15:29 +0000)]
[Mips] Add comment to the test case
No functional changes.
llvm-svn: 221893
Rafael Espindola [Thu, 13 Nov 2014 14:45:22 +0000 (14:45 +0000)]
Simplify code a bit. NFC.
Thanks to Sean Silva for the suggestion.
llvm-svn: 221892
Rafael Espindola [Thu, 13 Nov 2014 14:37:51 +0000 (14:37 +0000)]
Small optimization: once the size is know, we don't have to call fillCurWord.
llvm-svn: 221891
Shankar Easwaran [Thu, 13 Nov 2014 14:30:21 +0000 (14:30 +0000)]
[ELF] Fix the fileoffset according to the ELF spec.
With --no-align-segments, there is a bug that the fileoffset may not be
congruent to virtual address modulo page alignment.
This patch fixes the problem.
llvm-svn: 221890
Simon Atanasyan [Thu, 13 Nov 2014 14:13:12 +0000 (14:13 +0000)]
Delete empty test/missing directory
llvm-svn: 221889
Aaron Ballman [Thu, 13 Nov 2014 13:55:13 +0000 (13:55 +0000)]
Fixing -Wtype-limits warnings with the asserts (the expression would always evaluate to true). Also fixing a -Wcast-qual warning, where the cast expression isn't required.
llvm-svn: 221888
Aaron Ballman [Thu, 13 Nov 2014 13:39:49 +0000 (13:39 +0000)]
Fixing some sign comparison warnings from MSVC; NFC.
llvm-svn: 221887
Duncan P. N. Exon Smith [Thu, 13 Nov 2014 13:17:47 +0000 (13:17 +0000)]
IR: Create the Metadata class
This will become the root of a new class hierarchy separate from
`Value`. As a first step, stick it between `Value` and `MDNode`.
This is part of PR21532.
llvm-svn: 221886
Alexander Kornienko [Thu, 13 Nov 2014 13:09:16 +0000 (13:09 +0000)]
Regression test for the --serialize-diagnostics problem fixed in r221884.
llvm-svn: 221885
Alexander Kornienko [Thu, 13 Nov 2014 13:08:27 +0000 (13:08 +0000)]
Support non-owned DiagnosticConsumer in SetupSerializedDiagnostics
This fixes an assertion when running clang-tidy on a file having
--serialize-diagnostics in compiler options. Committing a regression test
for clang-tidy separately.
Patch by Aaron Wishnick!
llvm-svn: 221884
Elena Demikhovsky [Thu, 13 Nov 2014 11:46:16 +0000 (11:46 +0000)]
AVX-512: SINT_TO_FP cost model and some bugfixes
Checked some corner cases, for example translation
of <8 x i1> to <8 x double>
llvm-svn: 221883
Evgeniy Stepanov [Thu, 13 Nov 2014 09:50:56 +0000 (09:50 +0000)]
[asan] Switch to AsanInitFromRtl in .preinit_array.
There is no functionality change due to a check in AsanActivate.
llvm-svn: 221882
Argyrios Kyrtzidis [Thu, 13 Nov 2014 09:50:19 +0000 (09:50 +0000)]
[libclang] Make sure to visit the body of a CXXForRangeStmt.
llvm-svn: 221881
David Majnemer [Thu, 13 Nov 2014 09:50:18 +0000 (09:50 +0000)]
Object, COFF: Refactor code to get relocation iterators
No functional change intended.
llvm-svn: 221880
Hal Finkel [Thu, 13 Nov 2014 09:29:30 +0000 (09:29 +0000)]
OCAMLFLAGS can contain =, don't use = with sed
Like HOST_LDFLAGS, etc. OCAMLFLAGS can contain =, so use ! as the substitution
separator instead of = (otherwise, sed might error).
llvm-svn: 221879
Aditya Nandakumar [Thu, 13 Nov 2014 09:26:31 +0000 (09:26 +0000)]
This patch changes the ownership of TLOF from TargetLoweringBase to TargetMachine so that different subtargets could share the TLOF effectively
llvm-svn: 221878
Jay Foad [Thu, 13 Nov 2014 09:24:32 +0000 (09:24 +0000)]
InstrProf: support PowerPC64
Summary:
I don't know anything about profiling but it seems to work out of the
box on PowerPC64. At least "make check-profile" works.
A few tests needed tweaking because PowerPC64 IR declares main with
"define signext i32 @main" instead of just "define i32 @main".
This also fixes the asan asan_and_llvm_coverage_test test, which
compiles with -coverage so requires that a profiling version of
libclang_rt has been built.
Reviewers: dexonsmith, kcc, samsonov
Reviewed By: samsonov
Subscribers: samsonov, llvm-commits
Differential Revision: http://reviews.llvm.org/D6233
llvm-svn: 221877
Hal Finkel [Thu, 13 Nov 2014 09:16:54 +0000 (09:16 +0000)]
Revert r219432 - "Revert "[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information."""
Let's try this again...
This reverts r219432, plus a bug fix.
Description of the bug in r219432 (by Nick):
The bug was using AllPositive to break out of the loop; if the loop break
condition i != e is changed to i != e && AllPositive then the
test_modulo_analysis_with_global test I've added will fail as the Modulo will
be calculated incorrectly (as the last loop iteration is skipped, so Modulo
isn't updated with its Scale).
Nick also adds this comment:
ComputeSignBit is safe to use in loops as it takes into account phi nodes, and
the == EK_ZeroEx check is safe in loops as, no matter how the variable changes
between iterations, zero-extensions will always guarantee a zero sign bit. The
isValueEqualInPotentialCycles check is therefore definitely not needed as all
the variable analysis holds no matter how the variables change between loop
iterations.
And this patch also adds another enhancement to GetLinearExpression - basically
to convert ConstantInts to Offsets (see test_const_eval and
test_const_eval_scaled for the situations this improves).
Original commit message:
This reverts r218944, which reverted r218714, plus a bug fix.
Description of the bug in r218714 (by Nick):
The original patch forgot to check if the Scale in VariableGEPIndex flipped the
sign of the variable. The BasicAA pass iterates over the instructions in the
order they appear in the function, and so BasicAliasAnalysis::aliasGEP is
called with the variable it first comes across as parameter GEP1. Adding a
%reorder label puts the definition of %a after %b so aliasGEP is called with %b
as the first parameter and %a as the second. aliasGEP later calculates that %a
== %b + 1 - %idxprom where %idxprom >= 0 (if %a was passed as the first
parameter it would calculate %b == %a - 1 + %idxprom where %idxprom >= 0) -
ignoring that %idxprom is scaled by -1 here lead the patch to incorrectly
conclude that %a > %b.
Revised patch by Nick White, thanks! Thanks to Lang to isolating the bug.
Slightly modified by me to add an early exit from the loop and avoid
unnecessary, but expensive, function calls.
Original commit message:
Two related things:
1. Fixes a bug when calculating the offset in GetLinearExpression. The code
previously used zext to extend the offset, so negative offsets were converted
to large positive ones.
2. Enhance aliasGEP to deduce that, if the difference between two GEP
allocations is positive and all the variables that govern the offset are also
positive (i.e. the offset is strictly after the higher base pointer), then
locations that fit in the gap between the two base pointers are NoAlias.
Patch by Nick White!
llvm-svn: 221876
Jay Foad [Thu, 13 Nov 2014 09:15:15 +0000 (09:15 +0000)]
[ASan] Fix large allocator test case to cope with 64k pages
Summary: My PowerPC64 Linux box has 64k pages. The test assumes 4k pages. Fix it.
Reviewers: glider, eugenis, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6228
llvm-svn: 221875
Argyrios Kyrtzidis [Thu, 13 Nov 2014 09:03:21 +0000 (09:03 +0000)]
[liblang] Handle CXXForRangeStmt during AST visitation.
llvm-svn: 221874
David Majnemer [Thu, 13 Nov 2014 08:46:37 +0000 (08:46 +0000)]
Object, COFF: Increase code reuse
Split getObject's smarts into checkOffset, use this to replace the
handwritten check in getSectionContents. Similarly, replace checks in
section_rel_begin/section_rel_end with getNumberOfRelocations.
No functionality change intended.
llvm-svn: 221873
David Majnemer [Thu, 13 Nov 2014 07:54:05 +0000 (07:54 +0000)]
llvm-readobj: relocAddressLess could potentially lie
On error conditions, relocAddressLess might claim that a value is less
than itself. Instead, abort llvm-readobj. No functionality change
intended.
llvm-svn: 221872
David Majnemer [Thu, 13 Nov 2014 07:42:13 +0000 (07:42 +0000)]
llvm-readobj, COFF: Remove an unused variable
printRelocation doesn't use the section contents. No functionality
change intended.
llvm-svn: 221871
David Majnemer [Thu, 13 Nov 2014 07:42:11 +0000 (07:42 +0000)]
Object, COFF: getRelocationSymbol shouldn't assert
lib/Object is supposed to be robust to malformed object files. Don't
assert if we don't have a symbol table. I'll try to come up with a test
case later.
llvm-svn: 221870
David Majnemer [Thu, 13 Nov 2014 07:42:09 +0000 (07:42 +0000)]
Object, COFF: Cleanup some code in getSectionName
Use StringRef::startswith to tidy up some code, no functionality change
intended.
llvm-svn: 221869
David Majnemer [Thu, 13 Nov 2014 07:42:07 +0000 (07:42 +0000)]
Object, COFF: Fix some theoretical bugs
getObject didn't consider the case where a pointer came before the start
of the object file. No test is included, trying to come up with
something reasonable.
llvm-svn: 221868
David Majnemer [Thu, 13 Nov 2014 07:42:05 +0000 (07:42 +0000)]
Object, COFF: Clean up formatting in hasExtendedRelocations
No functionality changed intended.
llvm-svn: 221867
Jason Molenda [Thu, 13 Nov 2014 07:31:45 +0000 (07:31 +0000)]
A pretty big overhaul of the TryFallbackUnwindPlan method in
RegisterContextLLDB. I have core files of half a dozen tricky
unwind situations on x86/arm and they're all working pretty much
correctly at this point, but we'll need to keep an eye out for
unwinder regressions for a little while; it's tricky to get these
heuristics completely correct in all unwind situations.
<rdar://problem/
18937193>
llvm-svn: 221866
Rafael Espindola [Thu, 13 Nov 2014 07:23:22 +0000 (07:23 +0000)]
Read 64 bits at a time in the bitcode reader.
The reading of 64 bit values could still be optimized, but at least this cuts
down on the number of virtual calls to fetch more data.
llvm-svn: 221865
Simon Atanasyan [Thu, 13 Nov 2014 07:03:41 +0000 (07:03 +0000)]
[ELF] Add CodeModel attribute to the DefinedAtom class
MIPS ELF symbols might contain some additional MIPS-specific flags
in the st_other field besides visibility ones. These flags indicate
code properties like microMIPS / MIPS16 encoding, position independent
code etc. We need to transfer the flags from input objects to the
output linked file to write them into the symbol table, adjust symbols
addresses etc.
I add new attribute CodeModel to the DefinedAtom class to hold target
specific flag and to get over YAML/Native format conversion barrier.
Other architectures/targets can extend CodeModel enumeration by their
own flags.
MIPS specific part of this patch adds support for STO_MIPS_MICROMIPS
flag. This flag marks microMIPS symbols. Such symbol should:
a) Has STO_MIPS_MICROMIPS in the corresponding .symtab record.
b) Has adjusted (odd) address in the corresponding .symtab
and .dynsym records.
llvm-svn: 221864
NAKAMURA Takumi [Thu, 13 Nov 2014 04:56:41 +0000 (04:56 +0000)]
Update \param(s) in MemoryObject::readBytes(). [-Wdocumentation]
llvm-svn: 221863
Shankar Easwaran [Thu, 13 Nov 2014 04:33:06 +0000 (04:33 +0000)]
[ELF] Fix segment alignment.
The segment alignment for PT_LOAD segments is set to page size by default, but
if any of the sections require an alignment more than the page size, the segment
alignment property is set to the maximum alignment of the sections that are part
of the segment.
llvm-svn: 221862
Chandler Carruth [Thu, 13 Nov 2014 04:06:10 +0000 (04:06 +0000)]
[x86] Teach the vector shuffle lowering to make a more nuanced decision
between splitting a vector into 128-bit lanes and recombining them vs.
decomposing things into single-input shuffles and a final blend.
This handles a large number of cases in AVX1 where the cross-lane
shuffles would be much more expensive to represent even though we end up
with a fast blend at the root. Instead, we can do a better job of
shuffling in a single lane and then inserting it into the other lanes.
This fixes the remaining bits of Halide's regression captured in PR21281
for AVX1. However, the bug persists in AVX2 because I've made this
change reasonably conservative. The cases where it makes sense in AVX2
to split into 128-bit lanes are much more rare because we can often do
full permutations across all elements of the 256-bit vector. However,
the particular test case in PR21281 is an example of one of the rare
cases where it is *always* better to work in a single 128-bit lane. I'm
going to try to teach the logic to detect and form the good code even in
AVX2 next, but it will need to use a separate heuristic.
Finally, there is one pesky regression here where we previously would
craftily use vpermilps in AVX1 to shuffle both high and low halves at
the same time. We no longer pull that off, and not for any really good
reason. Ultimately, I think this is just another missing nuance to the
selection heuristic that I'll try to add in afterward, but this change
already seems strictly worth doing considering the magnitude of the
improvements in common matrix math shuffle patterns.
As always, please let me know if this causes a surprising regression for
you.
llvm-svn: 221861
Shankar Easwaran [Thu, 13 Nov 2014 04:03:46 +0000 (04:03 +0000)]
[ELF] Fix conditions for max-page-size.
Fix comments from Rui, also adds a test.
llvm-svn: 221860
Vince Harron [Thu, 13 Nov 2014 04:00:23 +0000 (04:00 +0000)]
TestConcurrentEvents - delay threads not working
Part of TestConcurrentEvents starts threads that are supposed to be
delayed by one second.
Test was adding "delay" threads to the "actions" thread list instead
of the "delay_actions" list, which caused them to be started without
delay.
llvm-svn: 221859
Shankar Easwaran [Thu, 13 Nov 2014 03:25:38 +0000 (03:25 +0000)]
[ELF] Fix max-page-size option.
The user can use the max-page-size option and set the maximum page size. Dont
check for maximum allowed values for page size, as its what the kernel is
configured with.
Fix the test as well.
llvm-svn: 221858
Shankar Easwaran [Thu, 13 Nov 2014 03:25:34 +0000 (03:25 +0000)]
[ELF] Check linker created dynamic variables
Check the values of _GLOBAL_OFFSET_TABLE_ and _DYNAMIC variables created by
linker.
llvm-svn: 221857
Rui Ueyama [Thu, 13 Nov 2014 03:24:54 +0000 (03:24 +0000)]
Update COFF delay-import table tests for r221855.
This test should now have caught a bug fixed in r221853.
llvm-svn: 221856
Rui Ueyama [Thu, 13 Nov 2014 03:22:54 +0000 (03:22 +0000)]
llvm-readobj: Print out address table when dumping COFF delay-import table
llvm-svn: 221855
Frederic Riss [Thu, 13 Nov 2014 03:20:23 +0000 (03:20 +0000)]
Add an assert and a test that verify r221709's fix.
llvm-svn: 221854
Rui Ueyama [Thu, 13 Nov 2014 02:58:36 +0000 (02:58 +0000)]
[PECOFF] Fix delay-import address table contents.
Each entry in the delay-import address table had a wrong alignment
requirement if 32 bit. As a result it got wrong delay-import table.
Because llvm-readobj doesn't print out that field, we don't have a
test for that. I'll submit a test that would catch this bug after
improving llvm-readobj.
llvm-svn: 221853
Chandler Carruth [Thu, 13 Nov 2014 02:42:08 +0000 (02:42 +0000)]
[x86] Don't form overly fragmented blends when splitting and
re-combining shuffles because nothing was available in the wider vector
type.
The key observation (which I've put in the comments for future
maintainers) is that at this point, no further combining is really
possible. And so even though these shuffles trivially could be combined,
we need to actually do that as we produce them when producing them this
late in the lowering.
This fixes another (huge) part of the Halide vector shuffle regressions.
As it happens, this was already well covered by the tests, but I hadn't
noticed how bad some of these got. The specific patterns that turn
directly into unpckl/h patterns were occurring *many* times in common
vector processing code.
There are still more problems here sadly, but trying to incrementally
tease them apart and it looks like this is the core of the problem in
the splitting logic.
There is some chance of regression here, you can see it in the test
changes. Specifically, where we stop forming pshufb in some cases, it is
possible that pshufb was in fact faster. Intel "says" that pshufb is
slower than the instruction sequences replacing it.
llvm-svn: 221852
Quentin Colombet [Thu, 13 Nov 2014 01:44:51 +0000 (01:44 +0000)]
[CodeGenPrepare] Handle zero extensions in the TypePromotionHelper.
Prior to this patch the TypePromotionHelper was promoting only sign extensions.
Supporting zero extensions changes:
- How constants are extended.
- How sign extensions, zero extensions, and truncate are composed together.
- How the type of the extended operation is recorded. Now we need to know the
kind of the extension as well as its type.
Each change is fairly small, unlike the diff.
Most of the diff are comments/variable renaming to say "extension" instead of
"sign extension".
The performance improvements on the test suite are within the noise.
Related to <rdar://problem/
18310086>.
llvm-svn: 221851
Enrico Granata [Thu, 13 Nov 2014 01:38:38 +0000 (01:38 +0000)]
Do not override the existing definition of addr_size when adding new properties to SBTarget. Fixes rdar://
18963842
llvm-svn: 221850
Hans Wennborg [Thu, 13 Nov 2014 00:51:12 +0000 (00:51 +0000)]
CMake: stop setting (well, #undef'ing) HOST_LINK_VERSION; it's used in Clang, not LLVM
llvm-svn: 221849
Juergen Ributzka [Thu, 13 Nov 2014 00:36:46 +0000 (00:36 +0000)]
[FastISel][AArch64] Optimize select when one of the operands is a 'true' or 'false' value.
Optimize selects of i1 in the presence of 'true' and 'false' operands to simple
logic operations.
This fixes rdar://problem/
18960150.
llvm-svn: 221848
Juergen Ributzka [Thu, 13 Nov 2014 00:36:43 +0000 (00:36 +0000)]
[FastISel][AArch64] Fold the cmp into the select when possible.
This folds the compare emission into the select emission when possible, so we
can directly use the flags and don't have to emit a separate compare.
Related to rdar://problem/
18960150.
llvm-svn: 221847
Juergen Ributzka [Thu, 13 Nov 2014 00:36:38 +0000 (00:36 +0000)]
[FastISel][AArch64] Extend 'select' lowering to support also i1 to i16.
Related to rdar://problem/
18960150.
llvm-svn: 221846
Paul Robinson [Thu, 13 Nov 2014 00:36:34 +0000 (00:36 +0000)]
Drop a few unneeded ctor calls (missed code review comment).
llvm-svn: 221845
Hans Wennborg [Thu, 13 Nov 2014 00:35:23 +0000 (00:35 +0000)]
CMake: Set HOST_LINK_VERSION on Darwin (PR21268)
The Autoconf build already does this, but it was never ported to
CMake. The host linker version affects the flags that Clang pass
to the linker, notably whether it passes -demangle or not.
http://reviews.llvm.org/D6239
llvm-svn: 221844
Fariborz Jahanian [Thu, 13 Nov 2014 00:19:30 +0000 (00:19 +0000)]
Fixes test.
llvm-svn: 221843
Frederic Riss [Thu, 13 Nov 2014 00:15:15 +0000 (00:15 +0000)]
Revert "[dwarfdump] Add support for dumping accelerator tables."
This reverts commit r221836.
The tests are asserting on some buildbots. This also reverts the
test part of r221837 as it relies on dwarfdump dumping the
accelerator tables.
llvm-svn: 221842
Paul Robinson [Thu, 13 Nov 2014 00:12:14 +0000 (00:12 +0000)]
Improve long path name support on Windows.
Windows normally limits the length of an absolute path name to 260
characters; directories can have lower limits. These limits increase
to about 32K if you use absolute paths with the special '\\?\'
prefix. Teach Support\Windows\Path.inc to use that prefix as needed.
TODO: Other parts of Support could also learn to use this prefix.
llvm-svn: 221841
Jordan Rose [Thu, 13 Nov 2014 00:08:41 +0000 (00:08 +0000)]
[Bitcode] AtEndOfStream should only check against the size if it's known.
This avoids an issue where AtEndOfStream mistakenly returns true at the /start/ of
a stream.
(In the rare case that the size is known and actually 0, the slow path will still
handle it correctly.)
llvm-svn: 221840
Sanjoy Das [Thu, 13 Nov 2014 00:00:58 +0000 (00:00 +0000)]
Teach ScalarEvolution to sharpen range information.
If x is known to have the range [a, b), in a loop predicated by (icmp
ne x, a) its range can be sharpened to [a + 1, b). Get
ScalarEvolution and hence IndVars to exploit this fact.
This change triggers an optimization to widen-loop-comp.ll, so it had
to be edited to get it to pass.
This change was originally landed in r219834 but had a bug and broke
ASan. It was reverted in r219878, and is now being re-landed after
fixing the original bug.
phabricator: http://reviews.llvm.org/D5639
reviewed by: atrick
llvm-svn: 221839
Richard Smith [Wed, 12 Nov 2014 23:50:13 +0000 (23:50 +0000)]
Another test for PR19372, showing why we need to keep checking arguments after a pack expansion.
llvm-svn: 221838
Frederic Riss [Wed, 12 Nov 2014 23:48:14 +0000 (23:48 +0000)]
Fix emission of Dwarf accelerator table when there are multiple CUs.
The DIE offset in the accel tables is an offset relative to the start
of the debug_info section, but we were encoding the offset to the
start of the containing CU.
llvm-svn: 221837
Frederic Riss [Wed, 12 Nov 2014 23:48:10 +0000 (23:48 +0000)]
[dwarfdump] Add support for dumping accelerator tables.
The class used for the dump only allows to dump for the moment, but
it can (and will) be easily extended to support search also.
llvm-svn: 221836
Frederic Riss [Wed, 12 Nov 2014 23:48:04 +0000 (23:48 +0000)]
Allow DWARFFormValue::extractValue to be called with a null CU.
Currently FormValues are only used for attributes of DIEs and thus
uers always have a CU lying around when calling into the FormValue
API.
Accelerator tables encode their information using the same Forms
as the attributes, thus it is natural to use DWARFFormValue to
extract/dump them. There is no CU in that case though. Allow the
API to be called with a null CU arguemnt by making the RelocMap
lookup conditional on the CU pointer validity. And document this
new behvior in the header. (Test coverage for this use of the API
comes in the DwarfAccelTable support patch)
llvm-svn: 221835
Frederic Riss [Wed, 12 Nov 2014 23:48:01 +0000 (23:48 +0000)]
Remove unsused variables.
llvm-svn: 221834
Richard Smith [Wed, 12 Nov 2014 23:43:08 +0000 (23:43 +0000)]
Add another testcase.
llvm-svn: 221833
Richard Smith [Wed, 12 Nov 2014 23:38:38 +0000 (23:38 +0000)]
PR19372: Keep checking template arguments after we see an argument pack
expansion into a parameter pack; we know that we're still filling in that
parameter's arguments. Previously, if we hit this case for an alias template,
we'd try to substitute using non-canonical template arguments.
llvm-svn: 221832
Nick Kledzik [Wed, 12 Nov 2014 23:34:23 +0000 (23:34 +0000)]
[mach-o] Sort GOT entries by name to make links reproducible
The GOT slots were being laid out in a random order by the GOTPass which
caused randomness in the output file.
Note: With this change lld now bootstraps on darwin. That is:
1) link lld using system linker to make lld.1
2) link lld using lld.1 to make lld.2
3) link lld using lld.2 to make lld.3
Now lld.2 and lld.3 are identical.
llvm-svn: 221831