Commit Graph

182798 Commits

Author SHA1 Message Date
Fangrui Song db26488bf9 [DWARF] Change DWARFDebugLoc::Entry::Loc from SmallVector<char, 4> to SmallString<4>
SmallString has a conversion to StringRef, which can be leveraged to
simplify two use sites.

llvm-svn: 367801
2019-08-05 06:33:52 +00:00
Fangrui Song d9b948b6eb Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFC
F_{None,Text,Append} are kept for compatibility since r334221.

llvm-svn: 367800
2019-08-05 05:43:48 +00:00
Craig Topper 635f5ff580 [X86] Fix a bad early out in combineExtInVec that prevented recursive shuffle combining from running with -x86-experimental-vector-widening-legalization.
llvm-svn: 367798
2019-08-05 03:48:31 +00:00
Nico Weber 2ca1548299 gn build: Merge r367756
llvm-svn: 367795
2019-08-04 23:34:27 +00:00
Johannes Doerfert 305b961f64 [Attributor][NFC] Create some attributes earlier
llvm-svn: 367793
2019-08-04 18:40:01 +00:00
Johannes Doerfert 6471bb6f18 [Attributor][NFC] Improve debug output
llvm-svn: 367792
2019-08-04 18:39:28 +00:00
Johannes Doerfert 4361da24ac [Attributor][Fix] Resolve various liveness issues
Summary:
This contains various fixes:
  - Explicitly determine and return the next noreturn instruction.
  - If an invoke calls a noreturn function which is not nounwind we
    keep the unwind destination live. This also means we require an
    invoke. Though we can still add the unreachable to the normal
    destination block.
  - Check if the return instructions are dead after we look for calls
    to avoid triggering an optimistic fixpoint in the presence of
    assumed liveness information.
  - Make the interface work with "const" pointers.
  - Some simplifications

While additional tests are included, full coverage is achieved only with
D59978.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367791
2019-08-04 18:38:53 +00:00
Johannes Doerfert d1c3793563 [Attributor][NFC] Simplify common pattern wrt. fixpoints
When a fixpoint is indicated the change status is known due to the
fixpoint kind. This simplifies a common code pattern by making the
connection explicit.

llvm-svn: 367790
2019-08-04 18:37:38 +00:00
Johannes Doerfert b6acee5c7b [Attributor][NFC] Invalid DerefState is at fixpoint
Summary:
If the DerefBytesState (and thereby the DerefState) is invalid, we
reached a fixpoint for the whole DerefState as we will not
manifest/provide information then.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367789
2019-08-04 17:55:15 +00:00
Craig Topper 5a4989e2ac [TargetLowering][X86] Teach SimplifyDemandedVectorElts to replace the base vector of INSERT_SUBVECTOR with undef if none of the elements are demanded even if the node has other users.
Summary:
The SimplifyDemandedVectorElts function can replace with undef
when no elements are demanded, but due to how it interacts with
TargetLoweringOpts, it can only do this when the node has
no other users.

Remove a now unneeded DAG combine from the X86 backend.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367788
2019-08-04 17:30:41 +00:00
Simon Pilgrim 295f99265b Regenerate test for an upcoming patch.
I managed to use the update_llc_test_checks script for this, but had to set -asm-verbose=true and then manually tweak the result (PR42882)

llvm-svn: 367787
2019-08-04 16:37:29 +00:00
Simon Pilgrim 6d2e8eb9ca [UpdateTestChecks] Add end_function directive to regex matcher for wasm32 function body
llvm-svn: 367786
2019-08-04 16:28:37 +00:00
Simon Pilgrim 436fd52a71 [X86] lowerShuffleAsSpecificZeroOrAnyExtend - use undef PSHUFB mask indices for ANY_EXTEND shuffles
llvm-svn: 367784
2019-08-04 13:15:23 +00:00
Simon Pilgrim c5891eaa34 Fix signed/unsigned comparison warning. NFC.
llvm-svn: 367783
2019-08-04 12:48:19 +00:00
Simon Pilgrim e16901844d [X86] SimplifyMultipleUseDemandedBits - Add target shuffle support
llvm-svn: 367782
2019-08-04 12:24:40 +00:00
Benjamin Kramer 6f0ac30ae1 [ORC] Remove a layer of indirection when locking the mutex. NFCI.
llvm-svn: 367781
2019-08-04 11:08:32 +00:00
David Green 91296295d0 [ARM] MVE big endian bitcasts
This adds big endian MVE patterns for bitcasts. They are defined in llvm as
being the same as a store of the existing type and the load into the new. This
means that they have to become a VREV between the two types, working in the
same way that NEON works in big-endian. This also adds some example tests for
bigendian, showing where code is and isn't different.

The main difference, especially from a testing perspective is that vectors are
passed as v2f64, and so are VREV into and out of call arguments, and the
parameters are passed in a v2f64 format. Same happens for inline assembly where
the register class is used, so it is VREV to a v16i8.

So some of this is probably not correct yet, but it is (mostly) self-consistent
and seems to be consistent with how llvm treats vectors. The rest we can
hopefully fix later. More details about big endian neon can be found in
https://llvm.org/docs/BigEndianNEON.html.

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

llvm-svn: 367780
2019-08-04 10:18:15 +00:00
Michael Pozulp d34099926e [llvm-objdump] Re-commit r367284.
Add warning messages if disassembly + source for problematic inputs

Summary: Addresses https://bugs.llvm.org/show_bug.cgi?id=41905

Reviewers: jhenderson, rupprecht, grimar

Reviewed By: jhenderson, grimar

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367776
2019-08-04 06:04:00 +00:00
Craig Topper 0fff1e4f3d [X86] Consistently use MVT::i8 for the constant operand of BLENDI and INSERTPS nodes.
This is the type listed in the type constraint for isel. But since
we list a type there, it doesn't get checked during isel matching.

llvm-svn: 367775
2019-08-04 06:01:31 +00:00
Craig Topper 76f0f2e0f0 [SelectionDAG] Add node creation debug message to getMemIntrinsicNode.
llvm-svn: 367771
2019-08-04 02:32:06 +00:00
Yonghong Song 44b16bd4a5 [Transforms] Do not drop !preserve.access.index metadata
Currently, when a GVN or CSE optimization happens,
the llvm.preserve.access.index metadata is dropped.
This caused a problem for BPF AbstructMemberOffset phase
as it relies on the metadata (debuginfo types).

This patch added proper hooks in lib/Transforms to
preserve !preserve.access.index metadata. A test
case is added to ensure metadata is preserved under CSE.

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

llvm-svn: 367769
2019-08-03 23:41:26 +00:00
Craig Topper 2edeb8a11a [DAGCombiner] Prevent the combine added in r367710 from creating illegal types after type legalization.
This is further fix for PR42880.

Sanjay already disabled the X86 TLI hook for non-simple types,
but we should really call isTypeLegal here if we're after type
legalization.

llvm-svn: 367768
2019-08-03 23:09:13 +00:00
Lang Hames fe37499207 [JITLink] Fix an overly-wide read in the MachO/x86-64 test case.
This should fix the build failures on some of the 32-bit bots.

llvm-svn: 367767
2019-08-03 22:38:31 +00:00
Sanjay Patel c9171bd0a9 [x86] change free truncate hook to handle only simple types (PR42880)
This avoids the crash from:
https://bugs.llvm.org/show_bug.cgi?id=42880
...and I think it's a proper constraint for the TLI hook.

But that example raises questions about what happens to get us
into this situation (created i29 types) and what happens later
(why does legalization die on those types), so I'm not sure if
we will resolve the bug based on this change.

llvm-svn: 367766
2019-08-03 21:46:27 +00:00
Keno Fischer 3c805d125a [WebAssembly] Fix allocsize attribute in sjlj lowering
Summary:
The allocsize attribute refers to call parameters by index.
Thus, when we add the extra parameter in sjlj lowering, we
need to increment the referenced paramater in the allocsize
attribute to avoid angering the Verifier.

Reviewed By: aheejin
Differential Revision: https://reviews.llvm.org/D65470

llvm-svn: 367765
2019-08-03 21:38:19 +00:00
Lang Hames 3daccaac8a [JITLink] Add support for MachO/x86-64 UNSIGNED relocs with length=2.
MachO/x86-64 UNSIGNED relocs are almost always 64-bit (length=3), but UNSIGNED
relocs of length=2 are allowed if the target resides in the low 32-bits. This
patch adds support for such relocations in JITLink (previously they would have
triggered an unsupported relocation error).

llvm-svn: 367764
2019-08-03 20:17:10 +00:00
Lang Hames b31229af4f [JITLink] Fix error message formatting.
llvm-svn: 367763
2019-08-03 20:17:08 +00:00
Mehdi Amini 4197d1c366 Fixup r367321 "Ask confirmation when `git llvm push` will push multiple commits"
I unfortunately commited an obsolete revision in r367321 that didn't
have all the changes the reviewers suggested.

llvm-svn: 367761
2019-08-03 18:53:52 +00:00
Hubert Tong 43e60ba8c3 [yaml2obj][tests] Replace 8-byte `od` conversion with 1-byte conversion
Summary:
`od` on AIX does not seem to implement 8-byte integer conversions. Work
around this by using 1-byte conversions, which can be used in this case
since the value is byte-order insensitive.

Reviewers: grimar, daltenty, xingxue, jasonliu, MaskRay

Reviewed By: grimar, MaskRay

Subscribers: MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 367760
2019-08-03 18:52:45 +00:00
Tim Northover 71b447605a IR: Cleanup after test to silence ASAN builds
llvm-svn: 367758
2019-08-03 15:40:00 +00:00
Stefan Stipanovic 7849e41635 [Attributor][NFC] run clang-format on Attributor.cpp
llvm-svn: 367757
2019-08-03 15:27:41 +00:00
Praveen Velliengiri f5c40cb900 Speculative Compilation
[ORC] Remove Speculator Variants for Different Program Representations

[ORC] Block Freq Analysis

Speculative Compilation with Naive Block Frequency

Add Applications to OrcSpeculation

ORC v2 with Block Freq Query & Example

Deleted BenchMark Programs

Signed-off-by: preejackie <praveenvelliengiri@gmail.com>

ORCv2 comments resolved

[ORCV2] NFC

ORCv2 NFC

[ORCv2] Speculative compilation - CFGWalkQuery

ORCv2 Adapting IRSpeculationLayer to new locking scheme

llvm-svn: 367756
2019-08-03 14:42:13 +00:00
Tim Northover a009a60a91 IR: print value numbers for unnamed function arguments
For consistency with normal instructions and clarity when reading IR,
it's best to print the %0, %1, ... names of function arguments in
definitions.

Also modifies the parser to accept IR in that form for obvious reasons.

llvm-svn: 367755
2019-08-03 14:28:34 +00:00
Sylvestre Ledru 6bf861298a Finish moving TargetRegisterInfo::isVirtualRegister() and friends to llvm::Register as started by r367614. NFC
llvm-svn: 367754
2019-08-03 13:51:58 +00:00
Nikita Popov 4f8259bdbc [Thumb] Fix invalid symbol redefinition due to duplicated jumptable (PR42760)
Fix for https://bugs.llvm.org/show_bug.cgi?id=42760. A tBR_JTr
instruction is duplicated by tail duplication, which results in
the same jumptable with the same label being emitted twice.

Fix this by marking tBR_JTr as not duplicable. The corresponding
ARM/Thumb instructions are already marked as not duplicable.
Additionally also mark tTBB_JT and tTBH_JT to be consistent with
Thumb2, even though this shouldn't be strictly necessary.

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

llvm-svn: 367753
2019-08-03 06:47:23 +00:00
Joel E. Denny a67d81e4e2 [lit] Print internal env commands
Without this patch, the internal `env` command removes `env` and its
args from the command line while parsing it.  This patch modifies a
copy instead so that the original command line is printed.

Reviewed By: stella.stamenova, rnk

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

llvm-svn: 367752
2019-08-03 06:08:19 +00:00
Joel E. Denny 2c5a60f1dc [lit] Actually run tests for internal env command
Put the main test script in the right directory, and fix a python bug
in a local script.

Reviewed By: stella.stamenova

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

llvm-svn: 367751
2019-08-03 06:08:04 +00:00
Bill Wendling 41a2847a9a Emit diagnostic if an inline asm constraint requires an immediate
Summary:
An inline asm call can result in an immediate after inlining. Therefore emit a
diagnostic here if constraint requires an immediate but one isn't supplied.

Reviewers: joerg, mgorny, efriedma, rsmith

Reviewed By: joerg

Subscribers: asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, s.egerton, MaskRay, jyknight, dylanmckay, javed.absar, fedor.sergeev, jrtc27, Jim, krytarowski, eraman, llvm-commits

Tags: #llvm

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

llvm-svn: 367750
2019-08-03 05:52:47 +00:00
Hideto Ueno 96bb347205 [Attributor] Fix dereferenceable callsite argument initialization
llvm-svn: 367748
2019-08-03 04:10:50 +00:00
Craig Topper aa2810b6e7 [InstSimplify] Add test case to show bad sign bit handling for integer abs idiom in computeKnownBits.
computeKnownBits will indicate the sign bit of abs is 0 if the
the RHS operand returned by matchSelectPattern has the nsw flag set.
For abs idioms like (X >= 0) ? X : -X, the RHS returns -X. But
we can also match ((X-Y) >= 0 ? X-Y : Y-X as abs. In this case
RHS will be the Y-X operand. According to Alive, the sign bit for
this is only 0 if both the X-Y and Y-X operands have the nsw flag.
But we're only checking the Y-X operand.

llvm-svn: 367747
2019-08-03 02:54:54 +00:00
Daniel Sanders 00879c3e87 MCRegister/Register: DenseMapInfo should take `const T &`
llvm-svn: 367744
2019-08-03 02:19:23 +00:00
Lang Hames 38136d3b96 [ORC] Remove some old debugging output from a unit test.
llvm-svn: 367742
2019-08-03 01:33:04 +00:00
Eric Christopher 9e0f2c2d9d Temporarily Revert "[PowerPC][NFC][MachinePipeliner] Add some regression testcases"
It's breaking a number of bots, e.g.:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/13893/steps/check-llvm%20msan/logs/stdio

This reverts commit r367732.

llvm-svn: 367741
2019-08-03 01:12:55 +00:00
Bill Wendling 383650c7f1 Add brackets to remove warnings about ambiguous 'else's.
llvm-svn: 367740
2019-08-03 00:26:10 +00:00
Amara Emerson c835164a47 Re-commit "[GlobalISel] Add legalization support for non-power-2 loads and stores""
This is an old commit that exposed a bug in the GISel importer, which caused
non-truncating stores to be selected for truncating store patterns. Now that's
been fixed in r367737 this can go back in.

llvm-svn: 367739
2019-08-02 23:44:24 +00:00
Craig Topper b1cfcd1a56 [ScalarizeMaskedMemIntrin] Bitcast the mask to the scalar domain and use scalar bit tests for the branches for expandload/compressstore.
Same as what was done for gather/scatter/load/store in r367489.
Expandload/compressstore were delayed due to lack of constant
masking handling that has since been fixed.

llvm-svn: 367738
2019-08-02 23:43:53 +00:00
Amara Emerson 52e6d52f10 [GlobalISel] Check LLT size matches memory size for non-truncating stores.
This was causing a bug where non-truncating stores would be selected instead of truncating ones.

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

llvm-svn: 367737
2019-08-02 23:33:13 +00:00
Craig Topper 45ea25289d [X86] Use the pointer VT for the Scale node when lowering x86 gather/scatter intrinsics.
This is consistent with the target independent intrinsic handling.

Not sure this really matters since we just pull the constant out
using getZExtValue later.

llvm-svn: 367736
2019-08-02 23:18:16 +00:00
Yonghong Song 37d24a696b [BPF] Handling type conversions correctly for CO-RE
With newly added debuginfo type
metadata for preserve_array_access_index() intrinsic,
this patch did the following two things:
 (1). checking validity before adding a new access index
      to the access chain.
 (2). calculating access byte offset in IR phase
      BPFAbstractMemberAccess instead of when BTF is emitted.

For (1), the metadata provided by all preserve_*_access_index()
intrinsics are used to check whether the to-be-added type
is a proper struct/union member or array element.

For (2), with all available metadata, calculating access byte
offset becomes easier in BPFAbstractMemberAccess IR phase.
This enables us to remove the unnecessary complexity in
BTFDebug.cpp.

New tests are added for
  . user explicit casting to array/structure/union
  . global variable (or its dereference) as the source of base
  . multi demensional arrays
  . array access given a base pointer
  . cases where we won't generate relocation if we cannot find
    type name.

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

llvm-svn: 367735
2019-08-02 23:16:44 +00:00
JF Bastien 748dac7389 Remove support for unsupported MSVC versions
Re-land r367727 with the #if fixed.

Reviewers: rnk, lebedev.ri

Subscribers: hiraditya, jkorous, dexonsmith, lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 367734
2019-08-02 23:09:01 +00:00