376 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
5d84a0761e [Hexagon] Separate Hexagon subreg indices for different register classes
For pairs of 32-bit registers: isub_lo, isub_hi.
For pairs of vector registers: vsub_lo, vsub_hi.

Add generic subreg indices: ps_sub_lo, ps_sub_hi, and a function
  HexagonRegisterInfo::getHexagonSubRegIndex(RegClass, GenericSubreg)
that returns the appropriate subreg index for RegClass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 16:19:08 +00:00
Krzysztof Parzyszek
0f89628001 [Hexagon] Eliminate Insert4 pseudo-instruction, use combines instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 14:16:29 +00:00
Krzysztof Parzyszek
eefaf3bd00 [Hexagon] Account for <def,read-undef> when validating moves for predication
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 20:41:03 +00:00
Krzysztof Parzyszek
b051050ad1 [Hexagon] Remove registers coalesced in expand-condsets from live intervals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285846 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 17:59:54 +00:00
Krzysztof Parzyszek
abc5ce4bbc [Hexagon] Don't expand mux instructions with both sources identical
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285588 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-31 15:45:09 +00:00
Krzysztof Parzyszek
1adbd7e4f5 Handle non-~0 lane masks on live-in registers in LivePhysRegs
When LivePhysRegs adds live-in registers, it recognizes ~0 as a special
lane mask indicating the entire register. If the lane mask is not ~0,
it will only add the subregisters that overlap the specified lane mask.

The problem is that if a live-in register does not have subregisters,
and the lane mask is not ~0, it will not be added to the live set.
(The given lane mask may simply be the lane mask of its register class.)

If a register does not have subregisters, add it to the live set if
the lane mask is non-zero.

Differential Revision: https://reviews.llvm.org/D26094


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285440 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 20:06:37 +00:00
Krzysztof Parzyszek
fe1e3ecadd [Hexagon] Maintain kill flags through splitting in expand-condsets
Do not use LiveIntervals to recalculate kills, because that cannot be
done accurately without implicit uses on predicated instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-28 15:50:22 +00:00
Krzysztof Parzyszek
444277c658 [Hexagon] Do not expand ISD::SELECT for HVX vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 14:30:16 +00:00
Krzysztof Parzyszek
b77f18e769 [Hexagon] Handle spills of partially defined double vector registers
After register allocation it is possible to have a spill of a register
that is only partially defined. That in itself it fine, but creates a
problem for double vector registers. Stores of such registers are pseudo
instructions that are expanded into pairs of individual vector stores,
and in case of a partially defined source, one of the stores may use
an entirely undefined register. To avoid this, track the defined parts
and only generate actual stores for those.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284841 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 16:38:29 +00:00
Krzysztof Parzyszek
cac70281f9 [RDF] Switch RefMap in liveness calculation to use lane masks
This required reengineering of some of the part of liveness calculation,
including fixing some issues caused by the limitations of the previous
approach. The current code is not necessarily the fastest, but it should
be functionally correct (at least more so than before). The compile-time
performance will be addressed in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-19 16:30:56 +00:00
Krzysztof Parzyszek
6dcccf4d12 Handle lane masks in LivePhysRegs when adding live-ins
Differential Revision: https://reviews.llvm.org/D25533


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284076 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 22:53:41 +00:00
Krzysztof Parzyszek
7479130c26 Do not remove implicit defs in BranchFolder
Branch folder removes implicit defs if they are the only non-branching
instructions in a block, and the branches do not use the defined registers.
The problem is that in some cases these implicit defs are required for
the liveness information to be correct.

Differential Revision: https://reviews.llvm.org/D25478


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284036 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 19:50:57 +00:00
Krzysztof Parzyszek
1418f155d0 [Hexagon] Avoid replacing full regs with subregisters in tied operands
Doing so will result in the two-address pass generating incorrect code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283463 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 16:18:04 +00:00
Krzysztof Parzyszek
f4de15f80e [RDF] Fix live def propagation through basic block
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 20:08:09 +00:00
Krzysztof Parzyszek
c29dc70bea Fix machine operand traversal in ScheduleDAGInstrs::fixupKills
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-05 13:15:06 +00:00
Matthias Braun
6b11127921 Set some tests to an unknown vendor and OS
This avoids llc using the hosts OS/vendor as defaults and triggering
unwanted behaviour in the tests. This should deal with the buildbot
breakages on windows after r283140.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 21:58:20 +00:00
Krzysztof Parzyszek
6f4042b831 [RDF] Fix liveness propagation through shadows
Each shadow only represents data flow that is restricted to its reaching
def. Propagating more than that could lead to spurious register liveness,
resulting in extra (incorrectly) block live-ins.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-03 20:17:20 +00:00
Krzysztof Parzyszek
a377afabe7 IfConversion: Add implicit uses for redefined regs with live subregisters
Normally, if conversion would add implicit uses for redefined registers,
e.g. R0<def> = add_if ..., R0<imp-use>. However, if only subregisters of
R0 are known to be live but not R0 itself, such implicit uses will not be
added, causing prior definitions of such subregisters and R0 itself to
become dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282626 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-28 20:07:41 +00:00
Ron Lieberman
973dd0ece5 [Hexagon] segv while processing SUnit with nullNodePtr
Added BoundaryNode check to isBestZeroLatency function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-17 16:21:09 +00:00
Sjoerd Meijer
82d457bf36 This reapplies r281304. The issue was that I had missed
to copy the new isAdd field in the tablegen data structure.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 08:20:03 +00:00
Krzysztof Parzyszek
60fc58a44d [Hexagon] Better handling of HVX vector lowering
- Expand SELECT_CC and BR_CC for vector types.
- Implement TLI::isShuffleMaskLegal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 21:16:07 +00:00
Krzysztof Parzyszek
70a4ffa2a1 [Hexagon] Clear the flow queue after visiting a single instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281339 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 14:36:55 +00:00
Sjoerd Meijer
48f6957bd7 Revert of r281304 as it is causing build bot failures in hexagon
hwloop regression tests. These tests pass locally; will be investigating
where these differences come from.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281306 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 08:51:59 +00:00
Sjoerd Meijer
0298251f19 This adds a new field isAdd to MCInstrDesc. The ARM and Hexagon instruction
descriptions now tag add instructions, and the Hexagon backend is using this to
identify loop induction statements.

Patch by Sam Parker and Sjoerd Meijer.

Differential Revision: https://reviews.llvm.org/D23601


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 08:08:06 +00:00
Krzysztof Parzyszek
01b876d45e [RDF] Further improve handling of multiple phis reached from shadows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 20:48:42 +00:00
Krzysztof Parzyszek
3358dc461b [Hexagon] Expand sext- and zextloads of vector types, not just extloads
Recent change exposed this issue, breaking the Hexagon buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280973 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 17:42:14 +00:00
Krzysztof Parzyszek
4ecf8b9ba3 [RDF] Fix liveness analysis for phi nodes with shadow uses
Shadow uses need to be analyzed together, since each individual shadow
will only have a partial reaching def. All shadows together may cover
a given register ref, while each individual shadow may not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 20:37:05 +00:00
Krzysztof Parzyszek
a68463ecad [RDF] Ignore undef use operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280717 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-06 17:03:13 +00:00
Krzysztof Parzyszek
fc0391434b [Hexagon] Deal with undefs when extending live intervals
Reapply r280275, since MSVC accepts r280358.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 13:59:35 +00:00
Reid Kleckner
27e101d577 Revert "Add an optional parameter with a list of undefs to extendToIndices"
This reverts commit r280268, it causes all MSVC 2013 to ICE. This
appears to have been fixed in a later MSVC 2013 update, because I cannot
reproduce it locally. That said, all upstream LLVM bots are broken right
now, so I am reverting.

Also reverts dependent change r280275, "[Hexagon] Deal with undefs when
extending live intervals".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 22:36:02 +00:00
Krzysztof Parzyszek
5cedb44a09 [Hexagon] Deal with undefs when extending live intervals
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 18:52:09 +00:00
Krzysztof Parzyszek
3061990e37 Fixed spill stack objects are mutable
Differential Revision: https://reviews.llvm.org/D24039


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280244 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 13:52:17 +00:00
Krzysztof Parzyszek
5413d61012 Propagate TBAA info in SelectionDAG::getIndexedLoad
Patch by Pranav Bhandarkar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279998 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 19:50:15 +00:00
Kyle Butt
fc5add24fb IfConversion: Fix branch predication bug.
This bug shows up with diamonds that share unpredicable, unanalyzable branches.
There's an included test case from Hexagon. What was happening was that we were
attempting to predicate the branch instruction despite the fact that it was
checked to be the same. Now for unanalyzable branches we skip over the branch
instructions when predicating the block.

Differential Revision: https://reviews.llvm.org/D23939

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 18:27:12 +00:00
Ron Lieberman
142e7149f3 [Hexagon] vector store print tracing.
Add vector store print tracing option for hexagon vector instructions.

https://reviews.llvm.org/D23870



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 13:35:48 +00:00
Matthias Braun
690a3cbc95 MachineFunctionProperties/MIRParser: Rename AllVRegsAllocated->NoVRegs, compute it
Rename AllVRegsAllocated to NoVRegs. This avoids the connotation of
running after register and simply describes that no vregs are used in
a machine function. With that we can simply compute the property and do
not need to dump/parse it in .mir files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279698 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 01:27:13 +00:00
Krzysztof Parzyszek
d720b00354 [Hexagon] Check for block end when skipping debug instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 22:36:35 +00:00
Matthias Braun
6928bc96df Missed a test in my last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279679 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 22:32:11 +00:00
Krzysztof Parzyszek
31a5f885bf Create subranges for new intervals resulting from live interval splitting
The register allocator can split a live interval of a register into a set
of smaller intervals. After the allocation of registers is complete, the
rewriter will modify the IR to replace virtual registers with the corres-
ponding physical registers. At this stage, if a register corresponding
to a subregister of a virtual register is used, the rewriter will check
if that subregister is undefined, and if so, it will add the <undef> flag
to the machine operand. The function verifying liveness of the subregis-
ter would assume that it is undefined, unless any of the subranges of the
live interval proves otherwise.
The problem is that the live intervals created during splitting do not
have any subranges, even if the original parent interval did. This could
result in the <undef> flag placed on a register that is actually defined.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279625 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-24 13:37:55 +00:00
Krzysztof Parzyszek
7fd3acfecb [Hexagon] Packetize return value setup with the return instruction
Commit r279241 unintentionally reverted that ability.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 16:01:01 +00:00
Krzysztof Parzyszek
5e464c99af [Hexagon] Add RUN line to test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 19:36:35 +00:00
Krzysztof Parzyszek
f9a8e626ac [Hexagon] Allow i1 values for 'r' constraint in inline-asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279302 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 19:17:28 +00:00
Krzysztof Parzyszek
4ef1afc7ce [Hexagon] Fixes for new-value jump formation
- Recognize C2_cmpgtui, S2_tstbit_i, and S4_ntstbit_i.
- Avoid creating new-value instructions with both source operands equal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 17:54:49 +00:00
Krzysztof Parzyszek
1ea0947ff4 [Hexagon] Enforce LLSC packetization rules
Ensure that load locked and store conditional instructions are only
packetized with ALU32 instructions.

Patch by Ben Craig.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 16:57:05 +00:00
Krzysztof Parzyszek
0ad37f781f [Hexagon] Fix incorrect generation of S4_subi_asl_ri
Patch by Jyotsna Verma.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 16:35:05 +00:00
Krzysztof Parzyszek
041a158c5d [Hexagon] Allow tail-call optimization when mixing C and fast calling conv
Patch by Arnold Schwaighofer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 15:02:18 +00:00
Krzysztof Parzyszek
b6b40cf4e9 [Hexagon] Check for empty live interval
Patch by Brendon Cahoon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 14:29:43 +00:00
Krzysztof Parzyszek
8fa77e005c [Hexagon] Mark PS_jumpret as pseudo-instruction, expand it into J2_jumpr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 14:04:45 +00:00
Krzysztof Parzyszek
43073745de [Hexagon] Improvements to handling and generation of FP instructions
Improved handling of fma, floating point min/max, additional load/store
instructions for floating point types.

Patch by Jyotsna Verma.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 13:34:31 +00:00
Krzysztof Parzyszek
22850ef9c5 [Hexagon] Create vcombine in HexagonCopyToCombine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279067 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 14:12:34 +00:00