Commit Graph

971 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
bf390b05bc Hexagon V60/HVX DFA scheduler support
Extended DFA tablegen to:
  - added "-debug-only dfa-emitter" support to llvm-tblgen

  - defined CVI_PIPE* resources for the V60 vector coprocessor

  - allow specification of multiple required resources
    - supports ANDs of ORs
    - e.g. [SLOT2, SLOT3], [CVI_MPY0, CVI_MPY1] means:
           (SLOT2 OR SLOT3) AND (CVI_MPY0 OR CVI_MPY1)

  - added support for combo resources
    - allows specifying ORs of ANDs
    - e.g. [CVI_XLSHF, CVI_MPY01] means:
           (CVI_XLANE AND CVI_SHIFT) OR (CVI_MPY0 AND CVI_MPY1)

  - increased DFA input size from 32-bit to 64-bit
    - allows for a maximum of 4 AND'ed terms of 16 resources

  - supported expressions now include:

    expression     => term [AND term] [AND term] [AND term]
    term           => resource [OR resource]*
    resource       => one_resource | combo_resource
    combo_resource => (one_resource [AND one_resource]*)

Author: Dan Palermo <dpalermo@codeaurora.org>

kparzysz: Verified AMDGPU codegen to be unchanged on all llc
tests, except those dealing with instruction encodings.

Reapply the previous patch, this time without circular dependencies.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253793 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 20:00:45 +00:00
Krzysztof Parzyszek
a00b4f6e5d Revert r253790: it breaks all builds for some reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253791 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 17:38:33 +00:00
Krzysztof Parzyszek
c7fdae2400 Hexagon V60/HVX DFA scheduler support
Extended DFA tablegen to:
  - added "-debug-only dfa-emitter" support to llvm-tblgen

  - defined CVI_PIPE* resources for the V60 vector coprocessor

  - allow specification of multiple required resources
    - supports ANDs of ORs
    - e.g. [SLOT2, SLOT3], [CVI_MPY0, CVI_MPY1] means:
           (SLOT2 OR SLOT3) AND (CVI_MPY0 OR CVI_MPY1)

  - added support for combo resources
    - allows specifying ORs of ANDs
    - e.g. [CVI_XLSHF, CVI_MPY01] means:
           (CVI_XLANE AND CVI_SHIFT) OR (CVI_MPY0 AND CVI_MPY1)

  - increased DFA input size from 32-bit to 64-bit
    - allows for a maximum of 4 AND'ed terms of 16 resources

  - supported expressions now include:

    expression     => term [AND term] [AND term] [AND term]
    term           => resource [OR resource]*
    resource       => one_resource | combo_resource
    combo_resource => (one_resource [AND one_resource]*)

Author: Dan Palermo <dpalermo@codeaurora.org>

kparzysz: Verified AMDGPU codegen to be unchanged on all llc
tests, except those dealing with instruction encodings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253790 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-21 17:23:52 +00:00
Krzysztof Parzyszek
177d040724 [Hexagon] Fix the return value from HexagonGenInsert::runOnMachineFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253705 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20 20:46:23 +00:00
Tilmann Scheller
72bf3d33aa [Hexagon] Remove redundant assignment.
Identified by the Clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20 13:27:30 +00:00
Tilmann Scheller
cf042f85d3 [Hexagon] Remove redundant local variable.
Identified by the Clang static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253660 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-20 12:10:17 +00:00
Craig Topper
766278ea84 Replace dyn_cast with isa in places that weren't using the returned value for more than a boolean check. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253441 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 07:07:59 +00:00
Rafael Espindola
cfc74b78b1 Stop producing .data.rel sections.
If a section is rw, it is irrelevant if the dynamic linker will write to
it or not.

It looks like llvm implemented this because gcc was doing it. It looks
like gcc implemented this in the hope that it would put all the
relocated items close together and speed up the dynamic linker.

There are two problem with this:
* It doesn't work. Both bfd and gold will map .data.rel to .data and
  concatenate the input sections in the order they are seen.
* If we want a feature like that, it can be implemented directly in the
  linker since it knowns where the dynamic relocations are.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253436 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-18 06:02:15 +00:00
Akira Hatanaka
55c0268714 Reduce the size of MCRelaxableFragment.
MCRelaxableFragment previously kept a copy of MCSubtargetInfo and
MCInst to enable re-encoding the MCInst later during relaxation. A copy
of MCSubtargetInfo (instead of a reference or pointer) was needed
because the feature bits could be modified by the parser.

This commit replaces the MCSubtargetInfo copy in MCRelaxableFragment
with a constant reference to MCSubtargetInfo. The copies of
MCSubtargetInfo are kept in MCContext, and the target parsers are now
responsible for asking MCContext to provide a copy whenever the feature
bits of MCSubtargetInfo have to be toggled.
 
With this patch, I saw a 4% reduction in peak memory usage when I
compiled verify-uselistorder.lto.bc using llc.

rdar://problem/21736951

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253127 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-14 06:35:56 +00:00
Akira Hatanaka
ff528b6f03 [MCTargetAsmParser] Move the member varialbes that reference
MCSubtargetInfo in the subclasses into MCTargetAsmParser and define a
member function getSTI.

This is done in preparation for making changes to shrink the size of
MCRelaxableFragment. (see http://reviews.llvm.org/D14346).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253124 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-14 05:20:05 +00:00
Colin LeMahieu
3b47b1f0e2 [Hexagon] Fixing memory leak during relaxation by allocating MCInst in MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253090 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 21:45:50 +00:00
Colin LeMahieu
6de64e032f [Hexagon] Factoring bundle creation in to a utility function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 17:42:46 +00:00
Colin LeMahieu
e78416caa5 [Hexagon] Fixing leak in padEndloop by allocating in MCContext.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253019 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 07:58:06 +00:00
Colin LeMahieu
e1fbc7e8ba [Hexagon] Adding relaxation functionality to backend and test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-13 01:12:25 +00:00
Benjamin Kramer
667c2c29cf [Hexagon] Allocate MCInst in the MCContext to avoid leaking it.
Found by leaksanitizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12 19:30:40 +00:00
Colin LeMahieu
a19450f7b9 [Hexagon] Adding instruction aliases and tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252579 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 01:58:26 +00:00
Colin LeMahieu
e9d8d5bb25 [Hexagon] Fixing compound register printing and reenabling more tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252574 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 00:51:56 +00:00
Colin LeMahieu
a7f0a0a566 [Hexagon] Fixing store instructions and reenabling a few more tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252561 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 00:22:00 +00:00
Colin LeMahieu
5ca8076fcc [Hexagon] Fixing load instruction parsing and reenabling tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252555 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-10 00:02:27 +00:00
Colin LeMahieu
7fcebdc82b [Hexagon] Separating statement to match what clang-format would do.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252513 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 21:06:28 +00:00
Reid Kleckner
c04d564033 [Hexagon] Fix -Wmicrosoft-enum-value warning with explicit enum type
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252505 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 19:44:38 +00:00
Colin LeMahieu
a9275b1c24 [Hexagon] Adding override to methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252453 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 07:10:24 +00:00
Colin LeMahieu
e729adbfcd [Hexagon] Fixing warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252448 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 05:47:56 +00:00
Colin LeMahieu
24a89ad9eb [Hexagon] Removing extra gen line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252447 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 05:31:39 +00:00
Colin LeMahieu
19f12a43a3 [Hexagon] Maybe the makefile?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252446 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 05:16:08 +00:00
Colin LeMahieu
35536b9c03 [Hexagon] Adding LLVMBuild.txt reference to HexagonAsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252444 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 04:31:02 +00:00
Colin LeMahieu
c0aef701cc [Hexagon] Enabling ASM parsing on Hexagon backend and adding instruction parsing tests. General updating of the code emission.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252443 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-09 04:07:48 +00:00
Joseph Tremoulet
de9bf0f80e [WinEH] Update exception pointer registers
Summary:
The CLR's personality routine passes these in rdx/edx, not rax/eax.

Make getExceptionPointerRegister a virtual method parameterized by
personality function to allow making this distinction.

Similarly make getExceptionSelectorRegister a virtual method parameterized
by personality function, for symmetry.


Reviewers: pgavlin, majnemer, rnk

Subscribers: jyknight, dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252383 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-07 01:11:31 +00:00
Duncan P. N. Exon Smith
5013c51dfc ADT: Remove last implicit ilist iterator conversions, NFC
Some implicit ilist iterator conversions have crept back into Analysis,
Transforms, Hexagon, and llvm-stress.  This removes them.

I'll commit a patch immediately after this to disallow them (in a
separate patch so that it's easy to revert if necessary).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252371 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-07 00:01:16 +00:00
Matthias Braun
e5065bdcd7 Fix build problme introduced in r251883
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251888 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 02:19:07 +00:00
Colin LeMahieu
b939021544 [Hexagon] Fixing mistaken case fallthrough.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-03 00:21:19 +00:00
Benjamin Kramer
52482cc241 Put global classes into the appropriate namespace.
Most of the cases belong into an anonymous namespace. No
functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251515 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-28 13:54:36 +00:00
Oleg Ranevskyy
cd69ab5ddf Test commit: fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251122 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-23 17:10:44 +00:00
Krzysztof Parzyszek
c75a253689 [Hexagon] Bit-based instruction simplification
Analyze bit patterns of operands and values of instructions to perform
various simplifications, dead/redundant code elimination, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250868 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 22:57:13 +00:00
Krzysztof Parzyszek
84aa3b5def [Hexagon] Fix isNVStorable flag in .td files
An upper half and a double word cannot be used as value sources in a
new-value store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250867 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 22:40:57 +00:00
Krzysztof Parzyszek
4465351205 [Hexagon] Capture aggregate variables by reference, not value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250851 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 19:33:46 +00:00
Krzysztof Parzyszek
014b76cd0f [Hexagon] Do not fall-through if there is no CFG edge
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250850 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 19:30:21 +00:00
Krzysztof Parzyszek
cdc93cb36f [Hexagon] Use symbolic name for subregister instead of hardcoded number
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250849 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 19:26:36 +00:00
Krzysztof Parzyszek
e7b5e3c89d [Hexagon] Change Based->Base in getBasedWithImmOffset
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 19:21:05 +00:00
Krzysztof Parzyszek
1f2d4d356d [Hexagon] Remove the remnants of isConstExtProfitable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250845 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 19:04:53 +00:00
Duncan P. N. Exon Smith
8525f3a7bc Hexagon: Remove implicit ilist iterator conversions, NFC
There are two things out of the ordinary in this commit.  First, I made
a loop obviously "infinite" in HexagonInstrInfo.cpp.  After checking if
an instruction was at the beginning of a basic block (in which case,
`break`), the loop decremented and checked the iterator for `nullptr` as
the loop condition.  This has never been possible (the prev pointers are
always been circular, so even with the weird ilist/iplist
implementation, this isn't been possible), so I removed the condition.

Second, in HexagonAsmPrinter.cpp there was another case of comparing a
`MachineBasicBlock::instr_iterator` against `MachineBasicBlock::end()`
(which returns `MachineBasicBlock::iterator`).  While not incorrect,
it's fragile.  I switched this to `::instr_end()`.

All that said, no functionality change intended here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250778 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-20 00:46:39 +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
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
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
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
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
Colin LeMahieu
b4b2bb0a0f [Hexagon] Adding skeleton of HVX extension instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250600 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-17 01:33:04 +00:00
Krzysztof Parzyszek
9bad2f04b3 [Hexagon] Split double registers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250549 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 20:38:54 +00:00
Krzysztof Parzyszek
477d91f460 [Hexagon] Delete lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250543 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 19:51:53 +00:00
Krzysztof Parzyszek
466f9e2f0c [Hexagon] Merge adjacent stores
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250542 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-16 19:43:56 +00:00