Commit Graph

2084 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
c0ac3859b1 [Hexagon] Fix the value of HexagonII::TypeCVI_FIRST
This value is the first vector instruction type in numerical order. The
previous value was incorrect, leaving TypeCVI_GATHER outside of the range
for vector instructions. This caused vector .new instructions to be
incorrectly encoded in the presence of gather.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335065 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 18:09:54 +00:00
Krzysztof Parzyszek
3e9f1c2ce4 [Hexagon] Enforce restrictions on packetizing cache instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335061 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-19 17:26:20 +00:00
Krzysztof Parzyszek
f173f1f151 [DAGCombiner] Recognize more patterns for ABS
Differential Revision: https://reviews.llvm.org/D47831


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334553 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 21:51:49 +00:00
Krzysztof Parzyszek
32c8f74122 [Hexagon] Make floating point operations expensive for vectorization
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334508 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 15:12:50 +00:00
Krzysztof Parzyszek
77ce0e565d [SelectionDAG] Provide default expansion for rotates
Implement default legalization of rotates: either in terms of the rotation
in the opposite direction (if legal), or in terms of shifts and ors.

Implement generating of rotate instructions for Hexagon. Hexagon only
supports rotates by an immediate value, so implement custom lowering of
ROTL/ROTR on Hexagon. If a rotate is not legal, use the default expansion.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334497 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-12 12:49:36 +00:00
Krzysztof Parzyszek
a6348bee3e [Hexagon] Late predicate producers cannot be used as dot-new sources
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334426 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-11 18:45:52 +00:00
Krzysztof Parzyszek
ddfcacb69b [Hexagon] Implement vector-pair zero as V6_vsubw_dv
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334123 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06 19:34:40 +00:00
Krzysztof Parzyszek
5d3e5a3332 [Hexagon] Split CTPOP of vector pairs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334109 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06 18:03:29 +00:00
Peter Smith
e2b2a91087 [MC] Pass MCSubtargetInfo to fixupNeedsRelaxation and applyFixup
On targets like Arm some relaxations may only be performed when certain
architectural features are available. As functions can be compiled with
differing levels of architectural support we must make a judgement on
whether we can relax based on the MCSubtargetInfo for the function. This
change passes through the MCSubtargetInfo for the function to
fixupNeedsRelaxation so that the decision on whether to relax can be made
per function. In this patch, only the ARM backend makes use of this
information. We must also pass the MCSubtargetInfo to applyFixup because
some fixups skip error checking on the assumption that relaxation has
occurred, to prevent code-generation errors applyFixup must see the same
MCSubtargetInfo as fixupNeedsRelaxation.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334078 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-06 09:40:06 +00:00
Krzysztof Parzyszek
9e7803cfe0 [Hexagon] Add pattern to generate 64-bit neg instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334043 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-05 19:52:39 +00:00
Krzysztof Parzyszek
7488dbc121 [Hexagon] Add more patterns for generating abs/absp instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334038 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-05 19:00:50 +00:00
Krzysztof Parzyszek
19eacef7de [Hexagon] Minor cleanups in isel lowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334015 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-05 12:49:19 +00:00
David Blaikie
8325fb20d4 Move Analysis/Utils/Local.h back to Transforms
Review feedback from r328165. Split out just the one function from the
file that's used by Analysis. (As chandlerc pointed out, the original
change only moved the header and not the implementation anyway - which
was fine for the one function that was used (since it's a
template/inlined in the header) but not in general)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333954 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-04 21:23:21 +00:00
Krzysztof Parzyszek
2985b38bbe [Hexagon] Avoid UB when shifting unsigned integer left by 32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333771 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 15:39:10 +00:00
Krzysztof Parzyszek
e5ce9ac1bd [Hexagon] Select HVX code for vector CTPOP, CTLZ, and CTTZ
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333760 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 14:52:58 +00:00
Krzysztof Parzyszek
925c3a82e2 [SelectionDAG] Expand UADDO/USUBO into ADD/SUBCARRY if legal for target
Additionally, implement handling of ADD/SUBCARRY on Hexagon, utilizing
the UADDO/USUBO expansion.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333751 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 14:00:32 +00:00
Amaury Sechet
876db10e96 Set ADDE/ADDC/SUBE/SUBC to expand by default
Summary:
They've been deprecated in favor of UADDO/ADDCARRY or USUBO/SUBCARRY for a while.

Target that uses these opcodes are changed in order to ensure their behavior doesn't change.

Reviewers: efriedma, craig.topper, dblaikie, bkramer

Subscribers: jholewinski, arsenm, jyknight, sdardis, nemanjai, nhaehnle, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333748 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-01 13:21:33 +00:00
Krzysztof Parzyszek
93c2d96597 [Hexagon] Use vector align-left when shift amount fits in 3 bits
This saves an instruction because for align-right the shift amount
would need to be put in a register first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333543 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-30 13:45:34 +00:00
George Burgess IV
3bf8298d82 Replace AA's uses of uint64_t with LocationSize; NFC.
The uint64_ts that we pass around AA to represent MemoryLocation sizes
are logically an Optional<uint64_t>. In D44748, we want to add an extra
'imprecise' bit to this Optional<uint64_t> to represent whether a given
MemoryLocation size is an upper-bound or an exact size. For more context
on why, please see D44748.

That patch is quite large, but reviewers seem to be OK with the
approach. In D45581 (my first attempt to split 'noise' out of D44748),
reames asked that I land a precursor that is solely replacing uint64_t
with LocationSize, which starts out as `using LocationSize = uint64_t;`.
He also gave me the OK to submit this rename without further review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333314 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 21:16:58 +00:00
Krzysztof Parzyszek
682d7382c6 [Hexagon] Fix packing source vectors in shufflevector selection
When the shuffle mask selected a subvector of the second input vector,
and aligning of the source was performed, the shuffle mask was updated
incorrectly, resulting in an ICE further in the selection process.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333279 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-25 14:53:14 +00:00
Krzysztof Parzyszek
831a9e9185 [Hexagon] Add patterns for accumulating HVX compares
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@333009 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-22 18:27:02 +00:00
Peter Collingbourne
09ac21d393 MC: Separate creating a generic object writer from creating a target object writer. NFCI.
With this we gain a little flexibility in how the generic object
writer is created.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332868 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-21 19:20:29 +00:00
Peter Collingbourne
a8e9721d8d MC: Change MCAsmBackend::writeNopData() to take a raw_ostream instead of an MCObjectWriter. NFCI.
To make this work I needed to add an endianness field to MCAsmBackend
so that writeNopData() implementations know which endianness to use.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332857 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-21 17:57:19 +00:00
Eric Christopher
48b86e9c04 Fix up a few grammar issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332835 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-21 10:27:36 +00:00
Peter Collingbourne
a68d4cc279 Support: Simplify endian stream interface. NFCI.
Provide some free functions to reduce verbosity of endian-writing
a single value, and replace the endianness template parameter with
a field.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332757 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 19:46:24 +00:00
Peter Collingbourne
17a98146db MC: Change the streamer ctors to take an object writer instead of a stream. NFCI.
The idea is that a client that wants split dwarf would create a
specific kind of object writer that creates two files, and use it to
create the streamer.

Part of PR37466.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332749 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 18:26:45 +00:00
Brendon Cahoon
d5b9305f2a [Hexagon] Generate post-increment for floating point types
The code that generates post-increments for Hexagon considered
integer values only. This patch adds support to generate them for
floating point values, f32 and f64.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332748 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 18:14:44 +00:00
Shiva Chen
e27401501e [RISCV] Add WasForced parameter to MCAsmBackend::fixupNeedsRelaxationAdvanced
For RISCV branch instructions, we need to preserve relocation types when linker
relaxation enabled, so then linker could modify offset when the branch offsets
changed.

We preserve relocation types by define shouldForceRelocation.
IsResolved return by evaluateFixup will always false when shouldForceRelocation
return true. It will make RISCV MC Branch Relaxation always relax 16-bit
branches to 32-bit form, even if the symbol actually could be resolved.

To avoid 16-bit branches always relax to 32-bit form when linker relaxation
enabled, we add a new parameter WasForced to indicate that the symbol actually
couldn't be resolved and not forced by shouldForceRelocation return true.

RISCVAsmBackend::fixupNeedsRelaxationAdvanced could relax branches with
unresolved symbols by (!IsResolved && !WasForced).

RISCV MC Branch Relaxation is needed because RISCV could perform 32-bit
to 16-bit transformation in MC layer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332696 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-18 06:42:21 +00:00
Alex Bradbury
efebb47c70 [Hexagon] Use addAliasForDirective for data directives
Data directives such as .word, .half, .hword are currently parsed using 
HexagonAsmParser::ParseDirectiveValue which effectively duplicates logic from 
AsmParser::parseDirectiveValue. This patch deletes that duplicated logic in 
favour of using addAliasForDirective.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332607 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 13:21:18 +00:00
Krzysztof Parzyszek
5dc60d332d [Hexagon] Fix the order of operands when selecting QCAT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332526 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16 21:02:43 +00:00
Krzysztof Parzyszek
bbebdb9580 [Hexagon] Mark HVX vector predicate bitwise ops as legal, add patterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332525 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16 21:00:24 +00:00
Eric Christopher
51be45ab23 Fix up a misleading format warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332521 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-16 20:33:59 +00:00
Krzysztof Parzyszek
b50d67b731 [Hexagon] Remove unused function from subtarget
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332369 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-15 16:32:24 +00:00
Krzysztof Parzyszek
711424181c [Hexagon] Remove unused flag from subtarget and (non)corresponding test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332365 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-15 16:13:52 +00:00
Krzysztof Parzyszek
415c71be4e [Hexagon] Add a target feature to control using small data section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332292 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 21:01:56 +00:00
Krzysztof Parzyszek
b4e7a42135 [Hexagon] Add a target feature for generating new-value stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332290 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 20:41:04 +00:00
Krzysztof Parzyszek
1a0893616d [Hexagon] Add a target feature for memop generation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332285 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 20:09:07 +00:00
Krzysztof Parzyszek
f206c4fa84 [Hexagon] Avoid predicate copies to integer registers from store-locked
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332260 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 16:41:40 +00:00
Nicola Zaghen
0818e789cb Rename DEBUG macro to LLVM_DEBUG.
The DEBUG() macro is very generic so it might clash with other projects.
The renaming was done as follows:
- git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g'
- git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM
- Manual change to APInt
- Manually chage DOCS as regex doesn't match it.

In the transition period the DEBUG() macro is still present and aliased
to the LLVM_DEBUG() one.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332240 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-14 12:53:11 +00:00
Krzysztof Parzyszek
3a2083a2cd [Hexagon] Add patterns for vector shift-and-accumulate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331918 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 21:10:41 +00:00
Krzysztof Parzyszek
61baf50339 [Hexagon] Check the end of the correct container (fix typo)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331907 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 18:33:59 +00:00
Krzysztof Parzyszek
fdba35eadd [Hexagon] Fix sanitizer error about using -1u in variable of enum type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331887 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 15:44:40 +00:00
Krzysztof Parzyszek
4549ddbb68 [Hexagon] Simplify MCCodeEmitter, move data to tables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331883 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 15:02:04 +00:00
Shiva Chen
24abe71d71 [DebugInfo] Examine all uses of isDebugValue() for debug instructions.
Because we create a new kind of debug instruction, DBG_LABEL, we need to
check all passes which use isDebugValue() to check MachineInstr is debug
instruction or not. When expelling debug instructions, we should expel
both DBG_VALUE and DBG_LABEL. So, I create a new function,
isDebugInstr(), in MachineInstr to check whether the MachineInstr is
debug instruction or not.

This patch has no new test case. I have run regression test and there is
no difference in regression test.

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

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331844 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 02:42:00 +00:00
Krzysztof Parzyszek
8fd84d4be2 [Hexagon] Move clamping of extended operands directly to MC code emitter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331653 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-07 17:34:23 +00:00
Fangrui Song
9de4e7f779 Simplify LLVM_ATTRIBUTE_USED call sites.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331599 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-05 20:14:38 +00:00
Krzysztof Parzyszek
adb4ffc311 [Hexagon] Remove leftover debugging code after r331527
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331528 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-04 15:07:30 +00:00
Krzysztof Parzyszek
66648415b9 [Hexagon] Handle non-immediate constants in HexagonSplitDouble
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331527 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-04 15:04:48 +00:00
Krzysztof Parzyszek
1a966b8669 [Hexagon] Skip reserved physical registers when updating liveness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331518 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-04 13:59:05 +00:00
Adrian Prantl
26b584c691 Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

  for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331272 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-01 15:54:18 +00:00