1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
Commit Graph

156034 Commits

Author SHA1 Message Date
Aditya Nandakumar
28d9faf26b Make the combiner check if shifts are legal before creating them
Summary: Make sure shifts are legal/specified by the legalizerinfo before creating it

Reviewers: qcolombet, dsanders, rovka, t.p.northover

Subscribers: llvm-commits

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

llvm-svn: 316602
2017-10-25 18:49:18 +00:00
Krzysztof Parzyszek
751ed0eef6 [Hexagon] Account for negative offset when limiting max deviation
In getOffsetRange, Max can be set to 0 to force the extender replacement
to be at or below the original value. This would cause the new offset to
be non-negative, which is preferred for memory instructions (to reduce
the likelihood of it getting constant-extended due to predication). The
problem happens when the range is shifted by an offset (present in the
instruction being examined) and the offset is negative. The entire range
for the allowable deviation will then be strictly negative. This creates
a problem, since 0 is assumed to be a valid deviation.

llvm-svn: 316601
2017-10-25 18:46:40 +00:00
Peter Collingbourne
656d1cb74c Remove dead function declaration.
llvm-svn: 316597
2017-10-25 17:42:00 +00:00
Shoaib Meenai
28eb3a74e3 [cmake] Restrict resource file usage to Windows build hosts
Resource file compilation requires a working resource compiler.
Unfortunately, llvm-rc isn't quite there yet [1], and cmake's rc
invocation only works on Windows [2]. Until both those issues are
addressed, disable resource file usage on non-Windows build hosts, to
unblock Windows cross-compilation. This is also consistent with the
existing comment, which says "If *on Windows* and building with MSVC".

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118433.html
[2] https://public.kitware.com/pipermail/cmake/2017-October/066441.html

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

llvm-svn: 316594
2017-10-25 17:11:28 +00:00
Craig Topper
e73b5e0aba [X86] Add avx512vpopcntdq to Knights Mill
As indicated by Table 1-1 in Intel Architecture Instruction Set Extensions and Future Features Programming Reference from October 2017.

llvm-svn: 316592
2017-10-25 17:10:32 +00:00
Konstantin Zhuravlyov
fff5bd58d3 AMDGPU: Cleanup memory legalizer load/store tests
llvm-svn: 316590
2017-10-25 17:04:46 +00:00
Konstantin Zhuravlyov
6c92f444d6 AMDGPU/NFC: Rename memory legalizer tests:
- memory-legalizer-atomic-load.ll -> memory-legalizer-load.ll
  - memory-legalizer-atomic-store.ll -> memory-legalizer-store.ll

llvm-svn: 316586
2017-10-25 16:45:28 +00:00
Balaram Makam
71dbdadf82 [Local] Fix a bug in the domtree update logic for MergeBasicBlockIntoOnlyPred.
Summary: For some irreducible CFG the domtree nodes might be dead, do not update domtree for dead nodes.

Reviewers: kuhar, dberlin, hfinkel

Reviewed By: kuhar

Subscribers: llvm-commits, mcrosier

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

llvm-svn: 316582
2017-10-25 14:55:48 +00:00
John Baldwin
fcf180ea5e Don't try to use a non-existent header on FreeBSD/mips.
Reviewers: dim

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

llvm-svn: 316581
2017-10-25 14:53:16 +00:00
Matthew Simpson
05237a905d Add CalledValuePropagation pass
This patch adds a new pass for attaching !callees metadata to indirect call
sites. The pass propagates values to call sites by performing an IPSCCP-like
analysis using the generic sparse propagation solver. For indirect call sites
having a small set of possible callees, the attached metadata indicates what
those callees are. The metadata can be used to facilitate optimizations like
intersecting the function attributes of the possible callees, refining the call
graph, performing indirect call promotion, etc.

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

llvm-svn: 316576
2017-10-25 13:40:08 +00:00
Simon Dardis
b53aa7b645 [mips] Clean up some whitespace (NFC).
Also test that my email address was updated.

llvm-svn: 316575
2017-10-25 13:35:53 +00:00
Daniil Fukalov
b62bacb924 [inlineasm] Fix crash when number of matched input constraint operands overflows signed char
In a case when number of output constraint operands that has matched input operands
doesn't fit to signed char, TargetLowering::ParseConstraints() can try to access
ConstraintOperands (that is std::vector) with negative index.

Reviewers: rampitec, arsenm

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

llvm-svn: 316574
2017-10-25 12:51:32 +00:00
Diana Picus
3015b0d23d [ARM GlobalISel] Remove redundant testcases. NFC
Remove the G_FADD testcases from arm-legalizer.mir, they are covered by
arm-legalizer-fp.mir (I probably forgot to delete them when I created
that test).

llvm-svn: 316573
2017-10-25 12:22:21 +00:00
Diana Picus
2f07ded5fd [ARM GlobalISel] Update test after r316479. NFC
No need to check register classes in the register block anymore, since
we can now much more conveniently check them at their def.

llvm-svn: 316572
2017-10-25 12:22:16 +00:00
Diana Picus
f077d0bade [ARM GlobalISel] Fix call opcodes
We were generating BLX for all the calls, which was incorrect in most
cases. Update ARMCallLowering to generate BL for direct calls, and BLX,
BX_CALL or BMOVPCRX_CALL for indirect calls.

llvm-svn: 316570
2017-10-25 11:42:40 +00:00
Diana Picus
050da086d7 [ARM GlobalISel] Split test into 3. NFC
Separate the test cases that deal with calls from the rest of the IR
Translator tests.

We split into 2 different files, one for testing parameter and result
lowering, and one for testing the various different kinds of calls that
can occur (BL, BLX, BX_CALL etc).

llvm-svn: 316569
2017-10-25 11:21:15 +00:00
Max Kazantsev
273e508a04 [SCEV] Enhance SCEVFindUnsafe for division
This patch allows SCEVFindUnsafe algorithm to tread division by any non-positive
value as safe. Previously, it could only recognize non-zero constants.

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

llvm-svn: 316568
2017-10-25 11:07:43 +00:00
Clement Courbet
33e69ec466 Re-land "[CodeGen][ExpandMemcmp][NFC] Allow memcmp to expand to vector loads (1)"
Compute the actual decomposition only after deciding whether to expand
of not. Else, it's easy to make the compiler OOM with:
`memcpy(dst, src, 0xffffffffffffffff);`, which typically happens if
someone mistakenly passes a negative value. Add a test.

This reverts commit f8fc02fbd4ab33383c010d33675acf9763d0bd44.

llvm-svn: 316567
2017-10-25 11:02:09 +00:00
George Rimar
938c776d94 [llvm-dwarfdump] - Fix array out of bounds access crash.
This fixes possible out of bound access in
DWARFDie::getFirstChild()
which might happen when .debug_info section is corrupted,
like shown in testcase.

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

llvm-svn: 316566
2017-10-25 10:23:49 +00:00
Sam Parker
7b10d04981 [ARM] OrCombineToBFI function
Extract the functionality to combine OR to BFI into its own function.

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

llvm-svn: 316563
2017-10-25 08:37:33 +00:00
Sam Parker
b5345a57e5 [ARM] Swap cmp operands for automatic shifts
Swap the compare operands if the lhs is a shift and the rhs isn't,
as in arm and T2 the shift can be performed by the compare for its
second operand.

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

llvm-svn: 316562
2017-10-25 08:33:06 +00:00
Jonas Paulsson
be0c831fba [MachineScheduler] Minor refactoring.
Duplicated code found in three places put into a new static function:

/// Given a Count of resource usage and a Latency value, return true if a
/// SchedBoundary becomes resource limited.
static bool checkResourceLimit(unsigned LFactor, unsigned Count,
                               unsigned Latency) {
  return (int)(Count - (Latency * LFactor)) > (int)LFactor;
}

Review: Florian Hahn, Matthias Braun
https://reviews.llvm.org/D39235

llvm-svn: 316560
2017-10-25 08:23:33 +00:00
Martin Storsjo
abdaedf85b [AArch64] Add support for dllimport of values and functions
Previously, the dllimport attribute did the right thing in terms
of treating it as a pointer to a value, but this makes sure the
names get mangled properly, and calls to such functions load the
function from the __imp_ pointer.

This is based on SVN r212431 and r212430 where the same was
implemented for ARM.

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

llvm-svn: 316555
2017-10-25 07:25:18 +00:00
Matt Arsenault
d2d2e6f167 DAG: Fix creating select with wrong condition type
This code added in r297930 assumed that it could create
a select with a condition type that is just an integer
bitcast of the selected type. For AMDGPU any vselect is
going to be scalarized (although the vector types are legal),
and all select conditions must be i1 (the same as getSetCCResultType).

This logic doesn't really make sense to me, but there's
never really been a consistent policy in what the select
condition mask type is supposed to be. Try to extend
the logic for skipping the transform for condition types
that aren't setccs. It doesn't seem quite right to me though,
but checking conditions that seem more sensible (like whether the
vselect is going to be expanded) doesn't work since this
seems to depend on that also.

llvm-svn: 316554
2017-10-25 07:14:07 +00:00
Matt Arsenault
630768ab44 AMDGPU: Add max-mix-insts subtarget feature
llvm-svn: 316553
2017-10-25 07:00:51 +00:00
Max Kazantsev
1c4d30f25d [IRCE] Fix intersection between signed and unsigned ranges
IRCE for unsigned latch conditions was temporarily disabled by rL314881. The motivating
example contained an unsigned latch condition and a signed range check. One of the safe
iteration ranges was `[1, SINT_MAX + 1]`. Its right border was incorrectly interpreted as a negative
value in `IntersectRange` function, this lead to a miscompile under which we deleted a range check
without inserting a postloop where it was needed.

This patch brings back IRCE for unsigned latch conditions. Now we treat range intersection more
carefully. If the latch condition was unsigned, we only try to consider a range check for deletion if:
1. The range check is also unsigned, or
2. Safe iteration range of the range check lies within `[0, SINT_MAX]`.
The same is done for signed latch.

Values from `[0, SINT_MAX]` are unambiguous, these values are non-negative under any interpretation,
and all values of a range intersected with such range are also non-negative.

We also use signed/unsigned min/max functions for range intersection depending on type of the
latch condition.

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

llvm-svn: 316552
2017-10-25 06:47:39 +00:00
Mikael Holmen
e510c9b43e [MemDep] DBG intrinsics don't impact abort limit for call site dependence analysis
Summary:
Memory dependence analysis no longer counts DbgInfoIntrinsics towards the
limit where to abort the analysis. Before, a bunch of calls to dbg.value
could affect the generated code, meaning that with -g we could generate
different code than without.

Reviewers: chandlerc, Prazek, davide, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

llvm-svn: 316551
2017-10-25 06:15:32 +00:00
Max Kazantsev
b48453c7dc [IRCE] Smarter detection of empty ranges using SCEV
For a SCEV range, this patch replaces the naive emptiness check for SCEV ranges
which looks like `Begin == End` with a SCEV check. The range is guaranteed to be
empty of `Begin >= End`. We should filter such ranges out and do not try to perform
IRCE for them.

For example, we can get such range when intersecting range `[A, B)` and `[C, D)`
where `A < B < C < D`. The resulting range is `[max(A, C), min(B, D)) = [C, B)`.
This range is empty, but its `Begin` does not match with `End`.

Making IRCE for an empty range is basically safe but unprofitable because we
never actually get into the main loop where the range checks are supposed to
be eliminated. This patch uses SCEV mechanisms to treat loops with proved
`Begin >= End` as empty.

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

llvm-svn: 316550
2017-10-25 06:10:02 +00:00
Peter Collingbourne
7d5c600732 Assembly tests require x86 target.
llvm-svn: 316546
2017-10-25 04:24:20 +00:00
Teresa Johnson
72f8a4fdbb [ThinLTO] Make test for promoted names more specific
With r314527, promoted values get a suffix that is a decimal value of
the module hash instead of hex. Change the regex to match only decimal
suffix values.

llvm-svn: 316544
2017-10-25 03:41:31 +00:00
Peter Collingbourne
251c0e9aa5 llvm-readobj: Add support for reading relocations in the Android packed format.
This is in preparation for testing lld's upcoming relocation packing
feature (D39152). I have verified that this implementation correctly
unpacks the relocations from a Chromium DSO built with gold and the
Android relocation packer for ARM32 and ARM64.

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

llvm-svn: 316543
2017-10-25 03:37:12 +00:00
Mitch Phillips
6810f22c0b Check special-case-list regex before insertion.
Summary:
Checks that the supplied regex to SpecialCaseList::Matcher::insert(..) is non-empty.

Reported by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3688

Verified that this fixes the provided assertion failure (built with {asan, fuzzer}):
```
mitchp@mitchp2:~/llvm-build/git-fuzz$ ninja llvm-special-case-list-fuzzer[12/12] Linking CXX executable bin/llvm-special-case-list-fuzzer
mitchp@mitchp2:~/llvm-build/git-fuzz$ bin/llvm-special-case-list-fuzzer ~/Downloads/clusterfuzz-testcase-6748633157337088
INFO: Seed: 1697404507
INFO: Loaded 1 modules   (18581 inline 8-bit counters): 18581 [0x9e9f60, 0x9ee7f5),
INFO: Loaded 1 PC tables (18581 PCs): 18581 [0x9ee7f8,0xa37148),
bin/llvm-special-case-list-fuzzer: Running 1 inputs 1 time(s) each.
Running: /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-6748633157337088
Executed /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-6748633157337088 in 0 ms
***
*** NOTE: fuzzing was not performed, you have only
***       executed the target code on a fixed set of inputs.
***
mitchp@mitchp2:~/llvm-build/git-fuzz$

```

Reviewers: kcc, vsk

Reviewed By: vsk

Subscribers: vsk, llvm-commits, vlad.tsyrklevich

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

llvm-svn: 316537
2017-10-24 23:56:12 +00:00
Adrian Prantl
74a7e5f6f8 Implement salavageDebugInfo functionality for SelectionDAG.
Similar to how llvm::salvagDebugInfo hooks into InstCombine, this adds
a hook that can be invoked before an SDNode that is associated with an
SDDbgValue is erased to capture the effect of the deleted node in a
DIExpression.

The motivating example is an SDDebugValue attached to an ADD operation
that gets folded into a LOAD+OFFSET operation.

rdar://problem/32121503

llvm-svn: 316525
2017-10-24 22:55:12 +00:00
Sam Clegg
4e1a08d54c Add Triple::isOSUnknown
Subscribers: aheejin

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

llvm-svn: 316524
2017-10-24 22:48:19 +00:00
Vedant Kumar
eb1f44a2f3 [Coverage] Provide a stable order for getInstantiationGroups
Differential Revision: https://reviews.llvm.org/D39257

llvm-svn: 316523
2017-10-24 22:35:29 +00:00
Yonghong Song
b12f0ea4c2 bpf: fix an uninitialized variable issue
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 316519
2017-10-24 21:36:33 +00:00
David Blaikie
c1d52145bb ARMAddressingModes.h: Don't mark header functions as file local
llvm-svn: 316517
2017-10-24 21:29:21 +00:00
David Blaikie
f6357ae275 ValueMapper.h: Don't mark header functions as file local
llvm-svn: 316516
2017-10-24 21:29:21 +00:00
David Blaikie
c01b46c73e Transforms/Utils/Local.h: Don't mark header functions as file local
llvm-svn: 316515
2017-10-24 21:29:20 +00:00
David Blaikie
5974607431 TargetOpcodes.h: Don't mark header functions as file local
llvm-svn: 316514
2017-10-24 21:29:19 +00:00
David Blaikie
81c6e7d462 Printable.h: Don't mark header functions as file local
llvm-svn: 316513
2017-10-24 21:29:19 +00:00
David Blaikie
8c783a9730 ConvertUTF.h: Don't mark header functions as file local
llvm-svn: 316512
2017-10-24 21:29:18 +00:00
David Blaikie
2c20cd4637 AtomicOrdering.h: Don't mark header functions as file local
llvm-svn: 316511
2017-10-24 21:29:18 +00:00
David Blaikie
2afa6a2927 LaneBitmask.h: Don't mark header functions as file local
llvm-svn: 316510
2017-10-24 21:29:17 +00:00
David Blaikie
728a415814 Type.h: Don't mark header functions as file local
llvm-svn: 316509
2017-10-24 21:29:16 +00:00
David Blaikie
3334cea8e6 HexagonDepTimingClasses.h: Don't mark header functions as file local
llvm-svn: 316508
2017-10-24 21:29:16 +00:00
David Blaikie
ad7ec36059 WebassemblyAsmPrinter.h: Include WebAssemblyMachineFunctionInfo for use with MachineFunction::getInfo
llvm-svn: 316507
2017-10-24 21:29:15 +00:00
David Blaikie
972b0da039 X86Operand.h: Include X86MCTargetDesc.h for SSE register enum/names
llvm-svn: 316506
2017-10-24 21:29:15 +00:00
David Blaikie
55aef8c59a X86AsmPrinter.h: Add missing header for complete type needed for MCCodeEmitter dtor.
llvm-svn: 316505
2017-10-24 21:29:14 +00:00
David Blaikie
4f809b1482 RegisterUsageInfo.h: Add missing header for complete type needed for DenseMap traits
llvm-svn: 316504
2017-10-24 21:29:10 +00:00