1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

148470 Commits

Author SHA1 Message Date
Craig Topper
b6f26d8003 [APInt] Reduce number of allocations involved in multiplying. Reduce worst case multiply size
Currently multiply is implemented in operator*=. Operator* makes a copy and uses operator*= to modify the copy.

Operator*= itself allocates a temporary buffer to hold the multiply result as it computes it. Then copies it to the buffer in *this.

Operator*= attempts to bound the size of the result based on the number of active bits in its inputs. It also has a couple special cases to handle 0 inputs without any memory allocations or multiply operations. The best case is that it calculates a single word regardless of input bit width. The worst case is that it calculates the a 2x input width result and drop the upper bits.

Since operator* uses operator*= it incurs two allocations, one for a copy of *this and one for the temporary allocation. Neither of these allocations are kept after the method operation is done.

The main usage in the backend appears to be ConstantRange::multiply which uses operator* rather than operator*=.

This patch moves the multiply operation to operator* and implements operator*= using it. This avoids the copy in operator*. operator* now allocates a result buffer sized the same width as its inputs no matter what. This buffer will be used as the buffer for the returned APInt. Finally, we reuse tcMultiply to implement the multiply operation. This function is capable of not calculating additional upper words that will be discarded.

This change does lose the special optimizations for the inputs using less words than their size implies. But it also removed the getActiveBits calls from all multiplies. If we think those optimizations are important we could look at providing additional bounds to tcMultiply to limit the computations.

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

llvm-svn: 302171
2017-05-04 17:00:41 +00:00
Easwaran Raman
dd305606e6 [PM] Add ProfileSummaryAnalysis as a required pass in the new pipeline.
Differential revision: https://reviews.llvm.org/D32768

llvm-svn: 302170
2017-05-04 16:58:45 +00:00
Brian Gesiak
23bdd90743 [Lexicon] Add BDCE
Summary: Add an entry to the Lexicon for "BDCE."

Reviewers: jmolloy, hfinkel

Reviewed By: jmolloy

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

llvm-svn: 302169
2017-05-04 16:50:37 +00:00
Adrian Prantl
e999d084c2 Add accidentally deleted testcase back.
llvm-svn: 302167
2017-05-04 16:26:07 +00:00
Adrian Prantl
6fa10ba7f6 Cleanup tests to not share a DISubprogram between multiple Functions.
rdar://problem/31926379

llvm-svn: 302166
2017-05-04 16:24:31 +00:00
Renato Golin
cdce695226 [test-release] Status update *before* long gzip
llvm-svn: 302165
2017-05-04 16:21:30 +00:00
Daniel Sanders
7215d4496b [globalisel][tablegen] Add several GINodeEquiv's for operators that do not require additional support.
Summary:
As of this patch, 350 out of 3938 rules are currently imported.

Depends on D32229

Reviewers: qcolombet, kristof.beyls, rovka, t.p.northover, ab, aditya_nandakumar

Reviewed By: ab

Subscribers: dberris, llvm-commits, igorb

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

llvm-svn: 302154
2017-05-04 14:24:50 +00:00
Chad Rosier
1f7103004e [DAGCombine] Transform (fadd A, (fmul B, -2.0)) -> (fsub A, (fadd B, B)).
Differential Revision: http://reviews.llvm.org/D32596

llvm-svn: 302153
2017-05-04 14:14:44 +00:00
Simon Pilgrim
f720911efd [X86][AVX512] Fix VPABSD file checks
Fix capitalization and string matching

llvm-svn: 302150
2017-05-04 13:42:57 +00:00
Simon Pilgrim
4dbda31a5a [X86][SSE] Add i686 triple tests for partial vector and re-association
llvm-svn: 302149
2017-05-04 13:35:40 +00:00
Krzysztof Parzyszek
d697de4ed0 Refactoring with range-based for, NFC
Patch by Wei-Ren Chen.

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

llvm-svn: 302148
2017-05-04 13:35:17 +00:00
Jonas Paulsson
466bbd4878 [SystemZ] Make copyPhysReg() add impl-use operands of super reg.
When a 128 bit COPY is lowered into two instructions, an impl-use operand of
the super-reg should be added to each new instruction in case one of the
sub-regs is undefined.

Review: Ulrich Weigand
llvm-svn: 302146
2017-05-04 13:33:30 +00:00
Simon Pilgrim
924c731df4 [X86][SSE] Add i686 triple tests for PBLENDW commutation
llvm-svn: 302145
2017-05-04 13:08:09 +00:00
Simon Pilgrim
361796d942 [X86][AVX1] Regenerate checks and add i686 triple tests for folded logical ops
llvm-svn: 302144
2017-05-04 13:00:30 +00:00
Eric Liu
2212b01e87 Revert "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
This reverts commit r302108. This causes crash in clang bootstrap with LTO.

Contacted the auther in the original commit.

llvm-svn: 302140
2017-05-04 11:49:39 +00:00
Simon Dardis
fc989d07cb [mips][XRay] Use the base version of emitXRayTable
Follow up rL290858 by removing the MIPS specific version of XRayTable
emission in favour of the basic version.

This resolves a buildbot failure where the ELF sections were malformed
causing the linker to reject the object files with xray related sections.

Reviewers: dberris, slthakur

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

llvm-svn: 302138
2017-05-04 11:03:50 +00:00
Martin Storsjo
040345e44a [ArgPromotion] Fix a truncated variable
This fixes a regression since SVN rev 273808 (which was supposed to
not change functionality).

The regression caused miscompilations (noted in the wild when targeting
AArch64) on platforms with 32 bit long.

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

llvm-svn: 302137
2017-05-04 10:54:35 +00:00
Michael Zuckerman
49a4a4a7b6 [LLVM][inline-asm][Altmacor] Altmacro string delimiter '<..>'
In this patch, I introduce a new altmacro string delimiter. 
This review is the second review in a series of four reviews.
(one for each altmacro feature: LOCAL, string delimiter, string '!' escape sign and absolute expression as a string '%' ).

In the alternate macro mode, you can delimit strings with matching angle brackets <..> 
when using it as a part of calling macro arguments.

As described in the https://sourceware.org/binutils/docs-2.27/as/Altmacro.html
"<string>
You can delimit strings with matching angle brackets."

assumptions:

1. If an argument begins with '<' and ends with '>'. The argument is considered as a string.
2. Except adding new string mark '<..>', a regular macro behavior is expected.
3. The altmacro cannot affect the regular less/greater behavior.
4. If a comma is present inside an angle brackets it considered as a character and not as a separator.

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

llvm-svn: 302135
2017-05-04 10:37:00 +00:00
Igor Breger
e801f3e8fd [X86][AVX-512] Allow EVEX encoded instruction selection when available for mul v8i32.
Differential Revision: https://reviews.llvm.org/D32679

llvm-svn: 302127
2017-05-04 07:34:58 +00:00
Sam Parker
cf8da85cba [ARM] ACLE Chapter 9 intrinsics
Added the integer data processing intrinsics from ACLE v2.1 Chapter 9
but I have missed out the saturation_occurred intrinsics for now. For
the instructions that read and write the GE bits, a chain is included
and the only instruction that reads these flags (sel) is only
selectable via the implemented intrinsic.

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

llvm-svn: 302126
2017-05-04 07:31:28 +00:00
Oren Ben Simhon
3bc4b0f88f [X86] Disabling PLT in Regcall CC Functions
According to psABI, PLT stub clobbers XMM8-XMM15.
In Regcall calling convention those registers are used for passing parameters. 
Thus we need to prevent lazy binding in Regcall.

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

llvm-svn: 302124
2017-05-04 07:22:49 +00:00
Igor Breger
06092c7546 [AVX-512VL] Autogenerate checks. Add --show-mc-encoding to check instruction predicate.
llvm-svn: 302123
2017-05-04 06:53:31 +00:00
Igor Breger
77dfe10c58 [AVX] Fix vpcmpeqq predicate.
Summary:
Fix vpcmpeqq predicate. AVX512 version of vpcmpeqq is not equivalent to AVX one.
Split from https://reviews.llvm.org/D32679

Reviewers: craig.topper, zvi, aymanmus

Reviewed By: craig.topper

Subscribers: llvm-commits

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

llvm-svn: 302119
2017-05-04 06:24:52 +00:00
Jonas Paulsson
fd1a4ff9b5 Use right function in LoopVectorize.
-    unsigned AS = getMemInstAlignment(I);
+    unsigned AS = getMemInstAddressSpace(I);

Review: Hal Finkel
llvm-svn: 302114
2017-05-04 05:31:56 +00:00
Dean Michael Berris
689a03cc8e [XRay] Use wordsize-dependent alignment for index
This makes it simpler for the runtime to consistently handle the entries
in the function sled index in both 32 and 64 bit platforms where the
XRay runtime works.

Follow-up on D32693.

llvm-svn: 302111
2017-05-04 04:55:46 +00:00
Craig Topper
4b7478d60b [SelectionDAG] Improve known bits support for CTPOP.
This is based on the same concept from ValueTracking's version of computeKnownBits.

llvm-svn: 302110
2017-05-04 04:33:27 +00:00
Dean Michael Berris
dccae9fc98 [XRay] Create an Index of sleds per function
Summary:
This change adds a new section to the xray-instrumented binary that
stores an index into ranges of the instrumentation map, where sleds
associated with the same function can be accessed as an array. At
runtime, we can get access to this index by function ID offset allowing
for selective patching and unpatching by function ID.

Each entry in this new section (xray_fn_idx) will include two pointers
indicating the start and one past the end of the sleds associated with
the same function. These entries will be 16 bytes long on x86 and
aarch64. On arm, we align to 16 bytes anyway so the runtime has to take
that into consideration.

__{start,stop}_xray_fn_idx will be the symbols that the runtime will
look for when we implement the selective patching/unpatching by function
id APIs. Because XRay synthesizes the function id's in a monotonically
increasing manner at runtime now, implementations (and users) can use
this table to look up the sleds associated with a specific function.
This is useful in implementations that want to do things like:

  - Implement coverage mode for functions by patching everything
    pre-main, then as functions are encountered, the installed handler
    can unpatch the function that's been encountered after recording
    that it's been called.
  - Do "learning mode", so that the implementation can figure out some
    statistical information about function calls by function id for a
    time being, and then determine which functions are worth
    uninstrumenting at runtime.
  - Do "selective instrumentation" where an implementation can
    specifically instrument only certain function id's at runtime
    (either based on some external data, or through some other
    heuristics) instead of patching all the instrumented functions at
    runtime.

Reviewers: dblaikie, echristo, chandlerc, javed.absar

Subscribers: pelikan, aemerson, kpw, llvm-commits, rengolin

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

llvm-svn: 302109
2017-05-04 03:37:57 +00:00
Peter Collingbourne
7f61b8d620 IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI.
When profiling a no-op incremental link of Chromium I found that the functions
computeImportForFunction and computeDeadSymbols were consuming roughly 10% of
the profile. The goal of this change is to improve the performance of those
functions by changing the map lookups that they were previously doing into
pointer dereferences.

This is achieved by changing the ValueInfo data structure to be a pointer to
an element of the global value map owned by ModuleSummaryIndex, and changing
reference lists in the GlobalValueSummary to hold ValueInfos instead of GUIDs.
This means that a ValueInfo will take a client directly to the summary list
for a given GUID.

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

llvm-svn: 302108
2017-05-04 03:36:16 +00:00
NAKAMURA Takumi
58bd8e4ea6 llvm/IR/Function.h: Prune an obsolete @param in r302060. [-Wdocumentation]
llvm-svn: 302106
2017-05-04 02:01:18 +00:00
Dean Michael Berris
b1cadcf3df [XRay] Detect loops in functions being lowered
Summary:
This is an implementation of the loop detection logic that XRay needs to
determine whether a function might take time at runtime. Without this
heuristic, XRay will tend to not instrument short functions that have
loops that might have runtime dependent on inputs or external values.

While this implementation doesn't do any further analysis than just
figuring out whether there is a loop in the MachineFunction being
code-gen'ed, we're paving the way for being able to perform more
sophisticated analysis of the function in the future (for example to
determine whether the trip count for the loop might be constant, and
make a decision on that instead). This enables us to cover more
functions with the default heuristics, and potentially identify ones
that have variable runtime latency just by looking for the presence of
loops.

Reviewers: chandlerc, rnk, pelikan

Subscribers: llvm-commits

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

llvm-svn: 302103
2017-05-04 01:24:26 +00:00
Michael Zolotukhin
bf99505718 [SCEV] createAddRecFromPHI: Optimize for the most common case.
Summary:
The existing implementation creates a symbolic SCEV expression every
time we analyze a phi node and then has to remove it, when the analysis
is finished. This is very expensive, and in most of the cases it's also
unnecessary. According to the data I collected, ~60-70% of analyzed phi
nodes (measured on SPEC) have the following form:
  PN = phi(Start, OP(Self, Constant))
Handling such cases separately significantly speeds this up.

Reviewers: sanjoy, pete

Subscribers: llvm-commits

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

llvm-svn: 302096
2017-05-03 23:53:38 +00:00
Matthias Braun
1acbb7bdef strlen-1.ll: Fix test
Change test for `strlen(x) == 0 --> *x == 0` to actually test the
pattern.

llvm-svn: 302094
2017-05-03 23:32:51 +00:00
Craig Topper
f3dc55d476 [InstCombine][KnownBits] Use KnownBits better to detect nsw adds
Change checkRippleForAdd from a heuristic to a full check -
if it is provable that the add does not overflow return true, otherwise false.

Patch by Yoav Ben-Shalom

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

llvm-svn: 302093
2017-05-03 23:22:46 +00:00
Reid Kleckner
40f680ac82 Mark functions as not having CFI once we finalize an x86 stack frame
We'll set it back to true in emitPrologue if it gets called. It doesn't
get called for naked functions.

Fixes PR32912

llvm-svn: 302092
2017-05-03 23:13:42 +00:00
Craig Topper
30c0b3abf9 [KnownBits] Add methods for determining if KnownBits is a constant value
This patch adds isConstant and getConstant for determining if KnownBits represents a constant value and to retrieve the value. Use them to simplify code.

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

llvm-svn: 302091
2017-05-03 23:12:29 +00:00
Craig Topper
621facfb33 [ValueTracking] Remove handling for BitWidth being 0 in ComputeSignBit and isKnownNonZero.
I don't believe its possible to have non-zero values here since DataLayout became required. The APInt constructor inside of the KnownBits object will assert if this ever happens.

llvm-svn: 302089
2017-05-03 22:25:19 +00:00
Craig Topper
3ae9fc9012 [KnownBits] Add zext, sext, and trunc methods to KnownBits
This patch adds zext, sext, and trunc methods to KnownBits and uses them where possible.

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

llvm-svn: 302088
2017-05-03 22:07:25 +00:00
Sanjay Patel
69ead7788d [TargetLowering] use isSubsetOf in SimplifyDemandedBits; NFCI
This is the DAG equivalent of https://reviews.llvm.org/D32255 , 
which will hopefully be committed again. The functionality
(preferring a 'not' op) is already here in the DAG, so this is
just intended to be a clean-up and performance improvement.

llvm-svn: 302087
2017-05-03 21:55:34 +00:00
Paul Robinson
be58998140 clang-format and restyle DWARFFormValue before working on it. NFC
llvm-svn: 302086
2017-05-03 21:53:21 +00:00
Saleem Abdulrasool
2d3897cf6c DebugInfo: elide type index entries for synthetic types
Compiler emitted synthetic types may not have an associated DIFile
(translation unit).  In such a case, when generating CodeView debug type
information, we would attempt to compute an absolute filepath which
would result in a segfault due to a NULL DIFile*.  If there is no source
file associated with the type, elide the type index entry for the type
and record the type information.  This actually results in higher
fidelity debug information than clang/C2 as of this writing.

Resolves PR32668!

llvm-svn: 302085
2017-05-03 21:39:01 +00:00
Ahmed Bougacha
a59429f8b7 [AArch64] Fix variable name ambiguity in r302078.
ArchKind is passed to the function, but it's also a type.

llvm-svn: 302081
2017-05-03 20:51:34 +00:00
Xin Tong
7eecfcb175 [TailCallElim] Remove an unused argument. NFCI
llvm-svn: 302080
2017-05-03 20:37:07 +00:00
Ahmed Bougacha
64c0163225 [AArch64] Make the TargetParser add CPU exts provided by the arch.
Otherwise, each CPU has to manually specify the extensions it supports,
even though they have to be a superset of the base arch extensions.
And when there's redundant data there's stale data, so most of the CPUs
lie about the features they support (almost none lists AEK_FP).

Instead, do the saner thing: add the optional extensions on top of the
base extensions provided by the architecture.

The ARM TargetParser has the same behavior.

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

llvm-svn: 302078
2017-05-03 20:33:58 +00:00
Ahmed Bougacha
019ae7d515 [AArch64] armv8-A doesn't have CRC.
That's only a required extension as of v8.1a.

Remove it from the "generic" CPU as well: it should only support the
base ISA (and binutils agrees).

Also unify the MC tests into crc.s and arm64-crc32.s

llvm-svn: 302077
2017-05-03 20:33:52 +00:00
Vitaly Buka
a4f5ab971b [libFuzzer] exit without running atexit handlers in libfuzzer's crash handler
Summary:
It's not safe to assume that atexit handlers can be run once the app crashed.

Patch by Jochen Eisinger.

Reviewers: kcc, vitalybuka

Subscribers: llvm-commits

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

llvm-svn: 302076
2017-05-03 20:31:19 +00:00
Krzysztof Parzyszek
64f98494f2 [Hexagon] Use automatically-generated scheduling information for HVX
Patch by Jyotsna Verma.

llvm-svn: 302073
2017-05-03 20:10:36 +00:00
Zachary Turner
ac2522878b Remove unused private field.
llvm-svn: 302069
2017-05-03 19:42:06 +00:00
Anna Thomas
3c2a815f18 Avoid warning of unused variable in release builds. NFC
llvm-svn: 302068
2017-05-03 19:25:04 +00:00
Sanjoy Das
49afd72afc Fix typos in comment
llvm-svn: 302063
2017-05-03 18:29:34 +00:00
Greg Clayton
86cfb6288f Break verification down into smaller functions to keep code clean.
Adrian requested that we break things down to make things clean in the DWARFVerifier. This patch breaks everything down into nice individual functions and cleans up the code quite a bit and prepares us for the next round of verifiers.

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

llvm-svn: 302062
2017-05-03 18:25:46 +00:00