197 Commits

Author SHA1 Message Date
Krzysztof Parzyszek
3f339ad775 [Hexagon] Properly handle 'q' constraint in 128-byte vector mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296772 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-02 17:50:24 +00:00
Krzysztof Parzyszek
0d19bb2cca [Hexagon] Fix lowering of formal arguments of type i1
On Hexagon, values of type i1 are passed in registers of type i32,
even though i1 is not a legal value for these registers. This is a
special case and needs special handling to maintain consistency of
the lowering information.

This fixes PR32089.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296645 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-01 17:30:10 +00:00
Krzysztof Parzyszek
69d8d82e3c [Hexagon] Patterns for CTPOP, BSWAP and BITREVERSE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295981 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 15:02:09 +00:00
Krzysztof Parzyszek
e9d7ca1b92 [Hexagon] Implement @llvm.readcyclecounter()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295892 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-22 22:28:47 +00:00
Krzysztof Parzyszek
eee70a1f65 [Hexagon] Start using regmasks on calls
Reapply r295371 with a fix for the Windows bot failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 22:14:51 +00:00
Rafael Espindola
675c18fef3 Revert "[Hexagon] Start using regmasks on calls"
This reverts commit r295371.

It broke windows bots:

http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/11402/steps/test-llvm/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295402 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 02:08:58 +00:00
Krzysztof Parzyszek
075abc4ae8 [Hexagon] Start using regmasks on calls
All the cool targets are doing it...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295371 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-16 20:25:23 +00:00
Eugene Zelenko
d24b18f667 [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290024 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-17 01:09:05 +00:00
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
8509ed8689 [Hexagon] Relocate pattern-related bits to proper places
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286049 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-05 21:44:50 +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
Peter Collingbourne
80e2a2f817 Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject.
These functions are about classifying a global which will actually be
emitted, so it does not make sense for them to take a GlobalValue which may
for example be an alias.

Change the Mach-O object writer and the Hexagon, Lanai and MIPS backends to
look through aliases before using TargetLoweringObjectFile interfaces. These
are functional changes but all appear to be bug fixes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285006 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-24 19:23:39 +00:00
Reid Kleckner
3a3c5c8815 Use __func__ directly now that all supported compilers support it
Remove the portability macro now that it is unused.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-20 00:22:23 +00:00
Sanjay Patel
c0a42ffc17 getVectorElementType().getSizeInBits() -> getScalarSizeInBits() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 16:37:15 +00:00
Sanjay Patel
a7c48ccd3f getValueType().getSizeInBits() -> getValueSizeInBits() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14 16:05:51 +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
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
23d2b8b052 [Hexagon] Fix subesthetic indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 19:29:15 +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
35e408df06 [Hexagon] Do not cache alloca instructions during isel
They can be deleted or replicated, so the cache may become outdated.
They only need to be visited once during frame lowering, so just scan
the function instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19 18:46:13 +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
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
Michael Kuperstein
175a34b53e [SelectionDAG] Rename fextend -> fpextend, fround -> fpround, frnd -> fround
The names of the tablegen defs now match the names of the ISD nodes.
This makes the world a slightly saner place, as previously "fround" matched
ISD::FP_ROUND and not ISD::FROUND.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279129 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 20:08:15 +00:00
Krzysztof Parzyszek
d179884eca [Hexagon] Standardize next batch of pseudo instructions
ALIGNA          PS_aligna
ALLOCA          PS_alloca
TFR_FI          PS_fi
TFR_FIA         PS_fia
TFR_PdFalse     PS_false
TFR_PdTrue      PS_true
VMULW           PS_vmulw
VMULW_ACC       PS_vmulw_acc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16 18:08:40 +00:00
Ron Lieberman
26d2a23314 Fix unsupported relocation type R_HEX_6_X' for symbol .rodata
LowerTargetConstantPool is not properly setting the TargetFlag to indicate
desired relocation. Coding error, the offset parameter was omitted, so the
TargetFlag was used as the offset, and the TargetFlag defaulted to zero.

This only affects -fpic compilation, and only those items created in a
Constant Pool, for example a vector of constants. Halide ran into this issue.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278614 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:41:11 +00:00
Krzysztof Parzyszek
4502b2e1ab [Hexagon] Standardize pseudo-instructions for calls and returns
- CALLv3nr        PS_call_nr
- CALLRv3nr       PS_callr_nr
- CALLstk         PS_call_stk

- TCRETURNi       PS_tailcall_i
- TCRETURNr       PS_tailcall_r

- JMPret          PS_jmpret
- JMPrett         PS_jmprett
- JMPretf         PS_jmpretf
- JMPrettnew      PS_jmprettnew
- JMPretfnew      PS_jmpretfnew
- JMPrettnewpt    PS_jmprettnewpt
- JMPretfnewpt    PS_jmpretfnewpt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 11:12:02 +00:00
Krzysztof Parzyszek
e9a09933ef [Hexagon] Remove unneeded/unused ISD opcodes ARGEXTEND and FCONST32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 16:20:33 +00:00
Krzysztof Parzyszek
e19c2467cc [Hexagon] Add pattern for 64-bit mulhs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278040 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 19:24:25 +00:00
Krzysztof Parzyszek
c3332e48f0 [Hexagon] Do not check alignment for unsized types in isLegalAddressingMode
When the same base address is used to load two different data types, LSR
would assume a memory type of "void". This type is not sized and has no
alignment information. Checking for it causes a crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-03 15:06:18 +00:00
Krzysztof Parzyszek
a4e94ebbb2 [Hexagon] Improvements to address mode checks in TargetLowering
- Implement getOptimalMemOpType.
- Check BaseOffset in isLegalAddressingMode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277494 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-02 18:34:31 +00:00
Krzysztof Parzyszek
9296f21a70 [Hexagon] Tidy up some code, NFC: reapply r277372 with a fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 20:31:50 +00:00
Krzysztof Parzyszek
71a7b1e6dc Revert r277372, it is causing buildbot failures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 20:00:33 +00:00
Krzysztof Parzyszek
d7943136ad [Hexagon] Tidy up some code, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277372 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 19:46:21 +00:00
Krzysztof Parzyszek
227b764c52 Revert r277178, the actual change had already been applied
Will submit another patch with the testcase only.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:50:47 +00:00
Krzysztof Parzyszek
36b1b46f1c [Hexagon] Misaligned loads and stores are not fast
The DAG combiner tries to merge stores to adjacent vector wide memory
locations by creating stores which are integral multiples of the vector
width. Discourage this by informing it that this is slow. This should
not affect legalization passes, because all of them ignore the "Fast"
argument.

Patch by Pranav Bhandarkar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 17:45:16 +00:00
Krzysztof Parzyszek
a6ad276d07 [Hexagon] Custom lower VECTOR_SHUFFLE and EXTRACT_SUBVECTOR for HVX
If the mask of a vector shuffle has alternating odd or even numbers
starting with 1 or 0 respectively up to the largest possible index
for the given type in the given HVX mode (single of double) we can
generate vpacko or vpacke instruction respectively.

E.g.
  %42 = shufflevector <32 x i16> %37, <32 x i16> %41,
                      <32 x i32> <i32 1, i32 3, ..., i32 63>
  is %42.h = vpacko(%41.w, %37.w)

Patch by Pranav Bhandarkar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-29 16:44:27 +00:00
Matthias Braun
f79c57a412 MachineFunction: Return reference for getFrameInfo(); NFC
getFrameInfo() never returns nullptr so we should use a reference
instead of a pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-28 18:40:00 +00:00
Krzysztof Parzyszek
43492b2a7a [Hexagon] Post-increment loads/stores enhancements
- Generate vector post-increment stores more aggressively.
- Predicate post-increment and vector stores in early if-conversion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276800 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-26 20:30:30 +00:00
Krzysztof Parzyszek
94d45176f8 [Hexagon] Add target feature to generate long calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@276638 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-25 14:42:11 +00:00
Krzysztof Parzyszek
44217e1169 [Hexagon] Handle returning small structures by value
This is not compliant with the official ABI, but allows experimentation
with calling conventions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275825 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 17:36:46 +00:00
Krzysztof Parzyszek
b3b8a5a691 [Hexagon] Revert r275822: mistake in commit message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275824 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 17:34:49 +00:00
Krzysztof Parzyszek
4cb51c5c01 [Hexagon] Handle returning small structures by value
This is compliant with the official ABI, but allows experimentation with
calling conventions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275822 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 17:30:41 +00:00
Justin Lebar
b2d6ad7cfd [SelectionDAG] Get rid of bool parameters in SelectionDAG::getLoad, getStore, and friends.
Summary:
Instead, we take a single flags arg (a bitset).

Also add a default 0 alignment, and change the order of arguments so the
alignment comes before the flags.

This greatly simplifies many callsites, and fixes a bug in
AMDGPUISelLowering, wherein the order of the args to getLoad was
inverted.  It also greatly simplifies the process of adding another flag
to getLoad.

Reviewers: chandlerc, tstellarAMD

Subscribers: jholewinski, arsenm, jyknight, dsanders, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 18:27:10 +00:00
Duncan P. N. Exon Smith
a204da23db CodeGen: Use MachineInstr& in TargetLowering, NFC
This is a mechanical change to make TargetLowering API take MachineInstr&
(instead of MachineInstr*), since the argument is expected to be a valid
MachineInstr.  In one case, changed a parameter from MachineInstr* to
MachineBasicBlock::iterator, since it was used as an insertion point.

As a side effect, this removes a bunch of MachineInstr* to
MachineBasicBlock::iterator implicit conversions, a necessary step
toward fixing PR26753.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 22:52:52 +00:00
Rafael Espindola
809018e56e Delete unused includes. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-30 12:19:16 +00:00
Rafael Espindola
d980ed0d00 Move shouldAssumeDSOLocal to Target.
Should fix the shared library build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-27 23:15:57 +00:00
Rafael Espindola
608ab75c0b Use isPositionIndependent predicate. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273827 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-26 22:24:01 +00:00
Nirav Dave
218e5843a6 Preserve DebugInfo when replacing values in DAGCombiner
Recommiting after correcting over-eager Debug Value transfer fixing PR28270.

[DAG] Previously debug values would transfer debuginfo for the selected
start node for a replacement which allows for debug to be dropped.

Push debug value transfer to occur with node/value replacement in
SelectionDAG, remove now extraneous transfers of debug values.

This refixes PR9817 which was being incompletely checked in the
testsuite.

Reviewers: jyknight

Subscribers: dblaikie, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-23 17:52:57 +00:00
Peter Collingbourne
7cbcee7cad Revert r273456, "Preserve DebugInfo when replacing values in DAGCombiner" as it caused pr28270.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-23 00:06:17 +00:00
Rafael Espindola
5e5a33df9e Start using shouldAssumeDSOLocal on Hexagon.
Include a token test showing that access to private is now the same as
to internal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273457 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-22 19:09:14 +00:00