Matt Arsenault [Fri, 19 Jul 2019 13:57:44 +0000 (13:57 +0000)]
AMDGPU: Decompose all values to 32-bit pieces for calling conventions
This is the more natural lowering, and presents more opportunities to
reduce 64-bit ops to 32-bit.
This should also help avoid issues graphics shaders have had with
64-bit values, and simplify argument lowering in globalisel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366578
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 19 Jul 2019 13:40:54 +0000 (13:40 +0000)]
gn build: Set +x on symlink_or_copy.py
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366576
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 19 Jul 2019 13:36:46 +0000 (13:36 +0000)]
DAG: Handle dbg_value for arguments split into multiple subregs
This was handled previously for arguments split due to not fitting in
an MVT. This was dropping the register for argument registers split
due to TLI::getRegisterTypeForCallingConv.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366574
91177308-0d34-0410-b5e6-
96231b3b80d8
Than McIntosh [Fri, 19 Jul 2019 13:13:54 +0000 (13:13 +0000)]
[NFC] include cstdint/string prior to using uint8_t/string
Summary: include proper header prior to use of uint8_t typedef
and std::string.
Subscribers: llvm-commits
Reviewers: cherry
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64937
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366572
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Preobrazhensky [Fri, 19 Jul 2019 13:12:47 +0000 (13:12 +0000)]
[AMDGPU][MC] Corrected parsing of branch offsets
See bug 40820: https://bugs.llvm.org/show_bug.cgi?id=40820
Reviewers: artem.tamazov, arsenm
Differential Revision: https://reviews.llvm.org/D64629
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366571
91177308-0d34-0410-b5e6-
96231b3b80d8
Kai Luo [Fri, 19 Jul 2019 12:58:16 +0000 (12:58 +0000)]
[MachineCSE][MachinePRE] Avoid hoisting code from code regions into hot BBs.
Summary:
Current PRE hoists common computations into
CMBB = DT->findNearestCommonDominator(MBB, MBB1).
However, if CMBB is in a hot loop body, we might get performance
degradation.
Differential Revision: https://reviews.llvm.org/D64394
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366570
91177308-0d34-0410-b5e6-
96231b3b80d8
Than McIntosh [Fri, 19 Jul 2019 12:54:44 +0000 (12:54 +0000)]
[X86] for split stack, not save/restore nested arg if unused
Summary:
For split-stack, if the nested argument (i.e. R10) is not used, no need to save/restore it in the prologue.
Reviewers: thanm
Reviewed By: thanm
Subscribers: mstorsjo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64673
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366569
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 11:29:18 +0000 (11:29 +0000)]
[NFC][InstCombine] Tests for 'rem' formation from sub-of-mul-by-'div' (PR42673)
https://rise4fun.com/Alive/8Rp
https://bugs.llvm.org/show_bug.cgi?id=42673
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366565
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 11:29:04 +0000 (11:29 +0000)]
[NFC][InstCombine] Redundant masking before left-shift: tests with assume
If the legality check is `(shiftNbits-maskNbits) s>= 0`,
then we can simplify it to `shiftNbits u>= maskNbits`,
which is easier to check for.
However, currently switching the `dropRedundantMaskingOfLeftShiftInput()`
to `SimplifyICmpInst()` does not catch these cases and regresses
currently-handled cases, so i'll leave it as is for now.
https://rise4fun.com/Alive/25P
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366564
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 19 Jul 2019 11:18:46 +0000 (11:18 +0000)]
Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366563
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Fri, 19 Jul 2019 10:37:37 +0000 (10:37 +0000)]
Don't update NoTrappingFPMath and FPDenormalMode in resetTargetOptions
We'd like to remove this whole function, because these are properties of
functions, not the target as a whole. These two are easy to remove
because they are only used for emitting ARM build attributes, which
expects them to represent the defaults for the whole module, not just
the last function generated.
This is needed to get correct build attributes when using IPRA on ARM,
because IPRA causes resetTargetOptions to get called before
ARMAsmPrinter::emitAttributes.
Differential revision: https://reviews.llvm.org/D64929
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366562
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Fri, 19 Jul 2019 10:15:03 +0000 (10:15 +0000)]
[llvm-readelf] - A fix for: "--hash-symbols asserts for 64-bit ELFs"
Fixes https://bugs.llvm.org/show_bug.cgi?id=42622.
(--hash-symbols switch is currently broken for 64-bit ELF files, due to r352630.)
Differential revision: https://reviews.llvm.org/D64788
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366558
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Fri, 19 Jul 2019 09:59:26 +0000 (09:59 +0000)]
[IPRA] Don't rely on non-exact function definitions
If a function definition is not exact, then the linker could select a
differently-compiled version of it, which could use different registers.
https://reviews.llvm.org/D64909
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366557
91177308-0d34-0410-b5e6-
96231b3b80d8
Mikhail Maltsev [Fri, 19 Jul 2019 09:46:28 +0000 (09:46 +0000)]
[ARM] Add <saturate> operand to SQRSHRL and UQRSHLL
Summary:
According to the new Armv8-M specification
https://static.docs.arm.com/ddi0553/bh/DDI0553B_h_armv8m_arm.pdf the
instructions SQRSHRL and UQRSHLL now have an additional immediate
operand <saturate>. The new assembly syntax is:
SQRSHRL<c> RdaLo, RdaHi, #<saturate>, Rm
UQRSHLL<c> RdaLo, RdaHi, #<saturate>, Rm
where <saturate> can be either 64 (the existing behavior) or 48, in
that case the result is saturated to 48 bits.
The new operand is encoded as follows:
#64 Encoded as sat = 0
#48 Encoded as sat = 1
sat is bit 7 of the instruction bit pattern.
This patch adds a new assembler operand class MveSaturateOperand which
implements parsing and encoding. Decoding is implemented in
DecodeMVEOverlappingLongShift.
Reviewers: ostannard, simon_tatham, t.p.northover, samparker, dmgreen, SjoerdMeijer
Reviewed By: simon_tatham
Subscribers: javed.absar, kristof.beyls, hiraditya, pbarrio, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64810
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366555
91177308-0d34-0410-b5e6-
96231b3b80d8
Hubert Tong [Fri, 19 Jul 2019 08:46:18 +0000 (08:46 +0000)]
[sanitizers] Use covering ObjectFormatType switches
Summary:
This patch removes the `default` case from some switches on
`llvm::Triple::ObjectFormatType`, and cases for the missing enumerators
(`UnknownObjectFormat`, `Wasm`, and `XCOFF`) are then added.
For `UnknownObjectFormat`, the effect of the action for the `default`
case is maintained; otherwise, where `llvm_unreachable` is called,
`report_fatal_error` is used instead.
Where the `default` case returns a default value, `report_fatal_error`
is used for XCOFF as a placeholder. For `Wasm`, the effect of the action
for the `default` case in maintained.
The code is structured to avoid strongly implying that the `Wasm` case
is present for any reason other than to make the switch cover all
`ObjectFormatType` enumerator values.
Reviewers: sfertile, jasonliu, daltenty
Reviewed By: sfertile
Subscribers: hiraditya, aheejin, sunfish, llvm-commits, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64222
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366544
91177308-0d34-0410-b5e6-
96231b3b80d8
Jay Foad [Fri, 19 Jul 2019 08:40:37 +0000 (08:40 +0000)]
[AMDGPU] Simplify the exclusive scan used for optimized atomics
Summary:
Change the scan algorithm to use only power-of-two shifts (1, 2, 4, 8,
16, 32) instead of starting off shifting by 1, 2 and 3 and then doing
a 3-way ADD, because:
1. It simplifies the compiler a little.
2. It minimizes vgpr pressure because each instruction is now of the
form vn = vn + vn << c.
3. It is more friendly to the DPP combiner, which currently can't
combine into an ADD3 instruction.
Because of #2 and #3 the end result is improved from this:
v_add_u32_dpp v4, v3, v3 row_shr:1 row_mask:0xf bank_mask:0xf bound_ctrl:0
v_mov_b32_dpp v5, v3 row_shr:2 row_mask:0xf bank_mask:0xf
v_mov_b32_dpp v1, v3 row_shr:3 row_mask:0xf bank_mask:0xf
v_add3_u32 v1, v4, v5, v1
s_nop 1
v_add_u32_dpp v1, v1, v1 row_shr:4 row_mask:0xf bank_mask:0xe
s_nop 1
v_add_u32_dpp v1, v1, v1 row_shr:8 row_mask:0xf bank_mask:0xc
s_nop 1
v_add_u32_dpp v1, v1, v1 row_bcast:15 row_mask:0xa bank_mask:0xf
s_nop 1
v_add_u32_dpp v1, v1, v1 row_bcast:31 row_mask:0xc bank_mask:0xf
To this:
v_add_u32_dpp v1, v1, v1 row_shr:1 row_mask:0xf bank_mask:0xf bound_ctrl:0
s_nop 1
v_add_u32_dpp v1, v1, v1 row_shr:2 row_mask:0xf bank_mask:0xf bound_ctrl:0
s_nop 1
v_add_u32_dpp v1, v1, v1 row_shr:4 row_mask:0xf bank_mask:0xe
s_nop 1
v_add_u32_dpp v1, v1, v1 row_shr:8 row_mask:0xf bank_mask:0xc
s_nop 1
v_add_u32_dpp v1, v1, v1 row_bcast:15 row_mask:0xa bank_mask:0xf
s_nop 1
v_add_u32_dpp v1, v1, v1 row_bcast:31 row_mask:0xc bank_mask:0xf
I.e. two fewer computational instructions, one extra nop where we could
schedule something else.
Reviewers: arsenm, sheredom, critson, rampitec, vpykhtin
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64411
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366543
91177308-0d34-0410-b5e6-
96231b3b80d8
Serguei Katkov [Fri, 19 Jul 2019 08:35:45 +0000 (08:35 +0000)]
[Loop Peeling] Enable peeling of multiple exits by default.
Enable loop peeling with multiple exits where all non-latch exits
ends up with deopt by default.
Reviewers: reames, fhahn
Reviewed By: reames
Subscribers: xbolva00, hiraditya, zzheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D64619
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366542
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 08:26:58 +0000 (08:26 +0000)]
[InstCombine] Dropping redundant masking before left-shift [5/5] (PR42563)
Summary:
If we have some pattern that leaves only some low bits set, and then performs
left-shift of those bits, if none of the bits that are left after the final
shift are modified by the mask, we can omit the mask.
There are many variants to this pattern:
f. `((x << MaskShAmt) a>> MaskShAmt) << ShiftShAmt`
All these patterns can be simplified to just:
`x << ShiftShAmt`
iff:
f. `(ShiftShAmt-MaskShAmt) s>= 0` (i.e. `ShiftShAmt u>= MaskShAmt`)
Normally, the inner pattern is sign-extend,
but for our purposes it's no different to other patterns:
alive proofs:
f: https://rise4fun.com/Alive/7U3
For now let's start with patterns where both shift amounts are variable,
with trivial constant "offset" between them, since i believe this is
both simplest to handle and i think this is most common.
But again, there are likely other variants where we could use
ValueTracking/ConstantRange to handle more cases.
https://bugs.llvm.org/show_bug.cgi?id=42563
Differential Revision: https://reviews.llvm.org/D64524
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366540
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 08:26:47 +0000 (08:26 +0000)]
[InstCombine] Dropping redundant masking before left-shift [4/5] (PR42563)
Summary:
If we have some pattern that leaves only some low bits set, and then performs
left-shift of those bits, if none of the bits that are left after the final
shift are modified by the mask, we can omit the mask.
There are many variants to this pattern:
e. `((x << MaskShAmt) l>> MaskShAmt) << ShiftShAmt`
All these patterns can be simplified to just:
`x << ShiftShAmt`
iff:
e. `(ShiftShAmt-MaskShAmt) s>= 0` (i.e. `ShiftShAmt u>= MaskShAmt`)
alive proofs:
e: https://rise4fun.com/Alive/0FT
For now let's start with patterns where both shift amounts are variable,
with trivial constant "offset" between them, since i believe this is
both simplest to handle and i think this is most common.
But again, there are likely other variants where we could use
ValueTracking/ConstantRange to handle more cases.
https://bugs.llvm.org/show_bug.cgi?id=42563
Differential Revision: https://reviews.llvm.org/D64521
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366539
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 08:26:37 +0000 (08:26 +0000)]
[InstCombine] Dropping redundant masking before left-shift [3/5] (PR42563)
Summary:
If we have some pattern that leaves only some low bits set, and then performs
left-shift of those bits, if none of the bits that are left after the final
shift are modified by the mask, we can omit the mask.
There are many variants to this pattern:
d. `(x & ((-1 << MaskShAmt) >> MaskShAmt)) << ShiftShAmt`
All these patterns can be simplified to just:
`x << ShiftShAmt`
iff:
d. `(ShiftShAmt-MaskShAmt) s>= 0` (i.e. `ShiftShAmt u>= MaskShAmt`)
alive proofs:
d: https://rise4fun.com/Alive/I5Y
For now let's start with patterns where both shift amounts are variable,
with trivial constant "offset" between them, since i believe this is
both simplest to handle and i think this is most common.
But again, there are likely other variants where we could use
ValueTracking/ConstantRange to handle more cases.
https://bugs.llvm.org/show_bug.cgi?id=42563
Differential Revision: https://reviews.llvm.org/D64519
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366538
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 08:26:25 +0000 (08:26 +0000)]
[InstCombine] Dropping redundant masking before left-shift [2/5] (PR42563)
Summary:
If we have some pattern that leaves only some low bits set, and then performs
left-shift of those bits, if none of the bits that are left after the final
shift are modified by the mask, we can omit the mask.
There are many variants to this pattern:
c. `(x & (-1 >> MaskShAmt)) << ShiftShAmt`
All these patterns can be simplified to just:
`x << ShiftShAmt`
iff:
c. `(ShiftShAmt-MaskShAmt) s>= 0` (i.e. `ShiftShAmt u>= MaskShAmt`)
alive proofs:
c: https://rise4fun.com/Alive/RgJh
For now let's start with patterns where both shift amounts are variable,
with trivial constant "offset" between them, since i believe this is
both simplest to handle and i think this is most common.
But again, there are likely other variants where we could use
ValueTracking/ConstantRange to handle more cases.
https://bugs.llvm.org/show_bug.cgi?id=42563
Differential Revision: https://reviews.llvm.org/D64517
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366537
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 08:26:13 +0000 (08:26 +0000)]
[InstCombine] Dropping redundant masking before left-shift [1/5] (PR42563)
Summary:
If we have some pattern that leaves only some low bits set, and then performs
left-shift of those bits, if none of the bits that are left after the final
shift are modified by the mask, we can omit the mask.
There are many variants to this pattern:
b. `(x & (~(-1 << maskNbits))) << shiftNbits`
All these patterns can be simplified to just:
`x << ShiftShAmt`
iff:
b. `(MaskShAmt+ShiftShAmt) u>= bitwidth(x)`
alive proof:
b: https://rise4fun.com/Alive/y8M
For now let's start with patterns where both shift amounts are variable,
with trivial constant "offset" between them, since i believe this is
both simplest to handle and i think this is most common.
But again, there are likely other variants where we could use
ValueTracking/ConstantRange to handle more cases.
https://bugs.llvm.org/show_bug.cgi?id=42563
Differential Revision: https://reviews.llvm.org/D64514
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366536
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Lebedev [Fri, 19 Jul 2019 08:25:43 +0000 (08:25 +0000)]
[InstCombine] Dropping redundant masking before left-shift [0/5] (PR42563)
Summary:
If we have some pattern that leaves only some low bits set, and then performs
left-shift of those bits, if none of the bits that are left after the final
shift are modified by the mask, we can omit the mask.
There are many variants to this pattern:
a. `(x & ((1 << MaskShAmt) - 1)) << ShiftShAmt`
All these patterns can be simplified to just:
`x << ShiftShAmt`
iff:
a. `(MaskShAmt+ShiftShAmt) u>= bitwidth(x)`
alive proof:
a: https://rise4fun.com/Alive/wi9
Indeed, not all of these patterns are canonical.
But since this fold will only produce a single instruction
i'm really interested in handling even uncanonical patterns,
since i have this general kind of pattern in hotpaths,
and it is not totally outlandish for bit-twiddling code.
For now let's start with patterns where both shift amounts are variable,
with trivial constant "offset" between them, since i believe this is
both simplest to handle and i think this is most common.
But again, there are likely other variants where we could use
ValueTracking/ConstantRange to handle more cases.
https://bugs.llvm.org/show_bug.cgi?id=42563
Reviewers: spatel, nikic, huihuiz, xbolva00
Reviewed By: xbolva00
Subscribers: efriedma, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64512
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366535
91177308-0d34-0410-b5e6-
96231b3b80d8
Hubert Tong [Fri, 19 Jul 2019 07:21:59 +0000 (07:21 +0000)]
[NFC] Fix an indentation issue in llvm/Support/TargetRegistry.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366533
91177308-0d34-0410-b5e6-
96231b3b80d8
Hsiangkai Wang [Fri, 19 Jul 2019 06:10:36 +0000 (06:10 +0000)]
[DebugInfo] Some fields do not need relocations even relax is enabled.
In debug frame information, some fields, e.g., Length in CIE/FDE and
Offset in FDE are attributes to describe the structure of CIE/FDE. They
are not related to the relaxed code. However, these attributes are
symbol differences. So, in current design, these attributes will be
filled as zero and LLVM generates relocations for them.
We only need to generate relocations for symbols in executable sections.
So, if the symbols are not located in executable sections, we still
evaluate their values under relaxation.
Differential Revision: https://reviews.llvm.org/D61584
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366531
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 19 Jul 2019 05:49:11 +0000 (05:49 +0000)]
unbreak links
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366530
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 19 Jul 2019 05:23:17 +0000 (05:23 +0000)]
replace the old kaleidoscope tutorial files with orphaned pages that forward to the new copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366529
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 19 Jul 2019 05:15:57 +0000 (05:15 +0000)]
Point to the dusted off version of the kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366528
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Brachet [Fri, 19 Jul 2019 02:31:21 +0000 (02:31 +0000)]
[test] [llvm-objcopy] Fix broken test case
Summary: The test case added in D62718 did not work unless the user was root because write bits were not set for the output file. This change uses only permissions with user write (0200) to ensure tests pass regardless of the users permissions.
Reviewers: jhenderson, rupprecht, MaskRay, espindola, alexshap
Reviewed By: MaskRay
Subscribers: emaste, arichardson, jakehehrlich, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64302
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366527
91177308-0d34-0410-b5e6-
96231b3b80d8
Kang Zhang [Fri, 19 Jul 2019 02:23:26 +0000 (02:23 +0000)]
[NFC][PowerPC] Modify the test case add_cmp.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366526
91177308-0d34-0410-b5e6-
96231b3b80d8
Hsiangkai Wang [Fri, 19 Jul 2019 02:03:34 +0000 (02:03 +0000)]
[DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.
It is necessary to generate fixups in .debug_frame or .eh_frame as
relaxation is enabled due to the address delta may be changed after
relaxation.
There is an opcode with 6-bits data in debug frame encoding. So, we
also need 6-bits fixup types.
Differential Revision: https://reviews.llvm.org/D58335
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366524
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 19 Jul 2019 01:10:28 +0000 (01:10 +0000)]
Use the MachineBasicBlock symbol for a callbr target
Summary:
Inline asm doesn't use labels when compiled as an object file. Therefore, we
shouldn't create one for the (potential) callbr destination. Instead, use the
symbol for the MachineBasicBlock.
Reviewers: nickdesaulniers, craig.topper
Reviewed By: nickdesaulniers
Subscribers: xbolva00, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64888
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366523
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Fri, 19 Jul 2019 00:24:45 +0000 (00:24 +0000)]
[GlobalISel] Translate calls to memcpy et al to G_INTRINSIC_W_SIDE_EFFECTs and legalize later.
I plan on adding memcpy optimizations in the GlobalISel pipeline, but we can't
do that unless we delay lowering to actual function calls. This patch changes
the translator to generate G_INTRINSIC_W_SIDE_EFFECTS for these functions, and
then have each target specify that using the new custom legalizer for intrinsics
hook that they want it expanded it a libcall.
Differential Revision: https://reviews.llvm.org/D64895
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366516
91177308-0d34-0410-b5e6-
96231b3b80d8
Nathan Lanza [Fri, 19 Jul 2019 00:20:58 +0000 (00:20 +0000)]
[cmake] Fix typo where a varible was checked for Apple instead of Darwin
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64965
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366515
91177308-0d34-0410-b5e6-
96231b3b80d8
Nathan Lanza [Fri, 19 Jul 2019 00:10:06 +0000 (00:10 +0000)]
[cmake] Convert the NATIVE llvm build process to be project agnostic
lldb recently added a tablegen tool. In order to properly cross compile
lldb standalone there needs to be a mechanism to generate the native
lldb build, analgous to what's done for the NATIVE llvm build. Thus,
we can simply modify this setup to allow for any project to be used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366514
91177308-0d34-0410-b5e6-
96231b3b80d8
Shoaib Meenai [Thu, 18 Jul 2019 22:48:38 +0000 (22:48 +0000)]
Reapply [llvm-lipo] Implement -create (with hardcoded alignments)
This reapplies r366142 with a fix for the failing Windows test.
Original commit message:
Creates universal binary output file from input files. Currently uses
hard coded value for alignment. Want to get the create functionality
approved before implementing the alignment function.
Patch by Anusha Basana <anusha.basana@gmail.com>
Differential Revision: https://reviews.llvm.org/D64102
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366512
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Thu, 18 Jul 2019 22:18:33 +0000 (22:18 +0000)]
[AMDGPU] Drop Reg32 and use regular AsmName
This allows to reduce generated AMDGPUGenAsmWriter.inc by ~100Kb.
Differential Revision: https://reviews.llvm.org/D64952
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366505
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Thu, 18 Jul 2019 21:50:11 +0000 (21:50 +0000)]
[GlobalISel][AArch64] Add support for base register + offset register loads
Add support for folding G_GEPs into loads of the form
```
ldr reg, [base, off]
```
when possible. This can save an add before the load. Currently, this is only
supported for loads of 64 bits into 64 bit registers.
Add a new addressing mode function, `selectAddrModeRegisterOffset` which
performs this folding when it is profitable.
Also add a test for addressing modes for G_LOAD.
Differential Revision: https://reviews.llvm.org/D64944
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366503
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 18 Jul 2019 21:37:16 +0000 (21:37 +0000)]
CodeGen: Allow !associated metadata to point to aliases.
This is a small extension of !associated, mostly useful for the implementation
convenience of instrumentation passes that RAUW globals with aliases, such
as LowerTypeTests.
Differential Revision: https://reviews.llvm.org/D64951
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366502
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 18 Jul 2019 21:26:41 +0000 (21:26 +0000)]
Revert [X86] EltsFromConsecutiveLoads - support common source loads
This reverts r366441 (git commit
48104ef7c9c653bbb732b66d7254957389fea337)
This causes clang to fail to compile some file in Skia. Reduction soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366501
91177308-0d34-0410-b5e6-
96231b3b80d8
Guanzhong Chen [Thu, 18 Jul 2019 21:17:52 +0000 (21:17 +0000)]
[WebAssembly] Fix __builtin_wasm_tls_base intrinsic
Summary:
Properly generate the outchain for the `__builtin_wasm_tls_base` intrinsic.
Also marked the intrinsic pure, per @sunfish's suggestion.
Reviewers: tlively, aheejin, sbc100, sunfish
Reviewed By: tlively
Subscribers: dschuff, jgravelle-google, hiraditya, cfe-commits, llvm-commits, sunfish
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64949
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366499
91177308-0d34-0410-b5e6-
96231b3b80d8
Nathan Lanza [Thu, 18 Jul 2019 21:14:26 +0000 (21:14 +0000)]
[cmake] Only run llvm-codesign if targetting apple on an apple host
Summary:
Other platforms don't have the capability to perform llvm_codesign
step. If LLVM_CODESIGNING_IDENTITY is set then this chunk of code would
attempt to codesign if the target was Apple. But when cross compiling
to Darwin from Linux, for example, this step would fail. So test if the
host is Apple as well.
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64942
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366498
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 18 Jul 2019 21:03:37 +0000 (21:03 +0000)]
Fix typo in r366494. Spotted by Yuanfang Chen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366497
91177308-0d34-0410-b5e6-
96231b3b80d8
Steven Wu [Thu, 18 Jul 2019 21:01:21 +0000 (21:01 +0000)]
Remove the static initialize introduced in r365099
Summary:
Some polish for r365099 which adds a static initializer to
MachOObjectFile. Remove it by moving it to file scope.
Reviewers: smeenai, alexshap, compnerd, mtrent, anushabasana
Reviewed By: smeenai
Subscribers: hiraditya, jkorous, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64873
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366496
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 18 Jul 2019 20:56:21 +0000 (20:56 +0000)]
IR: Teach Constant::needsRelocation() that relative pointers don't need to be relocated.
This causes sections with relative pointers to be marked as read only,
which means that they won't end up sharing pages with writable data.
Differential Revision: https://reviews.llvm.org/D64948
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366494
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 18 Jul 2019 20:14:16 +0000 (20:14 +0000)]
gn build: Merge r366458.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366487
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 18 Jul 2019 20:05:11 +0000 (20:05 +0000)]
FileSystem: Check for DTTOIF alone, not _DIRENT_HAVE_D_TYPE
While 'd_type' is a non-standard extension to `struct dirent`, only
glibc signals its presence with a macro '_DIRENT_HAVE_D_TYPE'.
However, any platform with 'd_type' also includes a way to convert to
mode_t values using the macro 'DTTOIF', so we can check for that alone
and still be confident that the 'd_type' member exists.
(If this turns out to be wrong, I'll go back and set up an actual
CMake check.)
I couldn't think of how to write a test for this, because I couldn't
think of how to test that a 'stat' call doesn't happen without
controlling the filesystem or intercepting 'stat', and there's no good
cross-platform way to do that that I know of.
Follow-up (almost a year later) to r342089.
rdar://problem/
50592673
https://reviews.llvm.org/D64940
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366486
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 18 Jul 2019 19:55:42 +0000 (19:55 +0000)]
[ORC] Suppress an ORCv1 deprecation warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366485
91177308-0d34-0410-b5e6-
96231b3b80d8
Raphael Isemann [Thu, 18 Jul 2019 18:33:40 +0000 (18:33 +0000)]
Fix C++ modules build
llvm-svn: 366344 missed an include that broke the LLVM_ENABLE_MODULES
build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366481
91177308-0d34-0410-b5e6-
96231b3b80d8
Amy Huang [Thu, 18 Jul 2019 18:22:52 +0000 (18:22 +0000)]
[COFF] Change a variable type to be const in the HeapAllocSite map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366479
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin P. Neal [Thu, 18 Jul 2019 18:01:57 +0000 (18:01 +0000)]
[FPEnv] Teach the IRBuilder about constrained FPTrunc and FPExt
The IRBuilder doesn't know that FPTrunc and FPExt have constrained
equivalents. Add the support by building on the strict FP mode now
present in the IRBuilder.
Reviewed by: John McCall
Approved by: John McCall
Differential Revision: https://reviews.llvm.org/D64934
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366477
91177308-0d34-0410-b5e6-
96231b3b80d8
Guanzhong Chen [Thu, 18 Jul 2019 17:53:22 +0000 (17:53 +0000)]
[WebAssembly] Implement __builtin_wasm_tls_base intrinsic
Summary:
Add `__builtin_wasm_tls_base` so that LeakSanitizer can find the thread-local
block and scan through it for memory leaks.
Reviewers: tlively, aheejin, sbc100
Subscribers: dschuff, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D64900
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366475
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 18 Jul 2019 17:30:27 +0000 (17:30 +0000)]
[LAA] Re-check bit-width of pointers after stripping.
Summary:
- As the pointer stripping now tracks through `addrspacecast`, prepare
to handle the bit-width difference from the result pointer.
Reviewers: jdoerfert
Subscribers: jvesely, nhaehnle, hiraditya, arphaman, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64928
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366470
91177308-0d34-0410-b5e6-
96231b3b80d8
Yuanfang Chen [Thu, 18 Jul 2019 17:04:28 +0000 (17:04 +0000)]
[NFC][llvm-readobj] Refactor dynamic string table indexing into a function.
Restore printDynamicString removed in rL363868. It provides better
error handling whenever indexing dynamic string table is needed.
Reviewers: jhenderson, MaskRay, grimar
Reviewed by: jhenderson, MaskRay, grimar
Differential Revision: https://reviews.llvm.org/D64674
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366464
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 18 Jul 2019 16:54:33 +0000 (16:54 +0000)]
MC: AArch64: Add support for prel_g* relocation specifiers.
Differential Revision: https://reviews.llvm.org/D64683
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366462
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 18 Jul 2019 16:51:53 +0000 (16:51 +0000)]
AArch64: Unify relocation restrictions between MOVK/MOVN/MOVZ.
There doesn't seem to be a practical reason for these instructions to have
different restrictions on the types of relocations that they may be used
with, notwithstanding the language in the ELF AArch64 spec that implies that
specific relocations are meant to be used with specific instructions.
For example, we currently forbid the first instruction in the following
sequence, despite it currently being used by clang to generate a global
reference under -mcmodel=large:
movz x0, #:abs_g0_nc:foo
movk x0, #:abs_g1_nc:foo
movk x0, #:abs_g2_nc:foo
movk x0, #:abs_g3:foo
Therefore, allow MOVK/MOVN/MOVZ to accept the union of the set of relocations
that they currently accept individually.
Differential Revision: https://reviews.llvm.org/D64466
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366461
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 18 Jul 2019 16:14:22 +0000 (16:14 +0000)]
Minor styling fix. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366456
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Thu, 18 Jul 2019 15:17:42 +0000 (15:17 +0000)]
[CMake] Don't set Python_ADDITIONAL_VERSIONS
Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's
Python support to 2.7. Now that both LLVM and LLDB both support Python
3, there's no longer a need to put an arbitrary limit on this.
However, instead of removing the variable, r365692 expanded the list,
which has the (presumably unintentional) side-effect of expression
preference for Python 3.
Instead, as Michal proposed in the original code review, we should just
not set the list at all, and let CMake pick whatever Python interpreter
you have in your path.
This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm,
clang and lld. I've also updated the docs with the default behavior and
how to force a different Python version to be used.
Differential revision: https://reviews.llvm.org/D64894
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366447
91177308-0d34-0410-b5e6-
96231b3b80d8
Hsiangkai Wang [Thu, 18 Jul 2019 15:06:50 +0000 (15:06 +0000)]
Revert "[DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame."
This reverts commit
17e3cbf5fe656483d9016d0ba9e1d0cd8629379e.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366444
91177308-0d34-0410-b5e6-
96231b3b80d8
Hsiangkai Wang [Thu, 18 Jul 2019 14:47:34 +0000 (14:47 +0000)]
[DebugInfo] Generate fixups as emitting DWARF .debug_frame/.eh_frame.
It is necessary to generate fixups in .debug_frame or .eh_frame as
relaxation is enabled due to the address delta may be changed after
relaxation.
There is an opcode with 6-bits data in debug frame encoding. So, we
also need 6-bits fixup types.
Differential Revision: https://reviews.llvm.org/D58335
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366442
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 18 Jul 2019 14:33:25 +0000 (14:33 +0000)]
[X86] EltsFromConsecutiveLoads - support common source loads
This patch enables us to find the source loads for each element, splitting them into a Load and ByteOffset, and attempts to recognise consecutive loads that are in fact from the same source load.
A helper function, findEltLoadSrc, recurses to find a LoadSDNode and determines the element's byte offset within it. When attempting to match consecutive loads, byte offsetted loads then attempt to matched against a previous load that has already been confirmed to be a consecutive match.
Next step towards PR16739 - after this we just need to account for shuffling/repeated elements to create a vector load + shuffle.
Differential Revision: https://reviews.llvm.org/D64551
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366441
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 18 Jul 2019 13:45:53 +0000 (13:45 +0000)]
[DAGCombine] Pull getSubVectorSrc helper out of narrowInsertExtractVectorBinOp. NFCI.
NFC step towards reusing this in other EXTRACT_SUBVECTOR combines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366435
91177308-0d34-0410-b5e6-
96231b3b80d8
Thomas Preud'homme [Thu, 18 Jul 2019 13:39:04 +0000 (13:39 +0000)]
[FileCheck] Fix numeric variable redefinition
Summary:
Commit r365249 changed usage of FileCheckNumericVariable to have one
instance of that class per variable as opposed to one instance per
definition of a given variable as was done before. However, it retained
the safety check in setValue that it should only be called with the
variable unset, even after r365625.
However this causes assert failure when a non-pseudo variable is being
redefined. And while redefinition of @LINE at each CHECK line work in
the general case, it caused problem when a substitution failed (fixed in
r365624) and still causes problem when a CHECK line does not match since
@LINE's value is cleared after substitutions in match() happened but
printSubstitutions also attempts a substitution.
This commit solves the root of the problem by changing setValue to set a
new value regardless of whether a value was set or not, thus fixing all
the aforementioned issues.
Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk
Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64882
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366434
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 18 Jul 2019 12:48:01 +0000 (12:48 +0000)]
[x86] try harder to form LEA from ADD to avoid flag conflicts (PR40483)
LEA doesn't affect flags, so use it more liberally to replace an ADD when
we know that the ADD operands affect flags.
In the motivating example from PR40483:
https://bugs.llvm.org/show_bug.cgi?id=40483
...this lets us avoid duplicating a math op just to avoid flag conflict.
As mentioned in the TODO comments, this heuristic can be extended to
fire more often if that leads to more improvements.
Differential Revision: https://reviews.llvm.org/D64707
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366431
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Thu, 18 Jul 2019 12:14:36 +0000 (12:14 +0000)]
[llvm-readelf] - Remove the precompiled binary from gnu-hash-symbols.test
I am working on https://bugs.llvm.org/show_bug.cgi?id=42622
and this patch reworks the gnu-hash-symbols.test so that it
will be easier to expand it with x86_64 case.
Differential revision: https://reviews.llvm.org/D64750
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366430
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 18 Jul 2019 11:51:05 +0000 (11:51 +0000)]
Bump the trunk version to 10.0.0svn
and clear the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366427
91177308-0d34-0410-b5e6-
96231b3b80d8
Diogo N. Sampaio [Thu, 18 Jul 2019 10:05:56 +0000 (10:05 +0000)]
[ARM][DAGCOMBINE][FIX] PerformVMOVRRDCombine
Summary:
PerformVMOVRRDCombine ommits adding a offset
of 4 to the PointerInfo, when converting a
f64 = load[M]
to
{i32, i32} = {load[M], load[M + 4]}
Which would allow the machine scheduller
to break dependencies with the second load.
- pr42638
Reviewers: eli.friedman, dmgreen, ostannard
Reviewed By: ostannard
Subscribers: ostannard, javed.absar, kristof.beyls, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64870
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366423
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Zheng [Thu, 18 Jul 2019 09:23:19 +0000 (09:23 +0000)]
[SCEV] add no wrap flag for SCEVAddExpr.
Differential Revision: https://reviews.llvm.org/D64868
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366419
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 18 Jul 2019 07:52:41 +0000 (07:52 +0000)]
[RISCV] Reset NoPHIS MachineFunctionProperty in emitSelectPseudo
We insered PHIS were there were none before, so the property must be
reset. This error was found on an EXPENSIVE_CHECKS build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366412
91177308-0d34-0410-b5e6-
96231b3b80d8
Serguei Katkov [Thu, 18 Jul 2019 07:36:20 +0000 (07:36 +0000)]
[LoopInfo] Use early return in branch weight update functions. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366411
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 18 Jul 2019 07:25:56 +0000 (07:25 +0000)]
[RISCV][DebugInfo] Fix dwarf-riscv-relocs.ll test on Windows
Windows sees DW_AT_decl_file (".\dwarf-riscv-relocs.c") while Linux sees
DW_AT_decl_file ("./dwarf-riscv-relocs.c").
This fixes a failure introduced in rL366402.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366410
91177308-0d34-0410-b5e6-
96231b3b80d8
Kang Zhang [Thu, 18 Jul 2019 06:56:49 +0000 (06:56 +0000)]
[NFC][PowerPC] Add the test to test the pass block-placement
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366407
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 18 Jul 2019 06:18:06 +0000 (06:18 +0000)]
[X86] Disable combineConcatVectors for vXi1 vectors.
I'm not convinced the code this calls is properly vetted for
vXi1 vectors. Experimental vector widening legalization testing
for D55251 is now hitting an assertion failure inside
EltsFromConsecutiveLoads. This is occurring from a v2i1 load
having a store size different than its VT size. Hopefully
this commit will keep such issues from happening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366405
91177308-0d34-0410-b5e6-
96231b3b80d8
Nathan Lanza [Thu, 18 Jul 2019 05:24:22 +0000 (05:24 +0000)]
Fix typo in programmer's manual cantFile -> cantFail
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366403
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 18 Jul 2019 05:22:55 +0000 (05:22 +0000)]
[DWARF][RISCV] Add support for RISC-V relocations needed for debug info
When code relaxation is enabled many RISC-V fixups are not resolved but
instead relocations are emitted. This happens even for DWARF debug
sections. Therefore, to properly support the parsing of DWARF debug info
we need to be able to resolve RISC-V relocations. This patch adds:
* Support for RISC-V relocations in RelocationResolver
* DWARF support for two relocations per object file offset
* DWARF changes to support relocations in more DIE fields
The two relocations per offset change is needed because some RISC-V
relocations (used for label differences) come in pairs.
Relocations can also be emitted for DWARF fields where relocations were
not yet evaluated. Adding relocation support for some of these fields is
essencial. On the other hand, LLVM currently emits RISC-V relocations
for fixups that could be safely evaluated, since they can never be
affected by code relaxations. This patch also adds relocation support
for the fields affected by those extraneous relocations (the DWARF unit
entry Length, and the DWARF debug line entry TotalLength and
PrologueLength), for testing purposes.
Differential Revision: https://reviews.llvm.org/D62062
Patch by Luís Marques.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366402
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 18 Jul 2019 04:05:18 +0000 (04:05 +0000)]
[RISCV] Re-land r366331 d RISCV to LLVM_ALL_TARGETS
*San flagged issues should be now be addressed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366399
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 18 Jul 2019 04:02:58 +0000 (04:02 +0000)]
[RISCV] Avoid signed integer overflow UB in RISCVMatInt::generateInstSeq
Found by UBSan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366398
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Bradbury [Thu, 18 Jul 2019 03:23:47 +0000 (03:23 +0000)]
[RISCV] Don't acccess an invalidated iterator in RISCVInstrInfo::removeBranch
Issue found by ASan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366397
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Thu, 18 Jul 2019 01:53:08 +0000 (01:53 +0000)]
[AArch64] Add dependency from AArch64CodeGen to TransformUtils to fix -DBUILD_SHARED_LIBS=on link error after D64173/r366361
This fixes:
ld.lld: error: undefined symbol: llvm::findAllocaForValue(llvm::Value*, llvm::DenseMap<llvm::Value*, llvm::Alloc aInst*, llvm::DenseMapInfo<llvm::Value*>, llvm::detail::DenseMapPair<llvm::Value*, llvm::AllocaInst*> >&)
>>> referenced by AArch64StackTagging.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366396
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Thu, 18 Jul 2019 00:26:03 +0000 (00:26 +0000)]
[Tests] Add a test showing how we handle overaligned allocas w/ no-realign-stack
(At the moment, we ignore the alignment requirement.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366393
91177308-0d34-0410-b5e6-
96231b3b80d8
Nilanjana Basu [Wed, 17 Jul 2019 23:43:58 +0000 (23:43 +0000)]
Changes to display code view debug info type records in hex format
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366390
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 17 Jul 2019 23:31:59 +0000 (23:31 +0000)]
Make DT a transitive dependency of LI.
Summary:
LoopInfoWrapperPass::verify uses DT, which means DT must be alive
even if it has no direct users.
Fixes a crash in expensive checks mode.
Reviewers: pcc, leonardchan
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64896
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366388
91177308-0d34-0410-b5e6-
96231b3b80d8
Denis Bakhvalov [Wed, 17 Jul 2019 23:28:39 +0000 (23:28 +0000)]
[llvm-bcanalyzer] Fixed error 'Expected<T> must be checked before access or destruction'
After rL365286 I had failing test:
LLVM :: tools/gold/X86/v1.12/thinlto_emit_linked_objects.ll
It was failing with the output:
$ llvm-bcanalyzer --dump llvm/test/tools/gold/X86/v1.12/Output/thinlto_emit_linked_objects.ll.tmp3.o.thinlto.bc
Expected<T> must be checked before access or destruction.
Unchecked Expected<T> contained error:
Unexpected end of file reading 0 of 0 bytesStack dump:
Change-Id: I07e03262074ea5e0aae7a8d787d5487c87f914a2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366387
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Wed, 17 Jul 2019 22:59:52 +0000 (22:59 +0000)]
llvm-pdbdump: Fix several smaller issues with injected source compression handling
- getCompression() used to return a PDB_SourceCompression even though
the docs for IDiaInjectedSource are explicit about the return value
being compiler-dependent. Return an uint32_t instead, and make the
printing code handle unknown values better by printing "Unknown" and
the int value instead of not printing any compression.
- Print compressed contents as hex dump, not as string.
- Add compression type "DotNet", which is used (at least) by csc.exe,
the C# compiler. Also add a lengthy comment describing the stream
contents (derived from looking at the raw hex contents long enough
to see the GUIDs, which led me to the roslyn and mono implementations
for handling this).
- The native injected source dumper was dumping the contents of the
whole data stream -- but csc.exe writes a stream that's padded with
zero bytes to the next 512 boundary, and the dia api doesn't display
those padding bytes. So make NativeInjectedSource::getCode() do the
same thing.
Differential Revision: https://reviews.llvm.org/D64879
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366386
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Wed, 17 Jul 2019 22:58:43 +0000 (22:58 +0000)]
[AMDGPU] Simplify AMDGPUInstPrinter::printRegOperand()
Differential Revision: https://reviews.llvm.org/D64892
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366385
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 17 Jul 2019 22:41:53 +0000 (22:41 +0000)]
AMDGPU: Set inaccessiblememonly on sendmsg intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366384
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 17 Jul 2019 22:26:00 +0000 (22:26 +0000)]
[X86] Make sure we mark 128/256 MLOAD as Legal with VLX when min-legal-vector-width=256 is in effect.
This started triggering an assertion after r364718 when we made
these Custom under AVX2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366382
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 17 Jul 2019 21:45:34 +0000 (21:45 +0000)]
gn build: Merge r366361.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366380
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Wed, 17 Jul 2019 21:45:19 +0000 (21:45 +0000)]
hwasan: Initialize the pass only once.
This will let us instrument globals during initialization. This required
making the new PM pass a module pass, which should still provide access to
analyses via the ModuleAnalysisManager.
Differential Revision: https://reviews.llvm.org/D64843
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366379
91177308-0d34-0410-b5e6-
96231b3b80d8
Stanislav Mekhanoshin [Wed, 17 Jul 2019 21:35:11 +0000 (21:35 +0000)]
[AMDGPU] Stop special casing flat_scratch for register name
Differential Revision: https://reviews.llvm.org/D64885
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366376
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 17 Jul 2019 21:27:44 +0000 (21:27 +0000)]
Speculative fix for stack-tagging.ll failure.
Depending on the evaluation order of function call arguments,
the current code may insert a use before def.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366375
91177308-0d34-0410-b5e6-
96231b3b80d8
Hideto Ueno [Wed, 17 Jul 2019 21:11:02 +0000 (21:11 +0000)]
[Attributor][NFC] Remove unnecessary debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366373
91177308-0d34-0410-b5e6-
96231b3b80d8
Nilanjana Basu [Wed, 17 Jul 2019 21:01:12 +0000 (21:01 +0000)]
Adding inline comments to code view type record directives for better readability
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366372
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:19 +0000 (20:46 +0000)]
[PEI] Don't re-allocate a pre-allocated stack protector slot
The LocalStackSlotPass pre-allocates a stack protector and makes sure
that it comes before the local variables on the stack.
We need to make sure that later during PEI we don't re-allocate a new
stack protector slot. If that happens, the new stack protector slot will
end up being **after** the local variables that it should be protecting.
Therefore, we would have two slots assigned for two different stack
protectors, one at the top of the stack, and one at the bottom. Since
PEI will overwrite the assigned slot for the stack protector, the load
that is used to compare the value of the stack protector will use the
slot assigned by PEI, which is wrong.
For this, we need to check if the object is pre-allocated, and re-use
that pre-allocated slot.
Differential Revision: https://reviews.llvm.org/D64757
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366371
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:16 +0000 (20:46 +0000)]
[CodeGen] Add stack protector tests where the guard gets re-assigned
In preparation of a fix, add tests for multiple backends.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366370
91177308-0d34-0410-b5e6-
96231b3b80d8
Francis Visoiu Mistrih [Wed, 17 Jul 2019 20:46:09 +0000 (20:46 +0000)]
[CodeGen][NFC] Simplify checks for stack protector index checking
Use `hasStackProtectorIndex()` instead of `getStackProtectorIndex() >=
0`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366369
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 17 Jul 2019 20:22:44 +0000 (20:22 +0000)]
GlobalISel: Handle widenScalar of arbitrary G_MERGE_VALUES sources
Extract the sources to the GCD of the original size and target size,
padding with implicit_def as necessary.
Also fix the case where the requested source type is wider than the
original result type. This was ignoring the type, and just using the
destination. Do the operation in the requested type and truncate back.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366367
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 17 Jul 2019 20:22:38 +0000 (20:22 +0000)]
GlobalISel: Handle more cases for widenScalar of G_MERGE_VALUES
Use an anyext to the requested type for the leftover operand to
produce a slightly wider type, and then truncate the final merge.
I have another implementation almost ready which handles arbitrary
widens, but I think it produces worse code in this example (which I
think is 90% due to not folding redundant copies or folding out
implicit_def users), so I wanted to add this as a baseline first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366366
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 17 Jul 2019 19:24:12 +0000 (19:24 +0000)]
Basic MTE stack tagging instrumentation.
Summary:
Use MTE intrinsics to tag stack variables in functions with
sanitize_memtag attribute.
Reviewers: pcc, vitalybuka, hctim, ostannard
Subscribers: srhines, mgorny, javed.absar, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64173
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366361
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Wed, 17 Jul 2019 19:24:02 +0000 (19:24 +0000)]
Basic codegen for MTE stack tagging.
Implement IR intrinsics for stack tagging. Generated code is very
unoptimized for now.
Two special intrinsics, llvm.aarch64.irg.sp and llvm.aarch64.tagp are
used to implement a tagged stack frame pointer in a virtual register.
Differential Revision: https://reviews.llvm.org/D64172
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366360
91177308-0d34-0410-b5e6-
96231b3b80d8