123081 Commits

Author SHA1 Message Date
Lang Hames
354229b217 [Orc] Fix MSVC bugs introduced in r250749.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250758 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 23:23:17 +00:00
Duncan P. N. Exon Smith
25622c1340 ObjCARC: Remove implicit ilist iterator conversions, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 23:20:14 +00:00
Cong Hou
f2558c2db4 Enhance loop rotation with existence of profile data in MachineBlockPlacement pass.
Currently, in MachineBlockPlacement pass the loop is rotated to let the best exit to be the last BB in the loop chain, to maximize the fall-through from the loop to outside. With profile data, we can determine the cost in terms of missed fall through opportunities when rotating a loop chain and select the best rotation. Basically, there are three kinds of cost to consider for each rotation:

1. The possibly missed fall through edge (if it exists) from BB out of the loop to the loop header.
2. The possibly missed fall through edges (if they exist) from the loop exits to BB out of the loop.
3. The missed fall through edge (if it exists) from the last BB to the first BB in the loop chain.

Therefore, the cost for a given rotation is the sum of costs listed above. We select the best rotation with the smallest cost. This is only for PGO mode when we have more precise edge frequencies.

Differential revision: http://reviews.llvm.org/D10717



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250754 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 23:16:40 +00:00
Lang Hames
e61c7b5220 [Orc] Use '= default' for move constructor/assignment as per dblaikie's review.
Thanks Dave!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250749 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 22:49:18 +00:00
Duncan P. N. Exon Smith
989a95d395 Linker: Remove implicit ilist iterator conversion, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250748 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 22:23:36 +00:00
David Blaikie
36d045a51f Fix -Wdeprecated regarding ORC copying ValueMaterializers
As usual, this is a polymorphic hierarchy without polymorphic ownership,
so simply make the dtor protected non-virtual, protected default copy
ctor/assign, and make derived classes final. The derived classes will
pick up correct default public copy ops (and dtor) implicitly.

(wish I could add -Wdeprecated to the build, but last time I tried it
triggered on some system headers I still need to look into/figure out)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250747 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 22:15:55 +00:00
Michael Liao
2949a6ae04 [InstCombine] Optimize icmp of inc/dec at RHS
Allow LLVM to optimize the sequence like the following:

  %inc = add nsw i32 %i, 1
  %cmp = icmp slt %n, %inc

into:

  %cmp = icmp sle i32 %n, %i

The case is not handled previously due to the complexity of compuation of %n.
Hence, LLVM cannot swap operands of icmp accordingly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250746 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 22:08:14 +00:00
Duncan P. N. Exon Smith
f792618d1c Vectorize: Remove implicit ilist iterator conversions, NFC
Besides the usual, I finally added an overload to
`BasicBlock::splitBasicBlock()` that accepts an `Instruction*` instead
of `BasicBlock::iterator`.  Someone can go back and remove this overload
later (after updating the callers I'm going to skip going forward), but
the most common call seems to be
`BB->splitBasicBlock(BB->getTerminator(), ...)` and I'm not sure it's
better to add `->getIterator()` to every one than have the overload.
It's pretty hard to get the usage wrong.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250745 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 22:06:09 +00:00
Sanjay Patel
3b75c0484a [CGP] transform select instructions into branches and sink expensive operands
This was originally checked in at r250527, but reverted at r250570 because of PR25222.
There were at least 2 problems: 
1. The cost check was checking for an instruction with an exact cost of TCC_Expensive;
that should have been >=.
2. The cause of the clang stage 1 failures was illegally sinking 'call' instructions;
we can't sink instructions that may have side effects / are not safe to execute speculatively.

Fixed those conditions in sinkSelectOperand() and added test cases.

Original commit message:
This is a follow-up to the discussion in D12882.

Ideally, we would like SimplifyCFG to be able to form select instructions even when the operands
are expensive (as defined by the TTI cost model) because that may expose further optimizations.
However, we would then like a later pass like CodeGenPrepare to undo that transformation if the
target would likely benefit from not speculatively executing an expensive op (this patch).

Once we have this safety mechanism in place, we can adjust SimplifyCFG to restore its
select-formation behavior that changed with r248439.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250743 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 21:59:12 +00:00
Duncan P. N. Exon Smith
d765f759fa X86: Remove implicit ilist iterator conversions, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250741 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 21:48:29 +00:00
Lang Hames
17da9b2d15 [RuntimeDyld][COFF] Fix some endianness issues, re-enable the regression test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 20:37:52 +00:00
Owen Anderson
5078875c56 Restore the original behavior of SelectionDAG::getTargetIndex().
It looks like an extra negation snuck in as apart of restoring it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250726 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 19:27:40 +00:00
Krzysztof Parzyszek
62297b167d [Hexagon] Remove unnecessary argument sign extends
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250724 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 19:10:48 +00:00
Teresa Johnson
ca21c56a5f Pass FunctionInfoIndex by reference to WriteFunctionSummaryToFile (NFC)
Implemented suggestion by dblakie in review for r250704.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250723 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 19:06:06 +00:00
Lang Hames
4438c623f7 [Orc] Add explicit move constructor and assignment operator to make MSVC happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250722 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 18:59:22 +00:00
Benjamin Kramer
9f322b8672 Add missing override noticed by Clang's -Winconsistent-missing-override.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250720 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 18:41:23 +00:00
Jun Bum Lim
38a9a5302b [AArch64]Merge halfword loads into a 32-bit load
Convert two halfword loads into a single 32-bit word load with bitfield extract
instructions. For example :
  ldrh w0, [x2]
  ldrh w1, [x2, #2]
becomes
  ldr w0, [x2]
  ubfx w1, w0, #16, #16
  and  w0, w0, #ffff

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250719 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 18:34:53 +00:00
Krzysztof Parzyszek
d497ef1505 [Hexagon] Fix debug information for local objects
- Isolate the check for the existence of a stack frame into hasFP.
- Implement getFrameIndexReference for DWARF address computation.
- Use getFrameIndexReference for offset computation in eliminateFrameIndex.
- Preserve debug information for dynamically allocated stack objects.
- Prefer FP to access local objects at -O0.
- Add experimental code to skip allocframe when not strictly necessary
  (disabled by default).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250718 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 18:30:27 +00:00
Benjamin Kramer
6e76a23a66 Put back SelectionDAG::getTargetIndex.
While technically this is untested dead code, it has out-of-tree users.
This reverts a part of r250434.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250717 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 18:26:16 +00:00
Lang Hames
a4b30b513d [Orc] Lambda needs to capture 'this'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250716 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 17:53:43 +00:00
Lang Hames
e6cb054d6a [Orc] Remove extraneous semicolon that found its way into r250712.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250715 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 17:49:37 +00:00
Krzysztof Parzyszek
c3d768d729 [Hexagon] Delay emission of CFI instructions
Emit the CFI instructions after all code transformation have been done.
This will avoid any interference between CFI instructions and packetization.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250714 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 17:46:01 +00:00
Matthias Braun
dbab1c23c7 Revert "RegisterPressure: allocatable physreg uses are always kills"
This reverts commit r250596.

Reverted for now as the commit triggers assert in the AMDGPU target
pending investigation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250713 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 17:44:22 +00:00
Lang Hames
65040b23fb [Orc] Add support for emitting indirect stubs directly into the JIT target's
memory, rather than representing the stubs in IR. Update the CompileOnDemand
layer to use this functionality.

Directly emitting stubs is much cheaper than building them in IR and codegen'ing
them (see below). It also plays well with remote JITing - stubs can be emitted
directly in the target process, rather than having to send them over the wire.

The downsides are:

(1) Care must be taken when resolving symbols, as stub symbols are held in a
    separate symbol table. This is only a problem for layer writers and other
    people using this API directly. The CompileOnDemand layer hides this detail.

(2) Aliases of function stubs can't be symbolic any more (since there's no
    symbol definition in IR), but must be converted into a constant pointer
    expression. This means that modules containing aliases of stubs cannot be
    cached. In practice this is unlikely to be a problem: There's no benefit to
    caching such a module anyway.

On balance I think the extra performance is more than worth the trade-offs: In a
simple stress test with 10000 dummy functions requiring stubs and a single
executed "hello world" main function, directly emitting stubs reduced user time
for JITing / executing by over 90% (1.5s for IR stubs vs 0.1s for direct
emission).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250712 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 17:43:51 +00:00
Teresa Johnson
aa8954c114 Convert gold-plugin unnecessary unique_ptr into local (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250704 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 15:23:03 +00:00
Teresa Johnson
bf3fb71116 Fix required library for r250699 to BitWriter instead of BitReader.
This should fix the mingw3 bot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250703 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 15:21:46 +00:00
Teresa Johnson
2b24129f17 Fix windows bot failures from r250699 by removing "/" from expected path
in test output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250701 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 15:19:02 +00:00
Teresa Johnson
d6e77b7d15 llvm-lto support for generating combined function indexes
Summary:
This patch adds support to llvm-lto that mirrors the support added by
r249270 to the gold plugin. This enables better testing of combined
index generation for ThinLTO.

Added a new test, and this support will be used in the test in D13515.

Reviewers: joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250699 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 14:30:44 +00:00
Benjamin Kramer
fa39e176c7 Remove CRLF newlines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 13:05:25 +00:00
Asiri Rathnayake
52578b0850 Fix mapping of @llvm.arm.ssat/usat intrinsics to ssat/usat instructions
The mapping of these two intrinsics in ARMInstrInfo.td had a small
omission which lead to their operands not being validated/transformed
before being lowered into usat and ssat instructions. This can cause
incorrect instructions to be emitted.

I've also added tests for the remaining two saturating arithmatic
intrinsics @llvm.arm.qadd and @llvm.arm.qsub as they are missing
codegen tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250697 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 11:44:24 +00:00
James Molloy
f9cd1bee2f [GlobalsAA] Fix a really horrible iterator invalidation bug
We were keeping a reference to an object in a DenseMap then mutating it. At the end of the function we were attempting to clone that reference into other keys in the DenseMap, but DenseMap may well decide to resize its hashtable which would invalidate the reference!

It took an extremely complex testcase to catch this - many thanks to Zhendong Su for catching it in PR25225.

This fixes PR25225.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 08:54:59 +00:00
Elena Demikhovsky
da40167c02 Removed parameter "Consecutive" from isLegalMaskedLoad() / isLegalMaskedStore().
Originally I planned to use the same interface for masked gather/scatter and set isConsecutive to "false" in this case.

Now I'm implementing masked gather/scatter and see that the interface is inconvenient. I want to add interfaces isLegalMaskedGather() / isLegalMaskedScatter() instead of using the "Consecutive" parameter in the existing interfaces.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250686 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 07:43:38 +00:00
Zlatko Buljan
62666515e5 [mips][microMIPS] Implement ADDQ.PH, ADDQ_S.W, ADDQH.PH, ADDQH.W, ADDSC, ADDU.PH, ADDU_S.QB, ADDWC and ADDUH.QB instructions
Differential Revision: http://reviews.llvm.org/D13130


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250685 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 07:16:26 +00:00
Zlatko Buljan
cb245a6fb2 [mips][microMIPS] Implement ABSQ.QB, ABSQ_S.PH, ABSQ_S.W, ABSQ_S.QB, INSV, MADD, MADDU, MSUB, MSUBU, MULT and MULTU instructions
Differential Revision: http://reviews.llvm.org/D13721


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250683 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 06:34:44 +00:00
Xinliang David Li
0971eb7364 [PGO] Eliminate prof data register calls on FreeBSD platform
This is a follow up patch of r250199 after verifying the start/stop
section symbols work as spected on FreeBSD.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-19 04:17:10 +00:00
Jakub Staszak
a05c4c2bca Preserve CFG in MergedLoadStoreMotion. This fixes PR24426.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250660 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 19:34:10 +00:00
Rafael Espindola
899fdb1533 Add hashing and DenseMapInfo for ArrayRef
Sometimes it is more natural to use a ArrayRef<uint8_t> than a StringRef to
represent a range of bytes that is not, semantically, a string.

This will be used in lld in a sec.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250658 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 14:04:56 +00:00
Simon Pilgrim
a650c6cf1c [X86][SSE] Add vector bit rotation tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250656 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 12:54:37 +00:00
Simon Pilgrim
ac2c511edd Use SDValue bool check. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250653 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 12:33:54 +00:00
Simon Pilgrim
6771df9849 Move one-use variable inside test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250651 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 11:47:23 +00:00
Asaf Badouh
c375284b82 [X86][AVX512DQ] add scalar fpclass
Differential Revision: http://reviews.llvm.org/D13769


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250650 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 11:04:38 +00:00
Igor Breger
38e1c0e55a AVX512: Lowering i8/i16 vector CTLZ using the dword LZCNT vector instruction
Differential Revision: http://reviews.llvm.org/D13632

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 09:56:39 +00:00
Craig Topper
82760b2b40 [Sparc] Use MCPhysReg instead of unsigned to size static arrays of registers. Should reduce the table size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250644 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 05:29:05 +00:00
Craig Topper
bb2c212cf6 Use array_lengthof. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250643 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 05:15:38 +00:00
Craig Topper
44bf343ec1 Make a bunch of static arrays const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250642 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 05:15:34 +00:00
Lang Hames
2682e3480e [RuntimeDyld] Add support for absolute symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250639 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 01:41:37 +00:00
Xinliang David Li
09717fa07b Minor Instr PGO code restructuring
1. Key constant values (version, magic) and data structures related to raw and 
   indexed profile format are moved into one centralized file: InstrProf.h.
2. Utility function such as MD5Hash computation is also moved to the common 
   header to allow sharing with other components in the future.
3. A header data structure is introduced for Indexed format so that the reader
   and writer can always be in sync.
4. Added some comments to document different places where multiple definition
   of the data structure must be kept in sync (reader/writer, runtime, lowering 
   etc).  No functional change is intended.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250638 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 01:02:29 +00:00
Sanjoy Das
bce4419f78 [SCEV] Fix whitespace issues and remove extra braces; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250636 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 00:29:27 +00:00
Sanjoy Das
6d953d6917 [SCEV] Use std::all_of and std::any_of; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250635 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 00:29:23 +00:00
Sanjoy Das
ba899a9456 [SCEV] Use auto where it helps remove line breaks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250634 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-18 00:29:20 +00:00