OSDN Git Service
Diana Picus [Wed, 13 Feb 2019 11:25:32 +0000 (11:25 +0000)]
[ARM GlobalISel] Support G_SELECT for Thumb2
Same as arm mode, but slightly different opcodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353938
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Wed, 13 Feb 2019 11:02:42 +0000 (11:02 +0000)]
[MCA][Scheduler] Use latency information to further classify busy instructions.
This patch introduces a new instruction stage named 'IS_PENDING'.
An instruction transitions from the IS_DISPATCHED to the IS_PENDING stage if
input registers are not available, but their latency is known.
This patch also adds a new set of instructions named 'PendingSet' to class
Scheduler. The idea is that the PendingSet will only contain instructions that
have reached the IS_PENDING stage.
By construction, an instruction in the PendingSet is only dependent on
instructions that have already reached the execution stage. The plan is to use
this knowledge to identify bottlenecks caused by data dependencies (see
PR37494).
Differential Revision: https://reviews.llvm.org/D58066
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353937
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeremy Morse [Wed, 13 Feb 2019 10:54:53 +0000 (10:54 +0000)]
[DebugInfo][InstCombine] Prefer to salvage debuginfo over sinking it
When instcombine sinks an instruction between two basic blocks, it sinks any
dbg.value users in the source block with it, to prevent debug use-before-free.
However we can do better by attempting to salvage the debug users, which would
avoid moving where the variable location changes. If we successfully salvage,
still sink a (cloned) dbg.value with the sunk instruction, as the sunk
instruction is more likely to be "live" later in the compilation process.
If we can't salvage dbg.value users of a sunk instruction, mark the dbg.values
in the original block as being undef. This terminates any earlier variable
location range, and represents the fact that we've optimized out the variable
location for a portion of the program.
Differential Revision: https://reviews.llvm.org/D56788
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353936
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Guelton [Wed, 13 Feb 2019 10:19:06 +0000 (10:19 +0000)]
Missing header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353933
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Wed, 13 Feb 2019 09:56:30 +0000 (09:56 +0000)]
[GuardWidening] Support widening of explicitly expressed guards
This patch adds support of guards expressed in explicit form via
`widenable_condition` in Guard Widening pass.
Differential Revision: https://reviews.llvm.org/D56075
Reviewed By: reames
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353932
91177308-0d34-0410-b5e6-
96231b3b80d8
David Stenberg [Wed, 13 Feb 2019 09:34:07 +0000 (09:34 +0000)]
[DebugInfo] Stop changing labels for register-described parameter DBG_VALUEs
Summary:
This is a follow-up to D57510. This patch stops DebugHandlerBase from
changing the starting label for the first non-overlapping,
register-described parameter DBG_VALUEs to the beginning of the
function. That code did not consider what defined the registers, which
could result in the ranges for the debug values starting before their
defining instructions. We currently do not emit debug values for
constant values directly at the start of the function, so this code is
still useful for such values, but my intention is to remove the code
from DebugHandlerBase completely when we get there. One reason for
removing it is that the code violates the history map's ranges, which I
think can make it quite confusing when troubleshooting.
In D57510, PrologEpilogInserter was amended so that parameter DBG_VALUEs
now are kept at the start of the entry block, even after emission of
prologue code. That was done to reduce the degradation of debug
completeness from this patch. PR40638 is another example, where the
lexical-scope trimming that LDV does, in combination with scheduling,
results in instructions after the prologue being left without locations.
There might be other cases where the DBG_VALUEs are pushed further down,
for which the DebugHandlerBase code may be helpful, but as it now quite
often result in incorrect locations, even after the prologue, it seems
better to remove that code, and try to work our way up with accurate
locations.
In the long run we should maybe not aim to provide accurate locations
inside the prologue. Some single location descriptions, at least those
referring to stack values, generate inaccurate values inside the
epilogue, so we maybe should not aim to achieve accuracy for location
lists. However, it seems that we now emit line number programs that can
result in GDB and LLDB stopping inside the prologue when doing line
number stepping into functions. See PR40188 for more information.
A summary of some of the changed test cases is available in PR40188#c2.
Reviewers: aprantl, dblaikie, rnk, jmorse
Reviewed By: aprantl
Subscribers: jdoerfert, jholewinski, jvesely, javed.absar, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D57511
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353928
91177308-0d34-0410-b5e6-
96231b3b80d8
Serge Guelton [Wed, 13 Feb 2019 09:31:22 +0000 (09:31 +0000)]
Make llvm::Optional<T> trivially copyable when T is trivially copyable
This is an ever-recurring issue (see https://bugs.llvm.org/show_bug.cgi?id=39427 and https://bugs.llvm.org/show_bug.cgi?id=35978)
but I believe that thanks to https://reviews.llvm.org/D54472 we can now ship a decent implementation of this.
Basically the fact that llvm::is_trivially_copyable has a consistent behavior across compilers should prevent any ABI issue,
and using in-place new instead of memcpy should keep compiler bugs away.
Differential Revision: https://reviews.llvm.org/D57097
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353927
91177308-0d34-0410-b5e6-
96231b3b80d8
Michal Gorny [Wed, 13 Feb 2019 08:34:40 +0000 (08:34 +0000)]
[llvm] [cmake] Provide split include paths in LLVMConfig
Modify LLVMConfig to provide split variables for in-source and generated
include paths. Currently, it uses a single value for both
LLVM_INCLUDE_DIRS and LLVM_INCLUDE_DIR which works for install tree but
fails hard at build tree (where LLVM_INCLUDE_DIR incorrectly contains
multiple values).
Instead, put the generated directory in LLVM_INCLUDE_DIR, and the source
tree in LLVM_MAIN_INCLUDE_DIR which is consistent with in-LLVM builds.
For install tree, both variables will have the same value.
Differential Revision: https://reviews.llvm.org/D58109
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353924
91177308-0d34-0410-b5e6-
96231b3b80d8
Anton Afanasyev [Wed, 13 Feb 2019 08:26:43 +0000 (08:26 +0000)]
[X86][SLP] Enable SLP vectorization for 128-bit horizontal X86 instructions (add, sub)
Try to use 64-bit SLP vectorization. In addition to horizontal instrs
this change triggers optimizations for partial vector operations (for instance,
using low halfs of 128-bit registers xmm0 and xmm1 to multiply <2 x float> by
<2 x float>).
Fixes llvm.org/PR32433
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353923
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 13 Feb 2019 07:42:34 +0000 (07:42 +0000)]
[X86] Use default expansion for (i64 fp_to_uint f80) when avx512 is enabled on 64-bit targets to match what happens without avx512.
In 64-bit mode prior to avx512 we use Expand, but with avx512 we need to make f32/f64 conversions Legal so we use Custom and then do our own expansion for f80. But this seems to produce codegen differences relative to avx2. This patch corrects this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353921
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 13 Feb 2019 07:42:31 +0000 (07:42 +0000)]
[X86] Refactor the FP_TO_INTHelper interface. NFCI
-Pull the final stack load creation from the two callers into the helper.
-Return a single SDValue instead of a std::pair.
-Remove the Replace flag which isn't really needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353920
91177308-0d34-0410-b5e6-
96231b3b80d8
Eugene Leviant [Wed, 13 Feb 2019 07:34:54 +0000 (07:34 +0000)]
[llvm-objcopy] Add --strip-unneeded-symbol(s)
Differential revision: https://reviews.llvm.org/D58027
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353919
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Wed, 13 Feb 2019 06:12:48 +0000 (06:12 +0000)]
[LoopSimplifyCFG] Re-enable const branch folding by default
Known underlying bugs have been fixed, intensive fuzz testing did not
find any new problems. Re-enabling by default. Feel free to revert if
it causes any functional failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353911
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Wed, 13 Feb 2019 01:51:45 +0000 (01:51 +0000)]
[llvm-readobj] Dump GNU_PROPERTY_X86_FEATURE_2_{NEEDED,USED} notes in .note.gnu.property
Summary: And change the output ("X86 features" -> "x86 feature") a bit.
Reviewers: grimar, xiangzhangllvm, hjl.tools, rupprecht
Reviewed By: rupprecht
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58112
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353908
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 13 Feb 2019 01:39:32 +0000 (01:39 +0000)]
[MC] Make symbol version errors non-fatal
We stil don't have a source location, which is pretty lame, but at least
we won't tell the user to file a clang bug report anymore.
Fixes PR40712
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353907
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Wed, 13 Feb 2019 00:32:21 +0000 (00:32 +0000)]
[dsymutil] Improve readability of cloneAllCompileUnits (NFC)
Add some newlines and improve consistency between the two loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353904
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Devlieghere [Wed, 13 Feb 2019 00:32:06 +0000 (00:32 +0000)]
[dsymutil] Don't clone empty CUs
The DWARF standard says that an empty compile unit is not valid:
> Each such contribution consists of a compilation unit header (see
> Section 7.5.1.1 on page 200) followed by a single DW_TAG_compile_unit or
> DW_TAG_partial_unit debugging information entry, together with its
> children.
Therefore we shouldn't clone them in dsymutil.
Differential revision: https://reviews.llvm.org/D57979
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353903
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Tue, 12 Feb 2019 23:48:02 +0000 (23:48 +0000)]
[MemorySSA & LoopPassManager] Add remaining book keeping [NFCI].
Add plumbing to get MemorySSA in the remaining loop passes.
Also update unit test to add the dependency.
[EnableMSSALoopDependency remains disabled].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353901
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 12 Feb 2019 23:44:13 +0000 (23:44 +0000)]
AMDGPU: Try to use function specific ST
Subtargets are a function level property, so ideally we would
eliminate everywhere that needs to check the global one. Rename the
function to try avoiding confusion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353900
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 12 Feb 2019 23:30:11 +0000 (23:30 +0000)]
AMDGPU: Ignore CodeObjectV3 when inlining
This was inhibiting inlining of library functions when clang was
invoking the inliner directly. This is covering a bit of a mess with
subtarget feature handling, and this shouldn't be a subtarget
feature. The behavior is different depending on whether you are using
a -mattr flag in clang, or llc, opt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353899
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Tue, 12 Feb 2019 23:13:18 +0000 (23:13 +0000)]
[SystemZ] Remember to cast value to void to disable warning.
Hopefully fixes buildbot problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353898
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Tue, 12 Feb 2019 23:05:40 +0000 (23:05 +0000)]
[LICM] Cap the clobbering calls in LICM.
Summary:
Unlimitted number of calls to getClobberingAccess can lead to high
compile times in pathological cases.
Switching EnableLicmCap flag from bool to int, and enabling to default 100.
(tested to be appropriate for current bechmarks)
We can revisit this value when enabling MemorySSA.
Reviewers: sanjoy, chandlerc, george.burgess.iv
Subscribers: jlebar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57968
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353897
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 12 Feb 2019 23:00:07 +0000 (23:00 +0000)]
[Tests] A few more live-in deopt lowering tests
Nothing super interesting, just making sure obvious cases work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353895
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Tue, 12 Feb 2019 22:49:49 +0000 (22:49 +0000)]
AMDGPU/NFC: Remove SubtargetFeatureISAVersion since it is not used anywhere
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353892
91177308-0d34-0410-b5e6-
96231b3b80d8
Konstantin Zhuravlyov [Tue, 12 Feb 2019 22:29:25 +0000 (22:29 +0000)]
AMDGPU: Remove duplicate processor (gfx900)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353889
91177308-0d34-0410-b5e6-
96231b3b80d8
David Major [Tue, 12 Feb 2019 22:24:45 +0000 (22:24 +0000)]
[gn build] Separate debug and optimization settings
This patch adds an `is_optimized` variable, orthogonal to `is_debug`, to allow for a gn analogue to `RelWithDebInfo` builds.
As part of this we'll want to explicitly enable GC+ICF, for the sake of `is_debug && is_optimized` builds. The flags normally default to true except that if you pass `/DEBUG` they default to false.
Differential Revision: https://reviews.llvm.org/D58075
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353888
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Pettersson [Tue, 12 Feb 2019 22:11:20 +0000 (22:11 +0000)]
[SelectionDAG] Clean up comments in SelectionDAGBuilder.h. NFC
Remove redundant function/variable names from doxygen
comments (as suggested in https://reviews.llvm.org/D57697).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353886
91177308-0d34-0410-b5e6-
96231b3b80d8
Erik Pilkington [Tue, 12 Feb 2019 21:55:38 +0000 (21:55 +0000)]
Fix auto-upgrade for the new parameter to llvm.objectsize
r352664 added a 'dynamic' parameter to objectsize, but the AutoUpgrade
changes were incomplete. Also, fix an off-by-one error I made in the
upgrade logic that is now no longer unreachable.
Differential revision: https://reviews.llvm.org/D58071
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353884
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 12 Feb 2019 21:49:56 +0000 (21:49 +0000)]
[ConstProp] add test for miscompile from bitcast transform; NFC
This problem goes with the fix in D51215.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353883
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Tue, 12 Feb 2019 20:37:33 +0000 (20:37 +0000)]
[llvm-dwp] Use color-formatted error reporting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353876
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Fertile [Tue, 12 Feb 2019 20:03:04 +0000 (20:03 +0000)]
Fix undefined behaviour in PPCInstPrinter::printBranchOperand.
Fix the undefined behaviour introduced by my previous patch r353865 (left
shifting a potentially negative value), which was caught by the bots that run
UBSan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353874
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Tue, 12 Feb 2019 20:00:51 +0000 (20:00 +0000)]
[llvm-dwp] Avoid writing the output dwp file when there is an error
Summary: Use ToolOutputFile to clean up the output file unless dwp actually finishes successfully.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58130
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353873
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikita Popov [Tue, 12 Feb 2019 18:55:53 +0000 (18:55 +0000)]
[AArch64] Expand v8i8 cttz (PR39729)
Fix for https://bugs.llvm.org/show_bug.cgi?id=39729.
Rather than adding just a case for v8i8 I'm setting cttz to expand
for all vector types.
Differential Revision: https://reviews.llvm.org/D58008
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353872
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 12 Feb 2019 18:33:01 +0000 (18:33 +0000)]
[InlineSpiller] Fix a crash due to lack of forward progress from remat (try 2)
This is a recommit of r335091 Add more test cases for deopt-operands via regalloc, and r335077 [InlineSpiller] Fix a crash due to lack of forward progress from remat specifically for STATEPOINT. They were reverted due to a crash.
This change includes the text of both original changes, but also includes three aditional pieces:
1) A bug fix for the observed crash. I had failed to record the failed remat value as live which resulted in an instruction being deleted which still had uses. With the machine verifier, this is caught quickly. Without it, we fail in StackSlotColoring due to an empty live interval from LiveStack.
2) A test case which demonstrates the fix for (1). See @test11.
3) A control flag which defaults to disabling this for the moment. Once I've run more extensive validaton, I will switch the default and then remove this flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353871
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonas Paulsson [Tue, 12 Feb 2019 18:06:06 +0000 (18:06 +0000)]
[SystemZ] Use VGM whenever possible to load FP immediates.
isFPImmLegal() has been extended to recognize certain FP immediates that can
be built with VGM (Vector Generate Mask).
These scalar FP immediates (that were previously loaded from the constant
pool) are now selected as VGMF/VGMG in Select().
Review: Ulrich Weigand
https://reviews.llvm.org/D58003
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353867
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Fertile [Tue, 12 Feb 2019 17:48:22 +0000 (17:48 +0000)]
[PowerPC] Fix printing of negative offsets in call instruction dissasembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353865
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Tue, 12 Feb 2019 17:38:34 +0000 (17:38 +0000)]
[GlobalISel][NFC] Gardening: Make translateSimpleUnaryIntrinsic general
Instead of only having this code work for unary intrinsics, have it work for
an arbitrary number of parameters.
Factor out the cases that fall under this (fma, pow).
This makes it a bit easier to add more intrinsics which don't require any
special work.
Differential Revision: https://reviews.llvm.org/D58079
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353863
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Tue, 12 Feb 2019 17:36:57 +0000 (17:36 +0000)]
[tablegen] Add locations to many PrintFatalError() calls
Summary:
While working on the GISel Combiner, I noticed I was producing location-less
error messages fairly often and set about fixing this. In the process, I
noticed quite a few places elsewhere in TableGen that also neglected to include
a relevant location.
This patch adds locations to errors that relate to a specific record (or a
field within it) and also have easy access to the relevant location. This is
particularly useful when multiclasses are involved as many of these errors
refer to the full name of a record and it's difficult to guess which substring
is grep-able.
Unfortunately, tablegen currently only supports Record granularity so it's not
currently possible to point at a specific Init so these sometimes point at the
record that caused the error rather than the precise origin of the error.
Reviewers: bogner, aditya_nandakumar, volkan, aemerson, paquette, nhaehnle
Reviewed By: nhaehnle
Subscribers: jdoerfert, nhaehnle, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58077
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353862
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Tue, 12 Feb 2019 17:28:17 +0000 (17:28 +0000)]
[GlobalISel][AArch64] Select llvm.bswap* for non-vector types
This teaches the IRTranslator to emit G_BSWAP when it runs into
Intrinsic::bswap. This allows us to select G_BSWAP for non-vector types in
AArch64.
Add a select-bswap.mir test, and add global isel checks to a couple existing
tests in test/CodeGen/AArch64.
This doesn't handle every bswap case, since some of these rely on known bits
stuff. This just lets us handle the naive case.
Differential Revision: https://reviews.llvm.org/D58081
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353861
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 12 Feb 2019 17:22:35 +0000 (17:22 +0000)]
[X86][AVX] Enable shuffle combining support for zero_extend
A more limited version of rL352997 that had to be disabled in rL353198 - allow extension of any 128/256/512 bit vector that at least uses byte sized scalars.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353860
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 12 Feb 2019 17:07:47 +0000 (17:07 +0000)]
[DAGCombiner] convert logic-of-setcc into bit magic (PR40611)
If we're comparing some value for equality against 2 constants
and those constants have an absolute difference of just 1 bit,
then we can offset and mask off that 1 bit and reduce to a single
compare against zero:
and/or (setcc X, C0, ne), (setcc X, C1, ne/eq) -->
setcc ((add X, -C1), ~(C0 - C1)), 0, ne/eq
https://rise4fun.com/Alive/XslKj
This transform is disabled by default using a TLI hook
("convertSetCCLogicToBitwiseLogic()").
That should be overridden for AArch64, MIPS, Sparc and possibly
others based on the asm shown in:
https://bugs.llvm.org/show_bug.cgi?id=40611
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353859
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 12 Feb 2019 16:44:37 +0000 (16:44 +0000)]
[x86] add negative tests for setcc folds; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353855
91177308-0d34-0410-b5e6-
96231b3b80d8
whitequark [Tue, 12 Feb 2019 16:41:50 +0000 (16:41 +0000)]
[SelectionDAG] Fix return calling convention in expansion of ?MULO
Summary:
The SMULO/UMULO DAG nodes, when not directly supported by the target,
expand to a multiplication twice as wide. In case that the resulting
type is not legal, the legalizer cannot directly call the intrinsic
with the wide arguments; instead, it "pre-lowers" them by splitting
them in halves.
rL283203 made sure that on big endian targets, the legalizer passes
the argument halves in the correct order. It did not do the same
for the return value halves because the existing code used a hack;
it put an illegal type into DAG and hoped that nothing would break
and it would be correctly lowered elsewhere.
rL307207 fixed this, handling return value halves similar to how
argument handles are handled, but did not take big-endian targets
into account.
This commit fixes the expansion on big-endian targets, such as
the out-of-tree OR1K target.
Reviewers: eli.friedman, vadimcn
Subscribers: george-hopkins, efriedma, llvm-commits
Differential Revision: https://reviews.llvm.org/D45355
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353854
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Tue, 12 Feb 2019 16:18:57 +0000 (16:18 +0000)]
[MCA] Improved debug prints. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353852
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Tue, 12 Feb 2019 16:10:50 +0000 (16:10 +0000)]
[PowerPC] Regenerate test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353851
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 12 Feb 2019 15:04:03 +0000 (15:04 +0000)]
AMDGPU/GlobalISel: Add more insert/extract testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353848
91177308-0d34-0410-b5e6-
96231b3b80d8
David Green [Tue, 12 Feb 2019 15:02:57 +0000 (15:02 +0000)]
[Codegen] Make sure kill flags are not incorrect from removed machine phi's
We need to clear the kill flags on both SingleValReg and OldReg, to ensure they remain
conservatively correct.
Differential Revision: https://reviews.llvm.org/D58114
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353847
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Tue, 12 Feb 2019 15:01:07 +0000 (15:01 +0000)]
[llvm-dwp] Abort when dwo_id is unset
Summary:
An empty dwo_id indicates a degenerate .dwo file that should not have been generated in the first place. Instead of discovering this error later when merging with another degenerate .dwo file, print an error immediately when noticing an unset dwo_id, including the filename of the offending file.
Test case created by compiling a trivial file w/ `-fno-split-dwarf-inlining -gmlt -gsplit-dwarf -c` prior to r353771
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: jdoerfert, aprantl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58085
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353846
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 12 Feb 2019 14:54:55 +0000 (14:54 +0000)]
AMDGPU/GlobalISel: Only make f16 constants legal on f16 targets
We could deal with it, but there's no real point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353845
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 12 Feb 2019 14:54:54 +0000 (14:54 +0000)]
GlobalISel: Use default rounding mode when extending fconstant
I don't think this matters since the values should all be exactly
representable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353844
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Tue, 12 Feb 2019 14:54:52 +0000 (14:54 +0000)]
GlobalISel: Move some more legalize cases into functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353843
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam McCall [Tue, 12 Feb 2019 14:43:30 +0000 (14:43 +0000)]
[LoopSimplifyCFG] Fix test broken in release mode in r353813
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353842
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 12 Feb 2019 11:31:46 +0000 (11:31 +0000)]
[NFC] Simplify code & reduce nest slightly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353832
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeremy Morse [Tue, 12 Feb 2019 10:54:30 +0000 (10:54 +0000)]
[DebugInfo] Don't salvage load operations (PR40628).
Salvaging a redundant load instruction into a debug expression hides a
memory read from optimisation passes. Passes that alter memory behaviour
(such as LICM promoting memory to a register) aren't aware of these debug
memory reads and leave them unaltered, making the debug variable location
point somewhere unsafe.
Teaching passes to know about these debug memory reads would be challenging
and probably incomplete. Finding dbg.value instructions that need to be fixed
would likely be computationally expensive too, as more analysis would be
required. It's better to not generate debug-memory-reads instead, alas.
Changed tests:
* DeadStoreElim: test for salvaging of intermediate operations contributing
to the dead store, instead of salvaging of the redundant load,
* GVN: remove debuginfo behaviour checks completely, this behaviour is still
covered by other tests,
* InstCombine: don't test for salvaged loads, we're removing that behaviour.
Differential Revision: https://reviews.llvm.org/D57962
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353824
91177308-0d34-0410-b5e6-
96231b3b80d8
David Stenberg [Tue, 12 Feb 2019 10:51:27 +0000 (10:51 +0000)]
[DebugInfo] Keep parameter DBG_VALUEs before prologue code
Summary:
This is a preparatory change for removing the code from
DebugHandlerBase::beginFunction() which changes the starting label for
the first non-overlapping DBG_VALUEs of parameters to the beginning of
the function. It does that to be able to show parameters when entering a
function. However, that code does not consider what defines the values,
which can result in the ranges for the debug values starting before
their defining instructions. That code is removed in a follow-up patch.
When prologue code is inserted, it leads to DBG_VALUEs that start
directly in the entry block being moved down after the prologue
instructions. This patch fixes that by stashing away DBG_VALUEs for
parameters before emitting the prologue, and then reinserts them at the
start of the block. This assumes that there is no target that somehow
clobbers parameter registers in the frame setup; there is no such case
in the lit tests at least.
See PR40188 for more information.
Reviewers: aprantl, dblaikie, rnk, jmorse
Reviewed By: aprantl
Subscribers: bjope, llvm-commits
Tags: #debug-info
Differential Revision: https://reviews.llvm.org/D57510
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353823
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 12 Feb 2019 09:59:44 +0000 (09:59 +0000)]
[IndVars] Fix corner case with unreachable Phi inputs. PR40454
Logic in `getInsertPointForUses` doesn't account for a corner case when `Def`
only comes to a Phi user from unreachable blocks. In this case, the incoming
value may be arbitrary (and not even available in the input block) and break
the loop-related invariants that are asserted below.
In fact, if we encounter this situation, no IR modification is needed. This
Phi will be simplified away with nearest cleanup.
Differential Revision: https://reviews.llvm.org/D58045
Reviewed By: spatel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353816
91177308-0d34-0410-b5e6-
96231b3b80d8
Fangrui Song [Tue, 12 Feb 2019 09:56:01 +0000 (09:56 +0000)]
[llvm-readobj] Only allow 4-byte pr_data
Summary: AMD64 psABI says: "The pr_data field of each property contains a 4-byte unsigned integer." Thus we don't need to handle 8-byte pr_data.
Reviewers: mike.dvoretsky, grimar, craig.topper, xiangzhangllvm, hjl.tools
Reviewed By: grimar
Subscribers: rupprecht, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D58103
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353815
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Tue, 12 Feb 2019 09:50:04 +0000 (09:50 +0000)]
[llvm-readobj] - Simplify .gnu.version_r dumping a bit.
Current implementation takes "Number of needed versions" from DT_VERNEEDNUM
dynamic tag entry. Though it would be a bit simpler to take it from sh_info
section header field directly:
https://docs.oracle.com/cd/E19683-01/816-1386/chapter6-94076/index.html
Differential revision: https://reviews.llvm.org/D58048
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353814
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 12 Feb 2019 09:37:00 +0000 (09:37 +0000)]
[LoopSimplifyCFG] Change logic of dead loops removal to avoid hitting asserts
The function `LI.erase` has some invariants that need to be preserved when it
tries to remove a loop which is not the top-level loop. In particular, it
requires loop's preheader to be strictly in loop's parent. Our current logic
of deletion of dead blocks may erase the information about preheader before we
handle the loop, and therefore we may hit this assertion.
This patch changes the logic of loop deletion: we make them top-level loops
before we actually erase them. This allows us to trigger the simple branch of
`erase` logic which just detatches blocks from the loop and does not try to do
some complex stuff that need this invariant.
Thanks to @uabelho for reporting this!
Differential Revision: https://reviews.llvm.org/D57221
Reviewed By: fedor.sergeev
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353813
91177308-0d34-0410-b5e6-
96231b3b80d8
George Rimar [Tue, 12 Feb 2019 09:08:59 +0000 (09:08 +0000)]
[yaml2obj/obj2yaml] - Move `Info` field out from `Section` class.
ELFYAML.h contains a `Section` class which is a base for a few other
sections classes that are used for mapping different section types.
`Section` has a `StringRef Info` field used for storing sh_info.
At the same time, sh_info has very different meanings for sections and
cannot be processed in a similar way generally,
for example ELFDumper does not handle it in `dumpCommonSection`
but do that in `dumpGroup` and `dumpCommonRelocationSection` respectively.
At this moment, we have and handle it as a string, because that was possible for
the current use case. But also it can simply be a number:
For SHT_GNU_verdef is "The number of version definitions within the section."
The patch moves `Info` field out to be able to have it as a number.
With that change, each class will be able to decide what type and purpose
of the sh_info field it wants to use.
I also had to edit 2 test cases. This is because patch fixes a bug. Previously we
accepted yaml files with Info fields for all sections (for example, for SHT_DYNSYM too).
But we do not handle it and the resulting objects had zero sh_info fields set for
such sections. Now it is accepted only for sections that supports it.
Differential revision: https://reviews.llvm.org/D58054
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353810
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Tue, 12 Feb 2019 09:08:52 +0000 (09:08 +0000)]
LibFuzzer.rst: double backticks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353809
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 12 Feb 2019 08:10:29 +0000 (08:10 +0000)]
Delete blocks from DTU to avoid dangling pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353804
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 12 Feb 2019 07:48:07 +0000 (07:48 +0000)]
[LoopSimplifyCFG] Pay respect to LCSSA when removing dead blocks
Utility function that we use for blocks deletion always unconditionally removes
one-input Phis. In LoopSimplifyCFG, it can lead to breach of LCSSA form.
This patch alters this function to keep them if needed.
Differential Revision: https://reviews.llvm.org/D57231
Reviewed By: fedor.sergeev
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353803
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 12 Feb 2019 07:09:29 +0000 (07:09 +0000)]
[NFC] Rename DontDeleteUselessPHIs --> KeepOneInputPHIs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353801
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 12 Feb 2019 06:25:58 +0000 (06:25 +0000)]
[Statepoint Lowering] Update misleading comments about chains
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353800
91177308-0d34-0410-b5e6-
96231b3b80d8
Max Kazantsev [Tue, 12 Feb 2019 06:14:27 +0000 (06:14 +0000)]
[NFC] Add parameter for keeping one-input Phis in DeleteDeadBlock(s)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353799
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 12 Feb 2019 06:14:18 +0000 (06:14 +0000)]
[X86] Collapse FP_TO_INT16_IN_MEM/FP_TO_INT32_IN_MEM/FP_TO_INT64_IN_MEM into a single opcode using memory VT to distinquish. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353798
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 12 Feb 2019 06:14:16 +0000 (06:14 +0000)]
[X86] Remove the value type operand from the floating point load/store MemIntrinsicSDNodes. Use the MemoryVT instead. NFCI
We already have the memory VT, we can just match from that during isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353797
91177308-0d34-0410-b5e6-
96231b3b80d8
Shoaib Meenai [Tue, 12 Feb 2019 02:25:27 +0000 (02:25 +0000)]
[build] Remove a stray comment. NFC
The CMake change associated with this comment was removed but the
comment got left behind. Add a newline instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353793
91177308-0d34-0410-b5e6-
96231b3b80d8
Petr Hosek [Tue, 12 Feb 2019 02:11:25 +0000 (02:11 +0000)]
[CMake] Don't override required compiler flags in the runtimes build
Ensure that HandleLLVMOptions adds all necessary required flags,
including -Wno-error when building with LLVM_ENABLE_WERROR enabled.
Differential Revision: https://reviews.llvm.org/D58092
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353790
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 12 Feb 2019 01:46:30 +0000 (01:46 +0000)]
[x86] add tests for logic of setcc (PR40611); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353789
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Tue, 12 Feb 2019 01:46:26 +0000 (01:46 +0000)]
[PowerPC] add tests for logic of setcc (PR40611); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353788
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 12 Feb 2019 01:19:00 +0000 (01:19 +0000)]
Fix r353771 to target linux only (split-dwarf isn't supported on macho)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353785
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Tue, 12 Feb 2019 00:33:25 +0000 (00:33 +0000)]
[LoopReroll] Fix reroll root legality checking.
The code checked that the first root was an appropriate distance from
the base value, but skipped checking the other roots. This could lead to
rerolling a loop that can't be legally rerolled (at least, not without
rewriting the loop in a non-trivial way).
Differential Revision: https://reviews.llvm.org/D56812
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353779
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 12 Feb 2019 00:12:46 +0000 (00:12 +0000)]
[Test] Use autogenerated checks for more statepoint tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353776
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Tue, 12 Feb 2019 00:01:39 +0000 (00:01 +0000)]
[Tests] Fill out a few tests around gc relocation uniquing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353773
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Tue, 12 Feb 2019 00:00:38 +0000 (00:00 +0000)]
DebugInfo: Split DWARF + gmlt + no-split-dwarf-inlining shouldn't emit anything to the .dwo file
This configuration (due to r349207) was intended not to emit any DWO CU,
but a degenerate CU was still being emitted - containing a header and a
DW_TAG_compile_unit with no attributes.
Under that situation, emit nothing to the .dwo file. (since this is a
dynamic property of the input the .dwo file is still emitted, just with
nothing in it (so a valid, but empty, ELF file) - if some other CU
didn't satisfy this criteria, its DWO CU would still go there, etc)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353771
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 11 Feb 2019 23:55:24 +0000 (23:55 +0000)]
[Test] Autogenerate a statepoint test and actual show the reload
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353770
91177308-0d34-0410-b5e6-
96231b3b80d8
Philip Reames [Mon, 11 Feb 2019 23:34:33 +0000 (23:34 +0000)]
Be conservative about unordered accesses for the moment
Background: As described in https://reviews.llvm.org/D57601, I'm working towards separating volatile and atomic in the MMO uses for atomic instructions.
In https://reviews.llvm.org/D57593, I fixed a bug where isUnordered was returning the wrong result, but didn't account for the fact I was getting slightly ahead of myself. While both uses of isUnordered are correct (as far as I can tell), we don't have tests to demonstrate this and being aggressive gets in the way of having the removal of volatile truly be non-functional. Once D57601 lands, I will return to these call sites, revert this patch, and add the appropriate tests to show the expected behaviour.
Differential Revision: https://reviews.llvm.org/D57802
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353766
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 11 Feb 2019 23:02:02 +0000 (23:02 +0000)]
[tblgen] Add a timer covering the time spent reading the Instruction defs
This patch adds a -time-regions option to tablegen that can enable timers
(currently only one) that assess the performance of tablegen itself. This
can be useful for identifying scaling problems with tablegen backends.
This particular timer has allowed me to ignore time that is not attributed
the GISel combiner pass. It's useful by itself but it is particularly
useful in combination with https://reviews.llvm.org/D52954 which causes
this period of time to be annotated within Xcode Instruments which in turn
allows profile samples and recorded allocations attributed to reading
instructions to be filtered out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353763
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 11 Feb 2019 22:12:43 +0000 (22:12 +0000)]
GlobalISel: Verify G_EXTRACT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353759
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Mon, 11 Feb 2019 22:12:01 +0000 (22:12 +0000)]
[TargetLibraryInfo] Update run time support for Windows
It seems that, since VC19, the `float` C99 math functions are supported for all
targets, unlike the C89 ones.
According to the discussion at https://reviews.llvm.org/D57625.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353758
91177308-0d34-0410-b5e6-
96231b3b80d8
Ana Pazos [Mon, 11 Feb 2019 22:10:08 +0000 (22:10 +0000)]
[LegalizeTypes] Expand FNEG to bitwise op for IEEE FP types
Summary:
Except for custom floating point types x86_fp80 and ppc_fp128,
expand Y = FNEG(X) to Y = X ^ sign mask to avoid library call.
Using bitwise operation can improve code size and performance.
Reviewers: efriedma
Reviewed By: efriedma
Subscribers: efriedma, kpn, arsenm, eli.friedman, javed.absar, rbar, johnrusso, simoncook, sabuasal, niosHD, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, asb, llvm-commits
Differential Revision: https://reviews.llvm.org/D57875
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353757
91177308-0d34-0410-b5e6-
96231b3b80d8
Scott Linder [Mon, 11 Feb 2019 22:01:13 +0000 (22:01 +0000)]
[IRReader] Expose getLazyIRModule
Currently there is no way to lazy-load an in-memory IR module without
first writing it to disk. This patch just exposes the existing
implementation of getLazyIRModule.
This is effectively a revert of rL212364
Differential Revision: https://reviews.llvm.org/D56203
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353755
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 11 Feb 2019 22:00:39 +0000 (22:00 +0000)]
GlobalISel: Implement moreElementsVector for implicit_def
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353754
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Mon, 11 Feb 2019 21:33:54 +0000 (21:33 +0000)]
GlobalISel: Fix not calling the observer when legalizing G_EXTRACT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353750
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 11 Feb 2019 20:45:19 +0000 (20:45 +0000)]
[globalisel] Correct string emitted by GISelChangeObserver::erasingInstr()
The API indicates that the MI is about to be erased rather than it has been erased.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353746
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 11 Feb 2019 20:38:10 +0000 (20:38 +0000)]
[X86] Correct the memory operand for the FLD emitted in FP_TO_INTHelper for 32-bit SSE targets.
We were using DstTy, but that represents the integer type we are converting to which is i64 in this
case. The FLD is part of an intermediate step to get from the SSE registers to the x87 registers.
If the floating point type is f32, the memory operand should reflect a 4 byte access not an 8 byte
access. The store we used to get from SSE to the stack is using the corect size.
While there, consistenly use TheVT in place of Op.getOperand(0).getValueType() throughout the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353745
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Davis [Mon, 11 Feb 2019 20:30:53 +0000 (20:30 +0000)]
[llvm-cxxfilt] Split and demangle stdin input
Summary:
Originally, llvm-cxxfilt would treat a line as a single mangled item to be demangled.
If a mangled name appears in the middle of that string, that name would not be demangled.
GNU c++filt splits and demangles every word in a string that is piped to it via stdin.
Prior to this patch llvm-cxxfilt would never split strings piped to it.
This patch replicates the GNU behavior and splits strings that are piped to it via stdin.
This fixes PR39990
Reviewers: compnerd, jhenderson, davide
Reviewed By: compnerd, jhenderson
Subscribers: erik.pilkington, jhenderson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353743
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 11 Feb 2019 20:05:49 +0000 (20:05 +0000)]
[globalisel] Restore comment explaining the nits of GISelChangeObserver::createdInstr()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353741
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Mon, 11 Feb 2019 19:51:21 +0000 (19:51 +0000)]
[MemorySSA] Remove verifyClobberSanity.
Summary:
This verification may fail after certain transformations due to
BasicAA's fragility. Added a small explanation and a testcase that
triggers the assert in checkClobberSanity (before its removal).
Addresses PR40509.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, llvm-commits, Prazek
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57973
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353739
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kruse [Mon, 11 Feb 2019 19:45:44 +0000 (19:45 +0000)]
Refactor setAlreadyUnrolled() and setAlreadyVectorized().
Loop::setAlreadyUnrolled() and
LoopVectorizeHints::setLoopAlreadyUnrolled() both add loop metadata that
stops the same loop from being transformed multiple times. This patch
merges both implementations.
In doing so we fix 3 potential issues:
* setLoopAlreadyUnrolled() kept the llvm.loop.vectorize/interleave.*
metadata even though it will not be used anymore. This already caused
problems such as http://llvm.org/PR40546. Change the behavior to the
one of setAlreadyUnrolled which deletes this loop metadata.
* setAlreadyUnrolled() used to create a new LoopID by calling
MDNode::get with nullptr as the first operand, then replacing it by
the returned references using replaceOperandWith. It is possible
that MDNode::get would instead return an existing node (due to
de-duplication) that then gets modified. To avoid, use a fresh
TempMDNode that does not get uniqued with anything else before
replacing it with replaceOperandWith.
* LoopVectorizeHints::matchesHintMetadataName() only compares the
suffix of the attribute to set the new value for. That is, when
called with "enable", would erase attributes such as
"llvm.loop.unroll.enable", "llvm.loop.vectorize.enable" and
"llvm.loop.distribute.enable" instead of the one to replace.
Fortunately, function was only called with "isvectorized".
Differential Revision: https://reviews.llvm.org/D57566
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353738
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 11 Feb 2019 19:26:27 +0000 (19:26 +0000)]
[InstCombine] Fix matchRotate bug when one operand is a ConstantExpr shift
This bug seems to be harmless in release builds, but will cause an error in UBSAN
builds or an assertion failure in debug builds.
When it gets to this opcode comparison, it assumes both of the operands are BinaryOperators,
but the prior m_LogicalShift will also match a ConstantExpr. The cast<BinaryOperator> will
assert in a debug build, or reading an invalid value for BinaryOp from memory with
((BinaryOperator*)constantExpr)->getOpcode() will cause an error in a UBSAN build.
The test I added will fail without this change in debug/UBSAN builds, but not in release.
Patch by: @AndrewScheidecker (Andrew Scheidecker)
Differential Revision: https://reviews.llvm.org/D58049
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353736
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjorn Pettersson [Mon, 11 Feb 2019 19:23:30 +0000 (19:23 +0000)]
[SelectionDAGBuilder] Add restrictions to EmitFuncArgumentDbgValue
Summary:
This patch fixes PR40587.
When a dbg.value instrinsic is emitted to the DAG
by using EmitFuncArgumentDbgValue the resulting
DBG_VALUE is hoisted to the beginning of the entry
block. I think the idea is to be able to locate
a formal argument already from the start of the
function.
However, EmitFuncArgumentDbgValue only checked that
the value that was used to describe a variable was
originating from a function parameter, not that the
variable itself actually was an argument to the
function. So when for example assigning a local
variable "local" the value from an argument "a",
the assocated DBG_VALUE instruction would be hoisted
to the beginning of the function, even if the scope
for "local" started somewhere else (or if "local"
was mapped to other values earlier in the function).
This patch adds some logic to EmitFuncArgumentDbgValue
to check that the variable being described actually
is an argument to the function. And that the dbg.value
being lowered already is in the entry block. Otherwise
we bail out, and the dbg.value will be handled as an
ordinary dbg.value (not as a "FuncArgumentDbgValue").
A tricky situation is when both the variable and
the value is related to function arguments, but not
neccessarily the same argument. We make sure that we
do not describe the same argument more than once as
a "FuncArgumentDbgValue". This solution works as long
as opt has injected a "first" dbg.value that corresponds
to the formal argument at the function entry.
Reviewers: jmorse, aprantl
Subscribers: jyknight, hiraditya, fedor.sergeev, dstenb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57702
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353735
91177308-0d34-0410-b5e6-
96231b3b80d8
Alina Sbirlea [Mon, 11 Feb 2019 19:07:15 +0000 (19:07 +0000)]
[LICM&MSSA] Limit store hoisting.
Summary:
If there is no clobbering access for a store inside the loop, that store
can only be hoisted if there are no interfearing loads.
A more general verification introduced here: there are no loads that are
not optimized to an access outside the loop.
Addresses PR40586.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57967
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353734
91177308-0d34-0410-b5e6-
96231b3b80d8
Evandro Menezes [Mon, 11 Feb 2019 19:02:28 +0000 (19:02 +0000)]
[TargetLibraryInfo] Update run time support for Windows
It seems that the run time for Windows has changed and supports more math
functions than it used to, especially on AArch64, ARM, and AMD64.
Fixes PR40541.
Differential revision: https://reviews.llvm.org/D57625
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353733
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Mon, 11 Feb 2019 18:56:39 +0000 (18:56 +0000)]
[AArch64][GlobalISel] Add isel support for a couple vector exts/truncs
Add support for
- v4s16 <-> v4s32
- v2s64 <-> v2s32
And update tests that use them to show that we generate the correct
instructions.
Differential Revision: https://reviews.llvm.org/D57832
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353732
91177308-0d34-0410-b5e6-
96231b3b80d8
Jessica Paquette [Mon, 11 Feb 2019 18:41:22 +0000 (18:41 +0000)]
[GlobalISel][AArch64] NFC: Remove unnecessary IR from select-fp-casts.mir
The IR section in this test doesn't do anything, so there's no point in it
being there. Since it's redundant, just remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353731
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rupprecht [Mon, 11 Feb 2019 18:05:48 +0000 (18:05 +0000)]
[DebugInfo] Fix /usr/lib/debug llvm-symbolizer lookup with relative paths
Summary:
rL189250 added a realpath call, and rL352916 because realpath breaks assumptions with some build systems. However, the /usr/lib/debug case has been clarified, falling back to /usr/lib/debug is currently broken if the obj passed in is a relative path. Adding a call to use absolute paths when falling back to /usr/lib/debug fixes that while still not making any realpath assumptions.
This also adds a --fallback-debug-path command line flag for testing (since we probably can't write to /usr/lib/debug from buildbot environments), but was also verified manually:
```
$ rm -f path/to/dwarfdump-test.elf-x86-64
$ strace llvm-symbolizer --obj=relative/path/to/dwarfdump-test.elf-x86-64.debuglink 0x40113f |& grep dwarfdump
```
Lookups went to relative/path/to/dwarfdump-test.elf-x86-64, relative/path/to/.debug/dwarfdump-test.elf-x86-64, and then finally /usr/lib/debug/absolute/path/to/dwarfdump-test.elf-x86-64.
Reviewers: dblaikie, samsonov
Reviewed By: dblaikie
Subscribers: krytarowski, aprantl, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D57916
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353730
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Mon, 11 Feb 2019 17:55:47 +0000 (17:55 +0000)]
[MCA][Scheduler] Track resources that were found busy when issuing an instruction.
This is a follow up of r353706. When the scheduler fails to issue a ready
instruction to the underlying pipelines, it now updates a mask of 'busy resource
units'. That information will be used in future to obtain the set of
"problematic" resources in the case of bottlenecks caused by resource pressure.
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353728
91177308-0d34-0410-b5e6-
96231b3b80d8