Commit Graph

128476 Commits

Author SHA1 Message Date
Lang Hames
9ab9fd58bd [RuntimeDyld] Fix '_' stripping in RTDyldMemoryManager::getSymbolAddressInProcess.
The RTDyldMemoryManager::getSymbolAddressInProcess method accepts a
linker-mangled symbol name, but it calls through to dlsym to do the lookup (via
DynamicLibrary::SearchForAddressOfSymbol), and dlsym expects an unmangled
symbol name.

Historically we've attempted to "demangle" by removing leading '_'s on all
platforms, and fallen back to an extra search if that failed. That's broken, as
it can cause symbols to resolve incorrectly on platforms that don't do mangling
if you query '_foo' and the process also happens to contain a 'foo'.

Fix this by demangling conditionally based on the host platform. That's safe
here because this function is specifically for symbols in the host process, so
the usual cross-process JIT looking concerns don't apply.

M    unittests/ExecutionEngine/ExecutionEngineTest.cpp
M    lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262657 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 21:23:15 +00:00
Philip Reames
80664b5c60 [ValueTracking] "constant fold" an experimental hidden option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262648 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 19:50:32 +00:00
Philip Reames
5da5d12ae7 [ValueTracking] Remove dead code from an old experiment
This experiment was originally about trying to use facts implied dominating conditions to infer more precise known bits.  While the compile time was found to be acceptable on several large code bases, we never found sufficiently profitable examples to justify turning on the code by default.  Given this, it's time to abandon the experiment.  

Several folks have commented that they've found this useful for experimentation, but nothing has come of those experiments.  Given how easy the patch is to apply, there's no reason to leave the code in tree.  

For anyone interested in further investigation in this area, I recommend finding the summary email I sent on one of the original review threads.  In particular, I now believe the use-list based approach is strictly worse than the dom-tree-walking approach.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262646 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 19:44:06 +00:00
Sanjay Patel
76b12c4bf0 [InstCombine] transform bitcasted bitwise logic ops with constants (PR26702)
Given that we're not actually reducing the instruction count in the included
regression tests, I think we would call this a canonicalization step.

The motivation comes from the example in PR26702:
https://llvm.org/bugs/show_bug.cgi?id=26702

If we hoist the bitwise logic ahead of the bitcast, the previously unoptimizable
example of:

define <4 x i32> @is_negative(<4 x i32> %x) {
  %lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
  %not = xor <4 x i32> %lobit, <i32 -1, i32 -1, i32 -1, i32 -1>
  %bc = bitcast <4 x i32> %not to <2 x i64>
  %notnot = xor <2 x i64> %bc, <i64 -1, i64 -1>
  %bc2 = bitcast <2 x i64> %notnot to <4 x i32>
  ret <4 x i32> %bc2
}

Simplifies to the expected:

define <4 x i32> @is_negative(<4 x i32> %x) {
  %lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
  ret <4 x i32> %lobit
}

Differential Revision: http://reviews.llvm.org/D17583



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 19:19:04 +00:00
Easwaran Raman
97f1aee38b Fix breakage caused by r262636.
Use LLVM_ATTRIBUTE_UNUSED instead of __attribute_((unused))


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262643 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:53:20 +00:00
Sanjoy Das
45385bf7d9 [ConstantRange] Rename test; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262640 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:31:33 +00:00
Sanjoy Das
71638f00b5 [SCEV] Prove no-overflow via constant ranges
Exploit ScalarEvolution::getRange's newly acquired smartness (since
r262438) by using that to infer nsw and nuw when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262639 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:31:29 +00:00
Sanjoy Das
b35a8d0d84 [SCEV] Be less eager about demoting zexts to sexts
After r262438 we can have provably positive NSW SCEV expressions whose
zero extensions cannot be simplified (since r262438 makes SCEV better at
computing constant ranges).  This means demoting sexts of positive add
recurrences eagerly can result in an unsimplified zero extension where
we could have had a simplified sign extension.  This change fixes the
issue by teaching SCEV to demote sext of a positive SCEV expression to a
zext only if the sext could not be simplified.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:31:23 +00:00
Sanjoy Das
1d754782e0 [ConstantRange] Generalize makeGuaranteedNoWrapRegion to work on ranges
This will be used in a later patch to ScalarEvolution.  Right now only
the unit tests exercise the newly added code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262637 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:31:16 +00:00
Easwaran Raman
b76d92e4ad Infrastructure for PGO enhancements in inliner
This patch provides the following infrastructure for PGO enhancements in inliner:

Enable the use of block level profile information in inliner
Incremental update of block frequency information during inlining
Update the function entry counts of callees when they get inlined into callers.

Differential Revision: http://reviews.llvm.org/D16381



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:26:33 +00:00
Simon Pilgrim
ba7833a4be [X86][AVX] Better support for the variable mask form of VPERMILPD/VPERMILPS
The variable mask form of VPERMILPD/VPERMILPS were only partially implemented, with much of it still performed as an intrinsic.

This patch properly defines the instructions in terms of X86ISD::VPERMILPV, permitting the opcode to be easily combined as a target shuffle.

Differential Revision: http://reviews.llvm.org/D17681

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262635 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:13:53 +00:00
Dehao Chen
5c299caf16 Use LineLocation instead of CallsiteLocation to index callsite profile.
Summary: With discriminator, LineLocation can uniquely identify a callsite without the need to specifying callee name. Remove Callee function name from the key, and put it in the value (FunctionSamples).

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17827

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262634 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 18:09:32 +00:00
Simon Pilgrim
9e1362984c [X86] Tidied up 256-bit -> 2 x 128-bit vector shift extraction.
lowerShift was manually splitting BUILD_VECTOR cases when it could just call Extract128BitVector which does this anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262633 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 17:54:35 +00:00
Simon Pilgrim
5b321dc41d [X86] Pulled out repeated code testing for constant vector shift amount. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 17:35:43 +00:00
Amjad Aboud
a40ba754c3 MCU target has its own ABI, however X86 interrupt handler calling convention overrides this ABI.
Fixed the ordering to check first for X86 interrupt handler then for MCU target.

Differential Revision: http://reviews.llvm.org/D17801

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262628 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 17:17:54 +00:00
Ahmed Bougacha
927365a5f5 [X86] Don't assume that shuffle non-mask operands starts at #0.
That's not the case for VPERMV/VPERMV3, which cover all possible
combinations (the C intrinsics use a different order; the AVX vs
AVX512 intrinsics are different still).

Since:
  r246981 AVX-512: Lowering for 512-bit vector shuffles.
VPERMV is recognized in getTargetShuffleMask.

This breaks assumptions in most callers, as they expect
the non-mask operands to start at index 0.
VPERMV has the mask as operand #0; VPERMV3 has it in the middle.

Instead of the faulty assumption, have getTargetShuffleMask return
its operands as well.

One alternative we considered was to change the operand order of
VPERMV, but we agreed to stick to the instruction order, as there
are more AVX512 weirdness to cover (vpermt2/vpermi2 in particular).

Differential Revision: http://reviews.llvm.org/D17041

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 16:53:50 +00:00
Matthew Simpson
72b5335cac [LoopUtils, LV] Fix PR26734
The vectorization of first-order recurrences (r261346) caused PR26734. When
detecting these recurrences, we need to ensure that the previous value is
actually defined inside the loop. This patch includes the fix and test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262624 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 16:12:01 +00:00
Sanjay Patel
4cb228fdc8 [AArch64] fold 'isPositive' vector integer operations (PR26819)
This is one of the cases shown in:
https://llvm.org/bugs/show_bug.cgi?id=26819

Shift and negate is what InstCombine prefers to produce (and I tried to make it do more of that
in http://reviews.llvm.org/rL262424 ), so we should recognize that pattern as something that might
come from autovectorization even if it's unlikely to be produced from C NEON intrinsics.

The patch is based on the x86 equivalent:
http://reviews.llvm.org/rL262036

Differential Revision: http://reviews.llvm.org/D17834



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262623 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 15:56:08 +00:00
Igor Breger
b77a6ae3ef AVX512: Combine AND + TESTM instructions .
Differential Revision: http://reviews.llvm.org/D17844

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262621 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 14:18:38 +00:00
Renato Golin
53546d81b6 Making rem_crash.ll target-specific
This test failed in some ARM bots after a divmod change because it was
running on a native llc, instead of targeted one. This makes sure the test
is target-specific (as intended), and also copies to ARM and AArch64
directories. If it is also supposed to work on other architectures, I'll
leave as an exercise to the respective maintainers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 14:01:10 +00:00
Dylan McKay
ca03902fd5 [AVR] Add calling convention parser tokens
Summary: Adds the 'avr_intrcc' and 'avr_signalcc' IR calling convention tokens to the parser.

Reviewers: arsenm

Subscribers: dylanmckay, llvm-commits

Differential Revision: http://reviews.llvm.org/D16348

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262600 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 10:08:02 +00:00
Simon Pilgrim
946e6cb363 [X86][SSE] Improve vector ZERO_EXTEND by combining to ZERO_EXTEND_VECTOR_INREG
Generalise the existing SIGN_EXTEND to SIGN_EXTEND_VECTOR_INREG combine to support zero extension as well and get rid of a lot of unnecessary ANY_EXTEND + mask patterns.

Differential Revision: http://reviews.llvm.org/D17691

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 09:43:28 +00:00
Renato Golin
ff17c53224 Revert "[ARM] Merging 64-bit divmod lib calls into one"
This reverts commit r262507, which broke some ARM buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262594 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 08:57:44 +00:00
Michael Zuckerman
457254d413 [LLVM][AVX512] PSRLWI Chnage imm8 to int
Differential Revision: http://reviews.llvm.org/D17753



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 08:54:05 +00:00
Matt Arsenault
7ed98632b7 TTI: Fix not using overload of getIntrinsicInstrCost
This was always calling the generic version, so the target
custom implementation was never called.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 05:43:49 +00:00
Junmo Park
26c0c1e822 [BranchFolding] Change function name related with merging MMOs. NFC
Summary:
Removing MMOs is not our prefer behavior any more.

Reviewers: mcrosier, reames
   
Differential Revision: http://reviews.llvm.org/D17668


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262580 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 03:57:20 +00:00
Tom Stellard
bf86946b60 AMDGPU: Insert two S_NOP instructions for every high level source statement.
Patch by: Konstantin Zhuravlyov

Summary: Tools, such as debugger, need to pause execution based on user input (i.e. breakpoint). In order to do this, two S_NOP instructions are inserted for each high level source statement: one before first isa instruction of high level source statement, and one after last isa instruction of high level source statement. Further, debugger may replace S_NOP instructions with S_TRAP instructions based on user input.

Reviewers: tstellarAMD, arsenm

Subscribers: echristo, dblaikie, arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D17454

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262579 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 03:53:29 +00:00
Tom Stellard
ca5193215b AMDGPU/SI: Don't try to move scratch wave offset when there are no free SGPRs
Summary:
When there were no free SGPRs, we were trying to move this value into
some of the reserved registers which was causing a segmentation fault.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D17590

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262577 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 03:45:09 +00:00
Hans Wennborg
2540538e40 [X86] Enable forwarding bool arguments in tail calls (PR26305)
The code was previously not able to track a boolean argument
at a call site back to the formal argument of the caller.

Differential Revision: http://reviews.llvm.org/D17786

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 02:06:32 +00:00
Tim Shen
a06a324ebf [PPCVSXFMAMutate] Temporarily disable this pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262573 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 01:27:35 +00:00
Philip Reames
43605f82e5 [MBP] Renaming a confusing variable and add clarifying comments
Was discussed as part of http://reviews.llvm.org/D17830



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262571 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:58:43 +00:00
Jacques Pienaar
d18d5c63fb [lanai] Fixing file path used in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262567 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:30:02 +00:00
Matthias Braun
d29de67f2b TargetSchedule: Allow explicit Unsupported markers in InstRW
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:05:07 +00:00
Matthias Braun
0101cb0a0b TableGen: Accept itinerary data when checking for schedmodel completeness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:04:59 +00:00
Philip Reames
ef840cb247 [MBP] Avoid placing random blocks between loop preheader and header
If we have a loop with a rarely taken path, we will prune that from the blocks which get added as part of the loop chain. The problem is that we weren't then recognizing the loop chain as schedulable when considering the preheader when forming the function chain. We'd then fall to various non-predecessors before finally scheduling the loop chain (as if the CFG was unnatural.) The net result was that there could be lots of garbage between a loop preheader and the loop, even though we could have directly fallen into the loop. It also meant we separated hot code with regions of colder code.

The particular reason for the rejection of the loop chain was that we were scanning predecessor of the header, seeing the backedge, believing that was a globally more important predecessor (true), but forgetting to account for the fact the backedge precessor was already part of the existing loop chain (oops!.

Differential Revision: http://reviews.llvm.org/D17830



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:01:42 +00:00
David Majnemer
767bd9b70f [X86] Don't give catch objects a displacement of zero
Catch objects with a displacement of zero do not initialize a catch
object.  The displacement is relative to %rsp at the end of the
function's prologue for x86_64 targets.

If we place an object at the top-of-stack, we will end up wit a
displacement of zero resulting in our catch object remaining
uninitialized.

Address this by creating our catch objects as fixed objects.  We will
ensure that the UnwindHelp object is created after the catch objects so
that no catch object will have a displacement of zero.

Differential Revision: http://reviews.llvm.org/D17823

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:01:25 +00:00
Sanjay Patel
21208b5562 [AArch64] add tests to demonstrate existing codegen for PR26819
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 23:22:03 +00:00
Matt Arsenault
e407a109c1 AMDGPU: Simplify boolean conditional return statements
Patch by Richard Thomson

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262536 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 23:00:21 +00:00
Philip Reames
3dee4be78b [MBP] Remove overly verbose debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262531 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 22:40:51 +00:00
Amaury Sechet
0f03390710 Explode store of arrays in instcombine
Summary: This is the last step toward supporting aggregate memory access in instcombine. This explodes stores of arrays into a serie of stores for each element, allowing them to be optimized.

Reviewers: joker.eph, reames, hfinkel, majnemer, mgrang

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17828

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 22:36:45 +00:00
Davide Italiano
ac6554cf16 [llvm-nm] Restore the previous behaviour (pre r262525).
It broke some buildbots.

Pointy-hat to:  me


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 22:33:49 +00:00
Davide Italiano
cf5219da54 [llvm-nm] Fix rendering of -s grouping with all the othe options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262525 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 21:59:31 +00:00
Philip Reames
0dadb9548b [MBP] Adjust debug output to be more focused and approachable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262522 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 21:45:13 +00:00
Amaury Sechet
0158b28774 Unpack array of all sizes in InstCombine
Summary: This is another step toward improving fca support. This unpack load of array in a series of load to array's elements.

Reviewers: chandlerc, joker.eph, majnemer, reames, hfinkel

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262521 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 21:28:30 +00:00
Daniel Berlin
a60047277d Really fix ASAN leak/etc issues with MemorySSA unittests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 21:16:28 +00:00
Kostya Serebryany
c2ecfd6993 [libFuzzer] add -Werror for libFuzzer build rule
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262517 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 21:08:16 +00:00
Daniel Berlin
459c79ef7d Revert "Fix ASAN detected errors in code and test" (it was not meant to be committed yet)
This reverts commit 890bbccd600ba1eb050353d06a29650ad0f2eb95.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 20:36:22 +00:00
Daniel Berlin
2bc88b7640 Fix ASAN detected errors in code and test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262511 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 20:27:29 +00:00
Bob Wilson
4ea25fb3cd Add another test for the GlobalOpt change in r212079.
This is a test that Akira Hatanaka wrote to test GlobalOpt's handling of
aliases with GEP operands. David Majnemer independently made the same
change to GlobalOpt in r212079. Akira's test is a useful addition, so I'm
pulling it over from the llvm repo for Swift on GitHub.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 20:02:25 +00:00
Kostya Serebryany
89ab66dcfc [libFuzzer] more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262509 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-02 19:45:10 +00:00