]> granicus.if.org Git - llvm/log
llvm
6 years ago[X86] Use (SUBREG_TO_REG (MOV32rm)) for extloadi64i8/extloadi64i16 when the load...
Craig Topper [Sun, 7 Apr 2019 19:19:44 +0000 (19:19 +0000)]
[X86] Use (SUBREG_TO_REG (MOV32rm)) for extloadi64i8/extloadi64i16 when the load is 4 byte aligned or better and not volatile.

Summary:
Previously we would use MOVZXrm8/MOVZXrm16, but those are longer encodings.

This is similar to what we do in the loadi32 predicate.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357875 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ConstantRangeTest] Generalize intersection testing code; NFC
Nikita Popov [Sun, 7 Apr 2019 18:55:45 +0000 (18:55 +0000)]
[ConstantRangeTest] Generalize intersection testing code; NFC

Extract the exhaustive intersection tests into a separate function,
so that it may be reused for unions as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357874 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ConstantRange] Add unsigned and signed intersection types
Nikita Popov [Sun, 7 Apr 2019 18:44:36 +0000 (18:44 +0000)]
[ConstantRange] Add unsigned and signed intersection types

The intersection of two ConstantRanges may consist of two disjoint
ranges. As we can only return one range as the result, we need to
return one of the two possible ranges that cover both. Currently the
result is picked based on set size. However, this is not always
optimal: If we're in an unsigned context, we'd prefer to get a large
unsigned range over a small signed range -- the latter effectively
becomes a full set in the unsigned domain.

This revision adds a PreferredRangeType, which can be either Smallest,
Unsigned or Signed. Smallest is the current behavior and Unsigned and
Signed are new variants that prefer not to wrap the unsigned/signed
domain. The new type isn't used anywhere yet (but SCEV will be a good
first user, see D60035).

I've also added some comments to illustrate the various cases in
intersectWith(), which should hopefully make it more obvious what is
going on.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357873 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Allow Access to the Type of a Binary
Robert Widmann [Sun, 7 Apr 2019 18:18:42 +0000 (18:18 +0000)]
[LLVM-C] Allow Access to the Type of a Binary

Summary:  Add an accessor for the type of a binary file.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, aheejin, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357872 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ConstantRange] Add isAllNegative() and isAllNonNegative() methods
Nikita Popov [Sun, 7 Apr 2019 17:52:40 +0000 (17:52 +0000)]
[ConstantRange] Add isAllNegative() and isAllNonNegative() methods

Add isAllNegative() and isAllNonNegative() methods to ConstantRange,
which determine whether all values in the constant range are
negative/non-negative.

This is useful for replacing KnownBits isNegative() and isNonNegative()
calls when changing code to use constant ranges.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357871 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoReapply [ValueTracking] Support min/max selects in computeConstantRange()
Nikita Popov [Sun, 7 Apr 2019 17:22:16 +0000 (17:22 +0000)]
Reapply [ValueTracking] Support min/max selects in computeConstantRange()

Add support for min/max flavor selects in computeConstantRange(),
which allows us to fold comparisons of a min/max against a constant
in InstSimplify. This fixes an infinite InstCombine loop, with the
test case taken from D59378.

Relative to the previous iteration, this contains some adjustments for
AMDGPU med3 tests: The AMDGPU target runs InstSimplify prior to codegen,
which ends up constant folding some existing med3 tests after this
change. To preserve these tests a hidden -amdgpu-scalar-ir-passes option
is added, which allows disabling scalar IR passes (that use InstSimplify)
for testing purposes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357870 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Split disassembleObject and simplify --{start,stop}-address handling
Fangrui Song [Sun, 7 Apr 2019 16:33:24 +0000 (16:33 +0000)]
[llvm-objdump] Split disassembleObject and simplify --{start,stop}-address handling

The main disassembly loop is hard to read due to special handling of ARM
ELF data & ELF data. Split off the logic into two functions
dumpARMELFData and dumpELFData. Hoist some checks outside of the loop.

--start-address --stop-address have redundant checks and minor off-by-1
issues. Fix them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357869 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agolast changes for now
Chris Lattner [Sun, 7 Apr 2019 14:34:24 +0000 (14:34 +0000)]
last changes for now

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357868 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agovarious improvements in wording, also unbreak the bot
Chris Lattner [Sun, 7 Apr 2019 14:23:11 +0000 (14:23 +0000)]
various improvements in wording, also unbreak the bot

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357867 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] DWARFDebugLine: delete unused parameter `Offset`
Fangrui Song [Sun, 7 Apr 2019 13:56:14 +0000 (13:56 +0000)]
[DWARF] DWARFDebugLine: delete unused parameter `Offset`

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357866 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agomake a bunch of cleanups in wording and tone
Chris Lattner [Sun, 7 Apr 2019 13:42:29 +0000 (13:42 +0000)]
make a bunch of cleanups in wording and tone

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357865 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CostModel][X86] Masked load legalization requires an binary-shuffle not a select...
Simon Pilgrim [Sun, 7 Apr 2019 13:26:09 +0000 (13:26 +0000)]
[CostModel][X86] Masked load legalization requires an binary-shuffle not a select (PR39812)

Expansion/truncation is better described by SK_PermuteTwoSrc than SK_Select

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357864 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoremove some unhelpful language from the tutorial
Chris Lattner [Sun, 7 Apr 2019 13:17:16 +0000 (13:17 +0000)]
remove some unhelpful language from the tutorial

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357863 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoCopy the C++ kaleidoscope tutorial into a subdirectory and clean up various things...
Chris Lattner [Sun, 7 Apr 2019 13:14:23 +0000 (13:14 +0000)]
Copy the C++ kaleidoscope tutorial into a subdirectory and clean up various things, aligning with the direction of the WiCT workshop, and Meike Baumgärtner's view of how this should work.  The old version of the documentation is unmodified, this is an experiment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357862 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAG] Pull out ComputeNumSignBits call to make debugging easier. NFCI.
Simon Pilgrim [Sun, 7 Apr 2019 11:49:33 +0000 (11:49 +0000)]
[DAG] Pull out ComputeNumSignBits call to make debugging easier. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357861 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] SimplifyDemandedBitsForTargetNode - Add initial PACKSS support
Simon Pilgrim [Sun, 7 Apr 2019 10:40:01 +0000 (10:40 +0000)]
[X86][SSE] SimplifyDemandedBitsForTargetNode - Add initial PACKSS support

In the case where we only want the sign bit (e.g. when using PACKSS truncation of comparison results for MOVMSK) then we can just demand the sign bit of the source operands.

This makes use of the fact that PACKSS saturates out of range values to the min/max int values - so the sign bit is always preserved.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357859 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Fix split of source lines; don't ltrim source lines
Fangrui Song [Sun, 7 Apr 2019 10:16:46 +0000 (10:16 +0000)]
[llvm-objdump] Fix split of source lines; don't ltrim source lines

If the file does not end with a newline, it may be dropped. Fix the
splitting algorithm.

Also delete an unnecessary SourceCache lookup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357858 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Simplify some ELF typename: ELFFile<ELFT>::Elf_xxx -> ELFT::xxx
Fangrui Song [Sun, 7 Apr 2019 08:29:04 +0000 (08:29 +0000)]
[llvm-objdump] Simplify some ELF typename: ELFFile<ELFT>::Elf_xxx -> ELFT::xxx

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357857 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago.
Fangrui Song [Sun, 7 Apr 2019 08:28:56 +0000 (08:28 +0000)]
.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357856 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Simplify Expected<T> handling with unwrapOrError
Fangrui Song [Sun, 7 Apr 2019 08:19:55 +0000 (08:19 +0000)]
[llvm-objdump] Simplify Expected<T> handling with unwrapOrError

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357855 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ConstantRange] Shl considers full-set shifting to last bit position.
Marcello Maggioni [Sun, 7 Apr 2019 06:12:44 +0000 (06:12 +0000)]
[ConstantRange] Shl considers full-set shifting to last bit position.

if we do SHL of two 16-bit ranges like [0, 30000) with [1,2) we get
"full-set" instead of what I would have expected [0, 60000) which is
still in the 16-bit unsigned range.

This patch changes the SHL algorithm to allow getting a usable range
even in this case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357854 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-objdump] Simplify disassembleObject
Fangrui Song [Sun, 7 Apr 2019 05:32:16 +0000 (05:32 +0000)]
[llvm-objdump] Simplify disassembleObject

* Use std::binary_search to replace some std::lower_bound
* Use llvm::upper_bound to replace some std::upper_bound
* Use format_hex and support::endian::read{16,32}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357853 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoChange some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromString...
Fangrui Song [Sun, 7 Apr 2019 03:58:42 +0000 (03:58 +0000)]
Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357852 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[gn] Support for per-target runtime directory layout
Petr Hosek [Sat, 6 Apr 2019 23:05:56 +0000 (23:05 +0000)]
[gn] Support for per-target runtime directory layout

This change also introduces the clang_enable_per_target_runtime_dir
to enable the use of per-target runtime directory layout which is the
equivalent of LLVM_ENABLE_PER_TARGET_RUNTIME_DIR CMake option.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357850 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[NFC] Fix typo in comment.
Nick Lewycky [Sat, 6 Apr 2019 22:05:24 +0000 (22:05 +0000)]
[NFC] Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357849 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] When converting (x << C1) AND C2 to (x AND (C2>>C1)) << C1 during isel, try...
Craig Topper [Sat, 6 Apr 2019 19:00:11 +0000 (19:00 +0000)]
[X86] When converting (x << C1) AND C2 to (x AND (C2>>C1)) << C1 during isel, try using andl over andq by favoring 32-bit unsigned immediates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357848 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] combineBitcastvxi1 - provide dst VT and src SDValue directly. NFCI.
Simon Pilgrim [Sat, 6 Apr 2019 18:54:17 +0000 (18:54 +0000)]
[X86] combineBitcastvxi1 - provide dst VT and src SDValue directly. NFCI.

Prep work to make it easier to reuse the BITCAST->MOVSMK combine in other cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357847 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Use a signed mask in foldMaskedShiftToScaledMask to enable a shorter immediate...
Craig Topper [Sat, 6 Apr 2019 18:00:50 +0000 (18:00 +0000)]
[X86] Use a signed mask in foldMaskedShiftToScaledMask to enable a shorter immediate encoding.

This function reorders AND and SHL to enable the SHL to fold into an LEA. The
upper bits of the AND will be shifted out by the SHL so it doesn't matter what
mask value we use for these bits. By using sign bits from the original mask in
these upper bits we might enable a shorter immediate encoding to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357846 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add test cases to show missed opportunities to use a sign extended 8 or 32...
Craig Topper [Sat, 6 Apr 2019 18:00:45 +0000 (18:00 +0000)]
[X86] Add test cases to show missed opportunities to use a sign extended 8 or 32 bit immediate AND when reversing SHL+AND to form an LEA.

When we shift the AND mask over we should shift in sign bits instead of zero bits. The scale in the LEA will shift these bits out so it doesn't matter whether we mask the bits off or not. Using sign bits will potentially allow a sign extended immediate to be used.

Also add some other test cases for cases that are currently optimal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357845 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Sat, 6 Apr 2019 18:00:41 +0000 (18:00 +0000)]
[X86] Autogenerate complete checks. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357844 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix spelling mistake. NFCI.
Simon Pilgrim [Sat, 6 Apr 2019 15:38:34 +0000 (15:38 +0000)]
Fix spelling mistake. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357843 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add AVX-target expandload and compressstore tests
Simon Pilgrim [Sat, 6 Apr 2019 14:40:52 +0000 (14:40 +0000)]
[X86] Add AVX-target expandload and compressstore tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357842 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-exegesis][X86] Handle CMOVcc/SETcc OPERAND_COND_CODE OperandType
Roman Lebedev [Sat, 6 Apr 2019 14:16:26 +0000 (14:16 +0000)]
[llvm-exegesis][X86] Handle CMOVcc/SETcc OPERAND_COND_CODE OperandType

Summary:
D60041 / D60138 refactoring changed how CMOV/SETcc opcodes
are handled. concode is now an immediate, with it's own operand type.

This at least allows to not crash on the opcode.
However, this still won't generate all the snippets
with all the condcode enumerators. D60066 does that.

Reviewers: courbet, gchatelet

Reviewed By: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357841 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Split expandload and compressstore tests
Simon Pilgrim [Sat, 6 Apr 2019 14:14:54 +0000 (14:14 +0000)]
[X86] Split expandload and compressstore tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357840 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][SSE] Add more exhaustive masked load/store tests
Simon Pilgrim [Sat, 6 Apr 2019 14:01:37 +0000 (14:01 +0000)]
[X86][SSE] Add more exhaustive masked load/store tests

Reordered/renamed some existing tests to match the cleaned up order

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357839 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[CostModel][X86] Add more exhaustive masked load/store/gather/scatter/expand/compress...
Simon Pilgrim [Sat, 6 Apr 2019 12:08:37 +0000 (12:08 +0000)]
[CostModel][X86] Add more exhaustive masked load/store/gather/scatter/expand/compress cost tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357838 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Sort out and rename multiple CI/VI predicates
Stanislav Mekhanoshin [Sat, 6 Apr 2019 09:20:48 +0000 (09:20 +0000)]
[AMDGPU] Sort out and rename multiple CI/VI predicates

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357835 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DWARF] Simplify DWARFDebugAranges::findAddress
Fangrui Song [Sat, 6 Apr 2019 09:12:53 +0000 (09:12 +0000)]
[DWARF] Simplify DWARFDebugAranges::findAddress

The current lower_bound approach has to check two iterators pos and pos-1.
Changing it to upper_bound allows us to check one iterator (similar to
DWARFUnitVector::getUnitFor*).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357834 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Symbolize] Uniquify sorted vector<pair<SymbolDesc, StringRef>>
Fangrui Song [Sat, 6 Apr 2019 02:18:56 +0000 (02:18 +0000)]
[Symbolize] Uniquify sorted vector<pair<SymbolDesc, StringRef>>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357833 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agogn build: Pacify `gn format`
Nico Weber [Fri, 5 Apr 2019 23:57:10 +0000 (23:57 +0000)]
gn build: Pacify `gn format`

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357830 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PDB Docs] Add documentation for the hash table format.
Zachary Turner [Fri, 5 Apr 2019 22:09:30 +0000 (22:09 +0000)]
[PDB Docs] Add documentation for the hash table format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357826 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PDB Docs] The IPI Stream actually has index 4.
Zachary Turner [Fri, 5 Apr 2019 22:09:14 +0000 (22:09 +0000)]
[PDB Docs] The IPI Stream actually has index 4.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357825 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Begin to Expose A More General Binary Interface
Robert Widmann [Fri, 5 Apr 2019 21:36:50 +0000 (21:36 +0000)]
[LLVM-C] Begin to Expose A More General Binary Interface

Summary:
Provides a new type, `LLVMBinaryRef`, and a binding to `llvm::object::createBinary` for more general interoperation with binary files than `LLVMObjectFileRef`.  It also provides the proper non-consuming API for input buffers and populates an out parameter for error handling if necessary - two things the previous API did not do.

In a follow-up, I'll define section and symbol iterators and begin to build upon the existing test infrastructure.

This patch is a first step towards deprecating that API and replacing it with something more robust.

Reviewers: deadalnix, whitequark

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357822 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[gn] Support for building compiler-rt builtins
Petr Hosek [Fri, 5 Apr 2019 21:30:40 +0000 (21:30 +0000)]
[gn] Support for building compiler-rt builtins

This is support for building compiler-rt builtins, The library build
should be complete for a subset of supported platforms, but not all
CMake options have been replicated in GN.

We always use the just built compiler to build all the runtimes, which
is equivalent to the CMake runtimes build. This simplifies the build
configuration because we don't need to support arbitrary host compiler
and can always assume the latest Clang. With GN's toolchain support,
this is significantly more efficient than the CMake runtimes build.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357821 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel] Allow combiners to query legality
Daniel Sanders [Fri, 5 Apr 2019 21:22:17 +0000 (21:22 +0000)]
[globalisel] Allow combiners to query legality

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357820 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PDB Docs] Delete * LINKER * Stream information.
Zachary Turner [Fri, 5 Apr 2019 21:16:00 +0000 (21:16 +0000)]
[PDB Docs] Delete * LINKER * Stream information.

This is actually just a module debug info stream, so it should
technically be covered by a discussion of the module list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357819 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add more tests for fmul+fdiv+sqrt; NFC
Sanjay Patel [Fri, 5 Apr 2019 20:54:35 +0000 (20:54 +0000)]
[InstCombine] add more tests for fmul+fdiv+sqrt; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357816 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[globalisel] Support 3-type legalForCartesianProduct()
Daniel Sanders [Fri, 5 Apr 2019 20:47:13 +0000 (20:47 +0000)]
[globalisel] Support 3-type legalForCartesianProduct()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357815 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LLVM-C] Add bindings to insert basic blocks
Robert Widmann [Fri, 5 Apr 2019 20:32:43 +0000 (20:32 +0000)]
[LLVM-C] Add bindings to insert basic blocks

Summary:
Now that we can create standalone basic blocks, it's useful to be able to append them.  Add bindings to

- Insert a basic block after the current insertion block
- Append a basic block to the end of a function's list of basic blocks

Reviewers: whitequark, deadalnix, harlanhaskins

Reviewed By: whitequark, harlanhaskins

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357812 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Enable tail calls for CallingConv::Swift
Francis Visoiu Mistrih [Fri, 5 Apr 2019 20:18:25 +0000 (20:18 +0000)]
[X86] Enable tail calls for CallingConv::Swift

It's currently only enabled on AArch64 (enabled in r281376).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357809 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Preserve operand flag when expanding TCRETURNri
Francis Visoiu Mistrih [Fri, 5 Apr 2019 20:18:21 +0000 (20:18 +0000)]
[X86] Preserve operand flag when expanding TCRETURNri

The expansion of TCRETURNri(64) would not keep operand flags like
undef/renamable/etc. which can result in machine verifier issues.

Also add plumbing to be able to use `-run-pass=x86-pseudo`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357808 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] Add MachineDCE pass after RenameIndependentSubregs
Stanislav Mekhanoshin [Fri, 5 Apr 2019 20:11:32 +0000 (20:11 +0000)]
[AMDGPU] Add MachineDCE pass after RenameIndependentSubregs

Detect dead lanes can create some dead defs. Then RenameIndependentSubregs
will break a REG_SEQUENCE which may use these dead defs. At this point
a dead instruction can be removed but we do not run a DCE anymore.

MachineDCE was only running before live variable analysis. The patch
adds a mean to preserve LiveIntervals and SlotIndexes in case it works
past this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357805 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Merge the different Jcc instructions for each condition code into single instru...
Craig Topper [Fri, 5 Apr 2019 19:28:09 +0000 (19:28 +0000)]
[X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand.

Summary:
This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between Jcc instructions and condition codes.

Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.

Reviewers: spatel, lebedev.ri, courbet, gchatelet, RKSimon

Reviewed By: RKSimon

Subscribers: MatzeB, qcolombet, eraman, hiraditya, arphaman, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357802 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Merge the different SETcc instructions for each condition code into single...
Craig Topper [Fri, 5 Apr 2019 19:27:49 +0000 (19:27 +0000)]
[X86] Merge the different SETcc instructions for each condition code into single instructions that store the condition code as an operand.

Summary:
This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between SETcc instructions and condition codes.

Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.

Reviewers: andreadb, courbet, RKSimon, spatel, lebedev.ri

Reviewed By: andreadb

Subscribers: hiraditya, lebedev.ri, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357801 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Merge the different CMOV instructions for each condition code into single instr...
Craig Topper [Fri, 5 Apr 2019 19:27:41 +0000 (19:27 +0000)]
[X86] Merge the different CMOV instructions for each condition code into single instructions that store the condition code as an immediate.

Summary:
Reorder the condition code enum to match their encodings. Move it to MC layer so it can be used by the scheduler models.

This avoids needing an isel pattern for each condition code. And it removes
translation switches for converting between CMOV instructions and condition
codes.

Now the printer, encoder and disassembler take care of converting the immediate.
We use InstAliases to handle the assembly matching. But we print using the
asm string in the instruction definition. The instruction itself is marked
IsCodeGenOnly=1 to hide it from the assembly parser.

This does complicate the scheduler models a little since we can't assign the
A and BE instructions to a separate class now.

I plan to make similar changes for SETcc and Jcc.

Reviewers: RKSimon, spatel, lebedev.ri, andreadb, courbet

Reviewed By: RKSimon

Subscribers: gchatelet, hiraditya, kristina, lebedev.ri, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357800 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[gn] Rebase paths in symlink_or_copy against root_build_dir
Petr Hosek [Fri, 5 Apr 2019 19:13:54 +0000 (19:13 +0000)]
[gn] Rebase paths in symlink_or_copy against root_build_dir

We should be always rebasing paths against root_build_dir which is
the directory where scripts are run from, not root_out_dir which is
the current toolchain directory. The latter can result in invalid
paths when the action is being used from a non-default toolchain.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357798 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[gn] Make -no-exceptions flag a config
Petr Hosek [Fri, 5 Apr 2019 19:12:37 +0000 (19:12 +0000)]
[gn] Make -no-exceptions flag a config

This allows it to be disabled for targets that need exceptions
like libunwind, libc++abi and libc++.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357797 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[LCG] Add aliased functions as LCG roots
Guozhi Wei [Fri, 5 Apr 2019 18:51:08 +0000 (18:51 +0000)]
[LCG] Add aliased functions as LCG roots

Current LCG doesn't check aliased functions. So if an internal function has a public alias it will not be added to CG SCC, but it is still reachable from outside through the alias.
So this patch adds aliased functions to SCC.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357795 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[AMDGPU] predicate and feature refactoring
Stanislav Mekhanoshin [Fri, 5 Apr 2019 18:24:34 +0000 (18:24 +0000)]
[AMDGPU] predicate and feature refactoring

We have done some predicate and feature refactoring lately but
did not upstream it. This is to sync.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357791 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoTry to fix Sphinx bot.
Zachary Turner [Fri, 5 Apr 2019 18:06:42 +0000 (18:06 +0000)]
Try to fix Sphinx bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357790 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agolit: make rm python 3 friendly (NFC)
Saleem Abdulrasool [Fri, 5 Apr 2019 18:00:49 +0000 (18:00 +0000)]
lit: make rm python 3 friendly (NFC)

Add some alterations for python 3 compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357789 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PDB Docs] Finish documentation for PDB Info Stream.
Zachary Turner [Fri, 5 Apr 2019 17:59:26 +0000 (17:59 +0000)]
[PDB Docs] Finish documentation for PDB Info Stream.

The information about the named stream map and feature codes
was not present.  This patch adds it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357788 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[PDB Docs] Add info about the hash adjustment buffer.
Zachary Turner [Fri, 5 Apr 2019 17:12:37 +0000 (17:12 +0000)]
[PDB Docs] Add info about the hash adjustment buffer.

This necessitates adding a document describing the serialized
hash table format.  This document is currently empty, although
it will be filled out in followup patches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357784 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agogn build: Merge 357768 and 357770
Nico Weber [Fri, 5 Apr 2019 17:05:54 +0000 (17:05 +0000)]
gn build: Merge 357768 and 357770

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357783 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for fdiv+fmul; NFC
Sanjay Patel [Fri, 5 Apr 2019 17:00:57 +0000 (17:00 +0000)]
[InstCombine] add tests for fdiv+fmul; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357782 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agogn build: Merge r357719
Nico Weber [Fri, 5 Apr 2019 16:57:34 +0000 (16:57 +0000)]
gn build: Merge r357719

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357781 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add tests for sqrt+fdiv+fmul; NFC
Sanjay Patel [Fri, 5 Apr 2019 16:52:57 +0000 (16:52 +0000)]
[InstCombine] add tests for sqrt+fdiv+fmul; NFC

Examples based on recent llvm-dev thread. These are specific
patterns of more general enhancements that would solve these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357780 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agolit: support long paths on Windows
Saleem Abdulrasool [Fri, 5 Apr 2019 16:48:00 +0000 (16:48 +0000)]
lit: support long paths on Windows

Use ctypes to call into SHFileOperationW with the extended NT path to allow us
to remove paths which exceed 261 characters on Windows. This functionality is
exercised by swift's test suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357778 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd documentation for PDB TPI/IPI Stream.
Zachary Turner [Fri, 5 Apr 2019 16:43:42 +0000 (16:43 +0000)]
Add documentation for PDB TPI/IPI Stream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357777 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[InstCombine] add test to show reassociation that creates a denormal constant; NFC
Sanjay Patel [Fri, 5 Apr 2019 16:42:21 +0000 (16:42 +0000)]
[InstCombine] add test to show reassociation that creates a denormal constant; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357776 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[llvm-readobj] Improve error message for --string-dump"
Stephen Tozer [Fri, 5 Apr 2019 16:32:25 +0000 (16:32 +0000)]
Revert "[llvm-readobj] Improve error message for --string-dump"

This reverts commit 681b0798dbbc6b3500c9930977ec8a274b142acb.

Reverted due to causing build failures: llvm-svn: 357772

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357774 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoChange some dyn_cast to more apropriate isa. NFC
Fangrui Song [Fri, 5 Apr 2019 16:16:23 +0000 (16:16 +0000)]
Change some dyn_cast to more apropriate isa. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357773 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm-readobj] Improve error message for --string-dump
Stephen Tozer [Fri, 5 Apr 2019 16:15:50 +0000 (16:15 +0000)]
[llvm-readobj] Improve error message for --string-dump

Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630

This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357772 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[format] Add correct punctuation to comment
Stephen Tozer [Fri, 5 Apr 2019 15:59:07 +0000 (15:59 +0000)]
[format] Add correct punctuation to comment

Test commit that adds a grammatically correct full stop to a single
comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357771 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAdd an option do not dump the generated object on disk
Guillaume Chatelet [Fri, 5 Apr 2019 15:18:59 +0000 (15:18 +0000)]
Add an option do not dump the generated object on disk

Reviewers: courbet

Subscribers: llvm-commits, bdb

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357769 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[ExpandMemCmp][NFC] Add tests for `memcmp(p, q, n) < 0` case.
Clement Courbet [Fri, 5 Apr 2019 15:03:25 +0000 (15:03 +0000)]
[ExpandMemCmp][NFC] Add tests for `memcmp(p, q, n) < 0` case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357767 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Add fcmp UNDEF handling to SelectionDAG::FoldSetCC
Simon Pilgrim [Fri, 5 Apr 2019 14:56:21 +0000 (14:56 +0000)]
[SelectionDAG] Add fcmp UNDEF handling to SelectionDAG::FoldSetCC

Second half of PR40800, this patch adds DAG undef handling to fcmp instructions to match the behavior in llvm::ConstantFoldCompareInstruction, this permits constant folding of vector comparisons where some elements had been reduced to UNDEF (by SimplifyDemandedVectorElts etc.).

This involves a lot of tweaking to reduced tests as bugpoint loves to reduce fcmp arguments to undef........

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357765 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoGlobalISel: Add another overload of buildUnmerge
Matt Arsenault [Fri, 5 Apr 2019 14:03:07 +0000 (14:03 +0000)]
GlobalISel: Add another overload of buildUnmerge

It's annoying to have to create an array of the result type,
particularly when you don't care about the size of the value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357763 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAMDGPU/GlobalISel: Fix non-power-of-2 select
Matt Arsenault [Fri, 5 Apr 2019 14:03:04 +0000 (14:03 +0000)]
AMDGPU/GlobalISel: Fix non-power-of-2 select

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357762 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[llvm] Add isa_and_nonnull
Don Hinton [Fri, 5 Apr 2019 13:59:24 +0000 (13:59 +0000)]
[llvm] Add isa_and_nonnull

Summary:
Add new ``isa_and_nonnull<>`` operator that works just like
the ``isa<>`` operator, except that it allows for a null pointer as an
argument (which it then returns false).

Reviewers: lattner, aaron.ballman, greened

Reviewed By: lattner

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357761 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[DAGCombiner][x86] scalarize splatted vector FP ops
Sanjay Patel [Fri, 5 Apr 2019 13:32:17 +0000 (13:32 +0000)]
[DAGCombiner][x86] scalarize splatted vector FP ops

There are a variety of vector patterns that may be profitably reduced to a
scalar op when scalar ops are performed using a subset (typically, the
first lane) of the vector register file.

For x86, this is true for float/double ops and element 0 because
insert/extract is just a sub-register rename.

Other targets should likely enable the hook in a similar way.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357760 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TextAPI] Fix off-by-one error in the bit index extraction loop
Petar Jovanovic [Fri, 5 Apr 2019 12:58:15 +0000 (12:58 +0000)]
[TextAPI] Fix off-by-one error in the bit index extraction loop

The loop in findNextSetBit() runs one pass more than it should.

On 64-bit architectures this does not cause a problem, but 32-bit
architectures mask the shift count to 5 bits which limits the number of
shifts inside a range of 0 to 31. Shifting by 32 has the same effect as
shifting by 0, so if the first bit in the set is 1, the function will return
with Index different from EndIndexVal. Because of that, range-based for
loops iterating thorough architectures will continue until hitting a 0 in
the set, resulting in n additional iterations, where n is equal to the
number of consecutive 1 bits at the start the set.

Ultimately TBDv1.WriteFile and TBDv2.WriteFile will output additional
architectures causing a failure in the unit tests.

Patch by Milos Stojanovic.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357759 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[Symbolize] Replace map<SymbolDesc, StringRef> with sorted vector
Fangrui Song [Fri, 5 Apr 2019 12:52:04 +0000 (12:52 +0000)]
[Symbolize] Replace map<SymbolDesc, StringRef> with sorted vector

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357758 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86][AVX] Add PR34584 masked store test cases
Simon Pilgrim [Fri, 5 Apr 2019 11:34:30 +0000 (11:34 +0000)]
[X86][AVX] Add PR34584 masked store test cases

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357757 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Add SSE/AVX1/AVX2 masked trunc+store tests
Simon Pilgrim [Fri, 5 Apr 2019 11:22:28 +0000 (11:22 +0000)]
[X86] Add SSE/AVX1/AVX2 masked trunc+store tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357756 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix r357749 for big-endian architectures
Pavel Labath [Fri, 5 Apr 2019 08:43:54 +0000 (08:43 +0000)]
Fix r357749 for big-endian architectures

We need to read the strings from the minidump files as little-endian,
regardless of the host byte order.

I definitely remember thinking about this case while writing the patch
(and in fact, I have implemented that for the "write" case), but somehow
I have ended up not implementing the byte swapping when reading the
data. This adds the necessary byte-swapping and should hopefully fix
test failures on big-endian bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357754 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[RISCV] Implement adding a displacement to a BlockAddress
Roger Ferrer Ibanez [Fri, 5 Apr 2019 08:40:57 +0000 (08:40 +0000)]
[RISCV] Implement adding a displacement to a BlockAddress

Recent change rL357393 uses MachineInstrBuilder::addDisp to add a based on a
BlockAddress but this case was not implemented.

This patch adds the missing case and a test for RISC-V that exercises the new
case.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357752 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix MSVC build for r357749
Pavel Labath [Fri, 5 Apr 2019 08:26:58 +0000 (08:26 +0000)]
Fix MSVC build for r357749

MSVC found the bare "make_unique" invocation ambiguous (between std::
and llvm:: versions). Explicitly qualifying the call with llvm:: should
hopefully fix it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357750 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMinidump: Add support for reading/writing strings
Pavel Labath [Fri, 5 Apr 2019 08:06:26 +0000 (08:06 +0000)]
Minidump: Add support for reading/writing strings

Summary:
Strings in minidump files are stored as a 32-bit length field, giving
the length of the string in *bytes*, which is followed by the
appropriate number of UTF16 code units. The string is also supposed to
be null-terminated, and the null-terminator is not a part of the length
field. This patch:
- adds support for reading these strings out of the minidump file (this
  implementation does not depend on proper null-termination)
- adds support for writing them to a minidump file
- using the previous two pieces implements proper (de)serialization of
  the CSDVersion field of the SystemInfo stream. Previously, this was
  only read/written as hex, and no attempt was made to access the
  referenced string -- now this string is read and written correctly.

The changes are tested via yaml2obj|obj2yaml round-trip as well as a
unit test which checks the corner cases of the string deserialization
logic.

Reviewers: jhenderson, zturner, clayborg

Subscribers: llvm-commits, aprantl, markmentovai, amccarth, lldb-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357749 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[SelectionDAG] Compute known bits of CopyFromReg
Piotr Sobczak [Fri, 5 Apr 2019 07:44:09 +0000 (07:44 +0000)]
[SelectionDAG] Compute known bits of CopyFromReg

Summary:
Teach SelectionDAG how to compute known bits of ISD::CopyFromReg if
the virtual reg used has one def only.

This can be particularly useful when calling isBaseWithConstantOffset()
with the ISD::CopyFromReg argument, as more optimizations may get enabled
in the result.

Also add a missing truncation on X86, found by testing of this patch.

Change-Id: Id1c9fceec862d118c54a5b53adf72ada5d6daefa

Reviewers: bogner, craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: lebedev.ri, nemanjai, jvesely, nhaehnle, javed.absar, jsji, jdoerfert, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357745 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[X86] Promote i16 SRA instructions to i32
Craig Topper [Fri, 5 Apr 2019 06:32:50 +0000 (06:32 +0000)]
[X86] Promote i16 SRA instructions to i32

We already promote SRL and SHL to i32.

This will introduce sign extends sometimes which might be harder to deal with than the zero we use for promoting SRL. I ran this through some of our internal benchmark lists and didn't see any major regressions.

I think there might be some DAG combine improvement opportunities in the test changes here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357743 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[FastISel] Fix crash for gc.relocate lowring
Serguei Katkov [Fri, 5 Apr 2019 05:41:08 +0000 (05:41 +0000)]
[FastISel] Fix crash for gc.relocate lowring

Lowering safepoint checks that all gc.relocaes observed in safepoint
must be lowered. However Fast-Isel is able to skip dead gc.relocate.

To resolve this issue we just ignore dead gc.relocate in the check.

Reviewers: reames
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D60184

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357742 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoNFC: Move API uses of MD5::MD5Result to Optional rather than a pointer.
Eric Christopher [Thu, 4 Apr 2019 23:34:38 +0000 (23:34 +0000)]
NFC: Move API uses of MD5::MD5Result to Optional rather than a pointer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357736 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoInclude invoke'd functions for recursive extract
David Callahan [Thu, 4 Apr 2019 23:30:47 +0000 (23:30 +0000)]
Include invoke'd functions for recursive extract

Summary: When recursively extracting a function from a bit code file, include functions mentioned in InvokeInst as well as CallInst

Reviewers: loladiro, espindola, volkan

Reviewed By: loladiro

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357735 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoAn unreachable block may have a route to a reachable block, don't fast-path return...
Nick Lewycky [Thu, 4 Apr 2019 23:09:40 +0000 (23:09 +0000)]
An unreachable block may have a route to a reachable block, don't fast-path return that it can't.

A block reachable from the entry block can't have any route to a block that's not reachable from the entry block (if it did, that route would make it reachable from the entry block). That is the intended performance optimization for isPotentiallyReachable. For the case where we ask whether an unreachable from entry block has a route to a reachable from entry block, we can't conclude one way or the other. Fix a bug where we claimed there could be no such route.

The fix in rL357425 ironically reintroduced the very bug it was fixing but only when a DominatorTree is provided. This fixes the remaining bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357734 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[TextAPI] Prefix all architecture enums to fix the build on i386.
Juergen Ributzka [Thu, 4 Apr 2019 22:56:50 +0000 (22:56 +0000)]
[TextAPI] Prefix all architecture enums to fix the build on i386.

Summary: This changes the Architecture enum to use a prefix (AK_) to prevent the
preprocessor from replacing i386 with 1 when building llvm/clang for i386.

Reviewers: steven_wu, lhames, mstorsjo

Reviewed By: mstorsjo

Subscribers: hiraditya, jkorous, dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357733 91177308-0d34-0410-b5e6-96231b3b80d8

6 years ago[IR] Refactor attribute methods in Function class (NFC)
Evandro Menezes [Thu, 4 Apr 2019 22:40:06 +0000 (22:40 +0000)]
[IR] Refactor attribute methods in Function class (NFC)

Rename the functions that query the optimization kind attributes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357731 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoMake SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer*
Nico Weber [Thu, 4 Apr 2019 21:06:41 +0000 (21:06 +0000)]
Make SourceManager::createFileID(UnownedTag, ...) take a const llvm::MemoryBuffer*

Requires making the llvm::MemoryBuffer* stored by SourceManager const,
which in turn requires making the accessors for that return const
llvm::MemoryBuffer*s and updating all call sites.

The original motivation for this was to use it and fix the TODO in
CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag
version of createFileID, and since llvm::SourceMgr* hands out a const
llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO
this way actually works, but this seems like a good change on its own
anyways.

No intended behavior change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357724 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoFix some MCTargetOptions Doxygen comments (NFC)
Scott Linder [Thu, 4 Apr 2019 20:35:57 +0000 (20:35 +0000)]
Fix some MCTargetOptions Doxygen comments (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357723 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert [X86] When using Win64 ABI, exit with error if SSE is disabled for varargs
James Y Knight [Thu, 4 Apr 2019 19:05:48 +0000 (19:05 +0000)]
Revert [X86] When using Win64 ABI, exit with error if SSE is disabled for varargs

It unnecessarily breaks previously-working code which used varargs,
but didn't pass any float/double arguments (such as EDK2).

Also revert the fixup on top of that:
Revert [X86] Fix a test from r357317

This reverts r357317 (git commit d413f41de6baf500e5d20c638375447e18777db2)
This reverts r357380 (git commit 7af32444b9b17719ebabb6bee6eb52465acc8507)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357718 91177308-0d34-0410-b5e6-96231b3b80d8