1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
Commit Graph

154524 Commits

Author SHA1 Message Date
Sanjay Patel
969c9899ca [x86] remove unnecessary OS specifier from test
llvm-svn: 313986
2017-09-22 14:38:57 +00:00
Sanjay Patel
91c9495a15 [x86] auto-generate complete checks; NFC
llvm-svn: 313985
2017-09-22 14:30:52 +00:00
Sanjay Patel
fd9b40afc1 [x86] update test to use FileCheck; NFC
llvm-svn: 313984
2017-09-22 14:29:47 +00:00
Simon Pilgrim
0a1c4b0914 [TableGen] Return StringRef from ValueTypeByHwMode::getMVTName
Avoid unnecessary std::string creations during TypeSetByHwMode::writeToStream.

Found during investigations into PR28222

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

llvm-svn: 313983
2017-09-22 13:32:26 +00:00
Alexander Ivchenko
98ceac3d19 [X86] Combining CMOVs with [ANY,SIGN,ZERO]_EXTEND for cases where CMOV has constant arguments
Combine CMOV[i16]<-[SIGN,ZERO,ANY]_EXTEND to [i32,i64] into CMOV[i32,i64].
One example of where it is useful is:

before (20 bytes)
    <foo>:
    test $0x1,%dil
    mov $0x307e,%ax
    mov $0xffff,%cx
    cmovne %ax,%cx
    movzwl %cx,%eax
    retq

after (18 bytes)
    <foo>:
    test $0x1,%dil
    mov $0x307e,%ecx
    mov $0xffff,%eax
    cmovne %ecx,%eax
    retq

Reviewers: craig.topper, aaboud, spatel, RKSimon, zvi

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 313982
2017-09-22 13:21:39 +00:00
Artur Pilipenko
f5935363ed Rework loop predication pass
We've found a serious issue with the current implementation of loop predication.
The current implementation relies on SCEV and this turned out to be problematic.
To fix the problem we had to rework the pass substantially. We have had the
reworked implementation in our downstream tree for a while. This is the initial
patch of the series of changes to upstream the new implementation.

For now the transformation is limited to the following case:
  * The loop has a single latch with either ult or slt icmp condition.
  * The step of the IV used in the latch condition is 1.
  * The IV of the latch condition is the same as the post increment IV of the guard condition.
  * The guard condition is ult.

See the review or the LoopPredication.cpp header for the details about the
problem and the new implementation.

Reviewed By: sanjoy, mkazantsev

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

llvm-svn: 313981
2017-09-22 13:13:57 +00:00
Nemanja Ivanovic
5ddd46e658 Remove the default clause from a fully-covering switch
to appease bots that use a compiler that warns about this
and use -Werror.

llvm-svn: 313980
2017-09-22 12:26:00 +00:00
Andre Vieira
8baad01fa3 [ARM] Fix assembly and disassembly for VMRS/VMSR
Reviewed by: t.p.northover
Differential Revision: https://reviews.llvm.org/D36306

llvm-svn: 313979
2017-09-22 12:17:42 +00:00
Nemanja Ivanovic
edbeed1075 Recommit r310809 with a fix for the spill problem
This patch re-commits the patch that was pulled out due to a
problem it caused, but with a fix for the problem. The fix
was reviewed separately by Eric Christopher and Hal Finkel.

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

llvm-svn: 313978
2017-09-22 11:50:25 +00:00
Simon Pilgrim
cf31bae691 [ARM] Add missing selection patterns for vnmla
For the following function:

  double fn1(double d0, double d1, double d2) {
    double a = -d0 - d1 * d2;
    return a;
  }

on ARM, LLVM generates code along the lines of

  vneg.f64  d0, d0
  vmls.f64  d0, d1, d2

i.e., a negate and a multiply-subtract.

The attached patch adds instruction selection patterns to allow it to generate the single instruction

  vnmla.f64  d0, d1, d2

(multiply-add with negation) instead, like GCC does.

Committed on behalf of @gergo- (Gergö Barany)

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

llvm-svn: 313972
2017-09-22 09:50:52 +00:00
Jonas Devlieghere
004d6f480d [dwarfdump] Fix ambiguous call to make_unique
Fix buildbot failures:
 - http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc2015/builds/13153
 - http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/13566

llvm-svn: 313971
2017-09-22 09:38:52 +00:00
Alexander Richardson
0b11825136 [obj2yaml] Don't crash for input files without symbol table
Summary: Previously we would dereference Symtab without checking for null.

Reviewers: davide, atanasyan, rafael

Reviewed By: davide, atanasyan

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

llvm-svn: 313970
2017-09-22 09:30:40 +00:00
Jonas Devlieghere
25e539c814 [dwarfdump] Add support for redirecting output to a file
This patch adds the -o and --out-file options for compatibility with
Darwin's dwarfdump.

Differential revision: https://reviews.llvm.org/D38125

llvm-svn: 313969
2017-09-22 09:20:57 +00:00
Alexander Richardson
4003ecf461 [mips] clang-format MipsTargetMachine.cpp
This is my test commit as it only changes two lines

llvm-svn: 313968
2017-09-22 08:52:03 +00:00
Dylan McKay
c0cd67dd25 [AVR] Remove the 'IsN64' argument to 'MCELFObjectWriter'
This has since been removed.

llvm-svn: 313965
2017-09-22 06:32:23 +00:00
Jatin Bhateja
426c363521 [X86] Updating the test case for FMF propagation.
Differential Revision: https://reviews.llvm.org/D38163

llvm-svn: 313964
2017-09-22 05:48:20 +00:00
Yonghong Song
fb1a6e5e60 bpf: initial 32-bit ALU encoding support in assembler
This patch adds instruction patterns for operations in BPF_ALU. After this,
assembler could recognize some 32-bit ALU statement. For example, those listed
int the unit test file.

Separate MOV patterns are unnecessary as MOV is ALU operation that could reuse
ALU encoding infrastructure, this patch removed those redundant patterns.

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 313961
2017-09-22 04:36:36 +00:00
Yonghong Song
c00f228e84 bpf: add 32bit register set
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 313960
2017-09-22 04:36:35 +00:00
Yonghong Song
b655bb5721 bpf: refactor inst patterns with better inheritance
Arithmetic and jump instructions, load and store instructions are sharing
the same 8-bit code field encoding,

A better instruction pattern implemention could be the following inheritance
relationships, and each layer only encoding those fields which start to
diverse from that layer. This avoids some redundant code.

  InstBPF -> TYPE_ALU_JMP -> ALU/JMP
  InstBPF -> TYPE_LD_ST -> Load/Store

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 313959
2017-09-22 04:36:34 +00:00
Yonghong Song
e7fa849142 bpf: refactor inst patterns with more mnemonics
Currently, eBPF backend is using some constant directly in instruction patterns,
This patch replace them with mnemonics and removed some unnecessary temparary
variables.

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 313958
2017-09-22 04:36:32 +00:00
Saleem Abdulrasool
d1a0918ad2 AArch64: support SwiftCC properly on AAPCS64
The previous SwiftCC support for AAPCS64 was partially correct.  It
setup swiftself parameters in the proper register but failed to setup
swifterror in the correct register.  This would break compilation of
swift code for non-Darwin AAPCS64 conforming environments.

llvm-svn: 313956
2017-09-22 04:31:44 +00:00
Sanjoy Das
e733e91370 Rename markAsErased to erase, as pointed out in a previous review; NFC
llvm-svn: 313951
2017-09-22 01:47:41 +00:00
NAKAMURA Takumi
08d972ebce HexagonVectorLoopCarriedReuse.cpp: Apply LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]
llvm-svn: 313947
2017-09-22 01:01:33 +00:00
NAKAMURA Takumi
546de223aa Reformat.
llvm-svn: 313946
2017-09-22 01:01:31 +00:00
Richard Trieu
d0ffda4101 Fix unused variable warning.
Move function call into debug macro to suppress unused variable warning
in non-debug builds.

llvm-svn: 313942
2017-09-21 23:48:01 +00:00
Eugene Zelenko
d02286ecdf [CodeGen] Fix some Clang-tidy modernize-use-bool-literals and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 313941
2017-09-21 23:20:16 +00:00
Adrian Prantl
1a6ef90ed9 Fix a bug in a historic bitcode testcase.
llvm-svn: 313940
2017-09-21 23:14:55 +00:00
Adrian Prantl
89a6a62936 Fix a bug in a historic bitcode testcase. NFC.
llvm-svn: 313939
2017-09-21 23:14:52 +00:00
Rafael Espindola
f112256d3c Convert the archive writer to use Error.
This found one place in lld that was not checking the error.

llvm-svn: 313937
2017-09-21 23:13:36 +00:00
Pranav Bhandarkar
e00c8617dd [Hexagon] - Fix testcase for the HexagonVectorLoopCarriedReuse pass.
llvm-svn: 313936
2017-09-21 23:11:28 +00:00
Rafael Espindola
e117aeb67f Use raw_ostream in functions that don't need to seek. NFC.
llvm-svn: 313935
2017-09-21 23:06:23 +00:00
Rafael Espindola
d44f66dc70 Simplify the logic for truncating UID and GID. NFC.
llvm-svn: 313933
2017-09-21 23:00:55 +00:00
Rafael Espindola
8cabb93b47 Revert "Add a testfile that I missed in a previous commit that added HexagonVectorLoopCarriedReuse pass"
This reverts commit r313926.

It was failing in some bots.

llvm-svn: 313931
2017-09-21 22:57:43 +00:00
Zachary Turner
38d9180afe Resubmit "[lit] Refactor out some more common lit configuration code."
There were two issues, one Python 3 specific related to Unicode,
and another which is that the tool substitution for lld no longer
rejected matches where a / preceded the tool name.

llvm-svn: 313928
2017-09-21 22:16:40 +00:00
Pranav Bhandarkar
f67c033028 Add a testfile that I missed in a previous commit that
added HexagonVectorLoopCarriedReuse pass

llvm-svn: 313926
2017-09-21 21:52:24 +00:00
Pranav Bhandarkar
399d97fb12 Enable the reuse of values computed in a previous loop iteration.
This patch adds a pass that removes the computation of provably redundant
expressions that have been computed earlier in a previous iteration. It
relies on the use of PHIs to identify loop carried dependences.

This is scalar replacement for vector types.

llvm-svn: 313925
2017-09-21 21:48:23 +00:00
Zachary Turner
59fc9d7d39 Revert "[lit] Refactor out some more common lit configuration code."
This is breaking several bots.  I have enough information to
investigate, so I'm reverting to green until I get it figured
out.

llvm-svn: 313922
2017-09-21 21:45:45 +00:00
Kevin Enderby
63cb9b07be Fix a bug in llvm-objdump when disassembling using the wrong default CPU
in the second slice of a Mach-O universal file.

The code in llvm-objdump in in DisassembleMachO() was getting the default
CPU then incorrectly setting into the global variable used for the -mcpu option
if that was not set.  This caused a second call to DisassembleMachO() to use
the wrong default CPU when disassembling the next slice in a Mach-O universal
file.  And would result in bad disassembly and an error message about an
recognized processor for the target:

% llvm-objdump -d -m -arch all  fat.macho-armv7s-arm64 
fat.macho-armv7s-arm64 (architecture armv7s):
(__TEXT,__text) section
armv7:
       0:	60 47 	bx	r12
fat.macho-armv7s-arm64 (architecture arm64):
'cortex-a7' is not a recognized processor for this target (ignoring processor)
'cortex-a7' is not a recognized processor for this target (ignoring processor)
(__TEXT,__text) section
___multc3:
       0:		.long	0x1e620810

rdar://34439149

llvm-svn: 313921
2017-09-21 21:45:02 +00:00
Zachary Turner
ff689f377b [lit] Refactor out some more common lit configuration code.
debuginfo-tests has need to reuse a lot of common configuration
from clang and lld, and in general it seems like all of the
projects which are tightly coupled (e.g. lld, clang, llvm, lldb,
etc) can benefit from knowing about one other.  For example,
lldb needs to know various things about how to run clang in its
test suite.  Since there's a lot of common substitutions and
operations that need to be shared among projects, sinking this
up into LLVM makes sense.

In addition, this patch introduces a function add_tool_substitution
which handles all the dirty intricacies of matching tool names
which was previously copied around the various config files.  This
is now a simple straightforward interface which is hard to mess
up.

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

llvm-svn: 313919
2017-09-21 21:27:31 +00:00
Zachary Turner
1e564b48a1 [lit] Actually do normalize the case of files in the config map.
This has gone back and forth, but it seems this is necessary
after all.  realpath is not sufficient because if you have a
file named 'C:\foo.txt', then both realpath('c:\foo.txt') and
realpath(C:\foo.txt') return the string that was passed to them
exactly as is, meaning the case of the drive-letter won't match.

The problem before was not that we were normalizing the case of
items going into the config map, but rather that we were
normalizing the case of something we needed to print.  The value
that is used to key on the config map should never be printed.

llvm-svn: 313918
2017-09-21 21:27:11 +00:00
Geoff Berry
a649dfc42e [AArch64] Fix bug in store of vector 0 DAGCombine.
Summary:
Avoid using XZR/WZR directly as operands to split stores of zero
vectors.  Doing so can lead to the XZR/WZR being used by an instruction
that doesn't allow it (e.g. add).

Fixes bug 34674.

Reviewers: t.p.northover, efriedma, MatzeB

Subscribers: aemerson, rengolin, javed.absar, mcrosier, eraman, llvm-commits, kristof.beyls

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

llvm-svn: 313916
2017-09-21 21:10:06 +00:00
Marek Sokolowski
a5b6a9fded [llvm-readobj] Fix big-endian byte swap in WindowsResourceDumper.
The previous version of dumper implemented UTF-16 byte swap incorrectly
on big-endian machines. This now gets fixed.

Thanks to Bill Seurer for testing the patch locally.

Differential Review: https://reviews.llvm.org/D38150

llvm-svn: 313912
2017-09-21 20:36:38 +00:00
Jonas Devlieghere
becf1e3bbf [dwarfdump] Add verbose output for .debug-line section
This patch adds dumping of line table instructions as well as the final
state at each specified pc value in verbose mode. This is essentially
the same as the default in Darwin's dwarfdump. Dumping the actual line
table opcodes can be particularly useful for something like debugging a
bad `.debug_line` section.

Differential revision: https://reviews.llvm.org/D37971

llvm-svn: 313910
2017-09-21 20:15:30 +00:00
Craig Topper
691299ee64 [DAGCombiner] Slightly simplify some code by using APInt::isMask() and countTrailingOnes instead of getting active bits and checking if all the bits below that make a mask.
At least for the 64-bit and less case, we should be able to determine if we even have a mask without counting any bits. This also removes the need to explicitly check for 0 active bits, isMask will return false for 0.

llvm-svn: 313908
2017-09-21 20:12:19 +00:00
Reid Kleckner
b408a0c51d Re-land r313825: "[IR] Add llvm.dbg.addr, a control-dependent version of llvm.dbg.declare"
The fix is to avoid invalidating our insertion point in
replaceDbgDeclare:
     Builder.insertDeclare(NewAddress, DIVar, DIExpr, Loc, InsertBefore);
+    if (DII == InsertBefore)
+      InsertBefore = &*std::next(InsertBefore->getIterator());
     DII->eraseFromParent();

I had to write a unit tests for this instead of a lit test because the
use list order matters in order to trigger the bug.

The reduced C test case for this was:
  void useit(int*);
  static inline void inlineme() {
    int x[2];
    useit(x);
  }
  void f() {
    inlineme();
    inlineme();
  }

llvm-svn: 313905
2017-09-21 19:52:03 +00:00
Bjorn Pettersson
97ae88f12f [SelectionDAG] Pick correct frame index in LowerArguments
Summary:
SelectionDAGISel::LowerArguments is associating arguments
with frame indices (FuncInfo->setArgumentFrameIndex). That
information is later on used by EmitFuncArgumentDbgValue to
create DBG_VALUE instructions that denotes that a variable
can be found on the stack.

I discovered that for our (big endian) out-of-tree target
the association created by SelectionDAGISel::LowerArguments
sometimes is wrong. I've seen this happen when a 64-bit value
is passed on the stack. The argument will occupy two stack
slots (frame index X, and frame index X+1). The fault is
that a call to setArgumentFrameIndex is associating the
64-bit argument with frame index X+1. The effect is that the
debug information (DBG_VALUE) will point at the least significant
part of the arguement on the stack. When printing the
argument in a debugger I will get the wrong value.

I managed to create a test case for PowerPC that seems to
show the same kind of problem.

The bugfix will look at the datalayout, taking endianness into
account when examining a BUILD_PAIR node, assuming that the
least significant part is in the first operand of the BUILD_PAIR.
For big endian targets we should use the frame index from
the second operand, as the most significant part will be stored
at the lower address (using the highest frame index).

Reviewers: bogner, rnk, hfinkel, sdardis, aprantl

Reviewed By: aprantl

Subscribers: nemanjai, aprantl, llvm-commits, igorb

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

llvm-svn: 313901
2017-09-21 18:52:08 +00:00
Adrian Prantl
520bbabe3d llvm-dwarfdump support --debug-frame=<offset> and --eh-frame=<offset>
llvm-svn: 313900
2017-09-21 18:52:03 +00:00
Artem Belevich
93d70564c9 [NVPTX] Implemented bar.warp.sync, barrier.sync, and vote{.sync} instructions/intrinsics/builtins.
Differential Revision: https://reviews.llvm.org/D38148

llvm-svn: 313898
2017-09-21 18:44:49 +00:00
Rafael Espindola
999461a0e4 Use ArrayRef. NFC.
llvm-svn: 313895
2017-09-21 17:51:07 +00:00
Sanjay Patel
ce603e3652 [x86] add more tests for node-level FMF; NFC
llvm-svn: 313893
2017-09-21 17:40:58 +00:00