]> granicus.if.org Git - llvm/log
llvm
5 years agoAMDGPU: Add more tests for d16 loads
Matt Arsenault [Fri, 8 Mar 2019 20:30:51 +0000 (20:30 +0000)]
AMDGPU: Add more tests for d16 loads

Also fix a few cases that weren't testing what they were supposed to.

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

5 years agoAMDGPU: Don't bother checking the chain in areLoadsFromSameBasePtr
Matt Arsenault [Fri, 8 Mar 2019 20:30:51 +0000 (20:30 +0000)]
AMDGPU: Don't bother checking the chain in areLoadsFromSameBasePtr

This is only called in contexts that are verifying the chain itself,
and the query itself is only asking about the address.

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

5 years agoAMDGPU: Correct DS implementation of areLoadsFromSameBasePtr
Matt Arsenault [Fri, 8 Mar 2019 20:30:50 +0000 (20:30 +0000)]
AMDGPU: Correct DS implementation of areLoadsFromSameBasePtr

This was checking the wrong operands for the base register and the
offsets. The indexes are shifted by the number of output registers
from the machine instruction definition, and the chain is moved to the
end.

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

5 years ago[DEBUG_INFO][NVPTX]Emit empty .debug_loc section in presence of the debug option.
Alexey Bataev [Fri, 8 Mar 2019 20:08:04 +0000 (20:08 +0000)]
[DEBUG_INFO][NVPTX]Emit empty .debug_loc section in presence of the debug option.

Summary:
If the LLVM module shows that it has debug info, but the file is
actually empty and the real debug info is not emitted, the ptxas tool
emits error 'Debug information not found in presence of .target debug'.
We need at leas one empty debug section to silence this message. Section
`.debug_loc` is not emitted for PTX and we can emit empty `.debug_loc`
section if `debug` option was emitted.

Reviewers: tra

Subscribers: jholewinski, aprantl, llvm-commits

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

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

5 years ago[DAGCombiner] fold (add (add (xor a, -1), b), 1) -> (sub b, a)
Amaury Sechet [Fri, 8 Mar 2019 19:39:32 +0000 (19:39 +0000)]
[DAGCombiner] fold (add (add (xor a, -1), b), 1) -> (sub b, a)

Summary: This pattern is sometime created after legalization.

Reviewers: efriedma, spatel, RKSimon, zvi, bkramer

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years ago[CFLAnders] Fix typo in comment; NFC
George Burgess IV [Fri, 8 Mar 2019 19:28:55 +0000 (19:28 +0000)]
[CFLAnders] Fix typo in comment; NFC

Patch by Enna1!

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

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

5 years ago[RegisterCoalescer] Limit the number of joins for large live interval with
Wei Mi [Fri, 8 Mar 2019 19:25:32 +0000 (19:25 +0000)]
[RegisterCoalescer] Limit the number of joins for large live interval with
many valnos.

Recently we found compile time out problem in several cases when
SpeculativeLoadHardening was enabled. The significant compile time was spent
in register coalescing pass, where register coalescer tried to join many other
live intervals with some very large live intervals with many valnos.

Specifically, every time JoinVals::mapValues is called, computeAssignment will
be called by getNumValNums() times of the target live interval. If the large
live interval has N valnos and has N copies associated with it, trying to
coalescing those copies will at least cost N^2 complexity.

The patch adds some limit to the effort trying to join those very large live
intervals with others. By default, for live interval with > 100 valnos, and
when it has been coalesced with other live interval by more than 100 times,
we will stop coalescing for the live interval anymore. That put a compile
time cap for the N^2 algorithm and effectively solves the compile time
problem we saw.

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

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

5 years ago[x86] prevent infinite looping from inverse shuffle transforms
Sanjay Patel [Fri, 8 Mar 2019 19:20:28 +0000 (19:20 +0000)]
[x86] prevent infinite looping from inverse shuffle transforms

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

5 years ago[X86] Add test case for PR22473
Simon Pilgrim [Fri, 8 Mar 2019 19:16:26 +0000 (19:16 +0000)]
[X86] Add test case for PR22473

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

5 years ago[ARM][FIX] Fix vfmal.f16 and vfmsl.f16 operand
Diogo N. Sampaio [Fri, 8 Mar 2019 17:11:20 +0000 (17:11 +0000)]
[ARM][FIX] Fix vfmal.f16 and vfmsl.f16 operand

The indexed variant of vfmal.f16 and vfmsl.f16
instructions use the uppser bits of the indexed
operand to store the index (1 bit for the double
variant, 2 bits for the quad).

This limits the usable registers to d0 - d7 or
s0 - s15. This patch enforces this limitation.

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

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

5 years agoFix typo in constant vector
Simon Pilgrim [Fri, 8 Mar 2019 15:17:26 +0000 (15:17 +0000)]
Fix typo in constant vector

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

5 years ago[llvm-readelf]Don't lose negative-ness of negative addends for no symbol relocations
James Henderson [Fri, 8 Mar 2019 13:22:05 +0000 (13:22 +0000)]
[llvm-readelf]Don't lose negative-ness of negative addends for no symbol relocations

llvm-readelf prints relocation addends as:

  <symbol value>[+-]<absolute addend>

where [+-] is determined from whether addend is less than zero or not.
However, it does not print the +/- if there is no symbol, which meant
that negative addends became their positive value with no indication
that this had happened. This patch stops the absolute conversion when
addends are negative and there is no associated symbol.

Reviewed by: Higuoxing, mattd, MaskRay

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

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

5 years agogn build: Merge r355685
Nico Weber [Fri, 8 Mar 2019 13:07:22 +0000 (13:07 +0000)]
gn build: Merge r355685

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

5 years agogn build: Unbreak finding a working `gn` on $PATH on Unix after r355645
Nico Weber [Fri, 8 Mar 2019 13:01:58 +0000 (13:01 +0000)]
gn build: Unbreak finding a working `gn` on $PATH on Unix after r355645

From the Python subprocess docs:

   If shell is True, it is recommended to pass args as a string rather than as
   a sequence.

   [...]

   If args is a sequence, the first item specifies the command string, and any
   additional items will be treated as additional arguments to the shell itself.

Prior to this change, the `--version` would be passed to the shell, not to
a potential gn binary on $PATH, and running `gn` without any arguments makes
it exit with an exit code != 0, so the script would think that there wasn't
a working gn binary on $PATH.

Fix this by following the documentation's recommendation of using a string
now that we pass shell=True. I tested this on macOS and Windows, each with
the three cases of

- no gn on PATH (should run gn downloaded by get.py if present,
  else suggest running get.py)
- broken gn wrapper on PATH (should behave like the previous item)
- working gn on PATH (should use gn on PATH)

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

5 years agogn build: Unbreak get.py and gn.py on Windows
Nico Weber [Fri, 8 Mar 2019 12:45:50 +0000 (12:45 +0000)]
gn build: Unbreak get.py and gn.py on Windows

`os.uname()` doesn't exist on Windows, so use `platform.machine()` which
returns `os.uname()[4]` on non-Win and (on 64-bit systems) "AMD64" on Windows.
Also use `sys.platform` instead of `platform` to check for Windows-ness for the
file extension in gn.py (get.py got this right).

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

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

5 years ago[DAGCombine] Merge visitSMULO+visitUMULO into visitMULO. NFCI.
Simon Pilgrim [Fri, 8 Mar 2019 11:41:18 +0000 (11:41 +0000)]
[DAGCombine] Merge visitSMULO+visitUMULO into visitMULO. NFCI.

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

5 years ago[DAGCombine] Merge visitSADDO+visitUADDO into visitADDO. NFCI.
Simon Pilgrim [Fri, 8 Mar 2019 11:30:33 +0000 (11:30 +0000)]
[DAGCombine] Merge visitSADDO+visitUADDO into visitADDO. NFCI.

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

5 years ago[DAGCombine] Merge visitSSUBO+visitUSUBO into visitSUBO. NFCI.
Simon Pilgrim [Fri, 8 Mar 2019 11:16:55 +0000 (11:16 +0000)]
[DAGCombine] Merge visitSSUBO+visitUSUBO into visitSUBO. NFCI.

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

5 years ago[IR][ARM] Add function pointer alignment to datalayout
Michael Platings [Fri, 8 Mar 2019 10:44:06 +0000 (10:44 +0000)]
[IR][ARM] Add function pointer alignment to datalayout

Use this feature to fix a bug on ARM where 4 byte alignment is
incorrectly assumed.

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

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

5 years ago[SelectionDAG] Allow the user to specify a memeq function.
Clement Courbet [Fri, 8 Mar 2019 09:07:45 +0000 (09:07 +0000)]
[SelectionDAG] Allow the user to specify a memeq function.

Summary:
Right now, when we encounter a string equality check,
e.g. `if (memcmp(a, b, s) == 0)`, we try to expand to a comparison if `s` is a
small compile-time constant, and fall back on calling `memcmp()` else.

This is sub-optimal because memcmp has to compute much more than
equality.

This patch replaces `memcmp(a, b, s) == 0` by `bcmp(a, b, s) == 0` on platforms
that support `bcmp`.

`bcmp` can be made much more efficient than `memcmp` because equality
compare is trivially parallel while lexicographic ordering has a chain
dependency.

Subscribers: fedor.sergeev, jyknight, ckennelly, gchatelet, llvm-commits

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

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

5 years ago[AMDGPU] V_CVT_F32_UBYTE{0,1,2,3} are full rate instructions
Carl Ritson [Fri, 8 Mar 2019 09:03:11 +0000 (09:03 +0000)]
[AMDGPU] V_CVT_F32_UBYTE{0,1,2,3} are full rate instructions

Summary: Fix a bug in the scheduling model where V_CVT_F32_UBYTE{0,1,2,3} are incorrectly marked as quarter rate instructions.

Reviewers: arsenm, rampitec

Reviewed By: rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Improve the type checking in isLegalMaskedLoad and isLegalMaskedGather.
Craig Topper [Fri, 8 Mar 2019 07:33:43 +0000 (07:33 +0000)]
[X86] Improve the type checking in isLegalMaskedLoad and isLegalMaskedGather.

We were just checking pointer size and type primitive size. But this caused unintended things like vectors of half being accepted by masked load/store.

For FP we now explicitly check for only double and float.

For pointers we now let any pointer through. Trusting that only 32 and 64 would be used to generate assembly.

We only check bitwidth after checking that the type is an integer.

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

5 years ago[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/
Petr Hosek [Fri, 8 Mar 2019 05:35:22 +0000 (05:35 +0000)]
[runtimes] Move libunwind, libc++abi and libc++ to lib/ and include/

This change is a consequence of the discussion in "RFC: Place libs in
Clang-dedicated directories", specifically the suggestion that
libunwind, libc++abi and libc++ shouldn't be using Clang resource
directory.  Tools like clangd make this assumption, but this is
currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build.
This change addresses that by moving the output of these libraries to
lib/<target> and include/ directories, leaving resource directory only
for compiler-rt runtimes and Clang builtin headers.

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

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

5 years ago[Bitcode] Fix bitcode compatibility issue with clang.arc.use intrinsic
Steven Wu [Fri, 8 Mar 2019 05:27:53 +0000 (05:27 +0000)]
[Bitcode] Fix bitcode compatibility issue with clang.arc.use intrinsic

Summary:
In r349534, objc arc implementation is switched to use intrinsics and at
the same time, clang.arc.use is renamed to llvm.objc.clang.arc.use to
make the naming more consistent. The side-effect of that is llvm no
longer recognize it as intrinsics and codegen external references to
it instead.

Rather than upgrade the old intrinsics name to the new one and wait for
the arc-contract pass to remove it, simply remove it in the bitcode
upgrader.

rdar://problem/48607063

Reviewers: pete, ahatanak, erik.pilkington, dexonsmith

Reviewed By: pete, dexonsmith

Subscribers: jkorous, jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years ago[x86] add extract FP tests for target-specific nodes; NFC
Sanjay Patel [Thu, 7 Mar 2019 23:55:54 +0000 (23:55 +0000)]
[x86] add extract FP tests for target-specific nodes; NFC

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

5 years agoTemporarily diasble debug output in GenericDomTreeConstruction.h
Adrian Prantl [Thu, 7 Mar 2019 23:30:19 +0000 (23:30 +0000)]
Temporarily diasble debug output in GenericDomTreeConstruction.h
to get the modules bots running again.

The LLVM_DEBUG macro only plays well with a modular build of LLVM when
the header is marked as textual, but doing so causes redefinition
errors.

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

5 years agoMake GenericDomTreeConstruction textual instead.
Adrian Prantl [Thu, 7 Mar 2019 23:17:11 +0000 (23:17 +0000)]
Make GenericDomTreeConstruction textual instead.

I think the problem is that it uses the LLVM_DEBUG macro in funciton bodies.

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

5 years agoWork around a module build error on the LLDB incremental green dragon bot.
Adrian Prantl [Thu, 7 Mar 2019 22:25:26 +0000 (22:25 +0000)]
Work around a module build error on the LLDB incremental green dragon bot.

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

5 years ago[GN] Locate prebuilt binaries correctly.
Mitch Phillips [Thu, 7 Mar 2019 22:20:36 +0000 (22:20 +0000)]
[GN] Locate prebuilt binaries correctly.

Use the system shell to see if we can find a 'gn' binary on $PATH. This solves the error wherein subprocess.call fails ungracefully if the binary doesn't exist.

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

5 years agoAdd secondary libstdc++ 4.8 and 5.1 detection mechanisms
Hubert Tong [Thu, 7 Mar 2019 21:28:33 +0000 (21:28 +0000)]
Add secondary libstdc++ 4.8 and 5.1 detection mechanisms

Summary:
The date-based approach to detecting unsupported versions of libstdc++
does not handle bug fix releases of older versions. As an example, the
`__GLIBCXX__` value associated with version 5.1, `20150422`, is less
than the values associated with versions 4.8.5 and 4.9.3.

This patch adds secondary checks based on certain properties in
sufficiently new versions of libstdc++.

Reviewers: jfb, tstellar, rnk, sfertile, nemanjai

Reviewed By: jfb

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

5 years ago[X86] Correct scheduler information for rotate by constant for Haswell, Broadwell...
Craig Topper [Thu, 7 Mar 2019 21:22:56 +0000 (21:22 +0000)]
[X86] Correct scheduler information for rotate by constant for Haswell, Broadwell, and Skylake.

Rotate with explicit immediate is a single uop from Haswell on. An immediate of 1 has a dependency on the previous writer of flags, but the other immediate values do not.

The implicit rotate by 1 instruction is 2 uops. But the flags are merged after the rotate uop so the data result does not see the flag dependency. But I don't think we have any way of modeling that.

RORX is 1 uop without the load. 2 uops with the load. We currently model these with WriteShift/WriteShiftLd.

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

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

5 years ago[X86] Model ADC/SBB with immediate 0 more accurately in the Haswell scheduler model
Craig Topper [Thu, 7 Mar 2019 21:22:51 +0000 (21:22 +0000)]
[X86] Model ADC/SBB with immediate 0 more accurately in the Haswell scheduler model

Haswell and possibly Sandybridge have an optimization for ADC/SBB with immediate 0 to use a single uop flow. This only applies GR16/GR32/GR64 with an 8-bit immediate. It does not apply to GR8. It also does not apply to the implicit AX/EAX/RAX forms.

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

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

5 years ago[CodeGen] Reuse BlockUtils for -unreachableblockelim pass (NFC)
Brian Gesiak [Thu, 7 Mar 2019 20:40:55 +0000 (20:40 +0000)]
[CodeGen] Reuse BlockUtils for -unreachableblockelim pass (NFC)

Summary:
The logic in the -unreachableblockelim pass does the following:

1. It traverses the function it's given in depth-first order and
   creates a set of basic blocks that are unreachable from the
   function's entry node.
2. It iterates over each of those unreachable blocks and (1) removes any
   successors' references to the dead block, and (2) replaces any uses of
   instructions from the dead block with null.

The logic in (2) above is identical to what the `llvm::DeleteDeadBlocks`
function from `BasicBlockUtils.h` does. The only difference is that
`llvm::DeleteDeadBlocks` replaces uses of instructions from dead blocks
not with null, but with undef.

Replace the duplicate logic in the -unreachableblockelim pass with a
call to `llvm::DeleteDeadBlocks`. This results in less code but no
functional change (NFC).

Reviewers: mkazantsev, wmi, davidxl, silvas, davide

Reviewed By: davide

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoAMDHSA: Code object v3 updates
Konstantin Zhuravlyov [Thu, 7 Mar 2019 19:58:29 +0000 (19:58 +0000)]
AMDHSA: Code object v3 updates

  - Copy kernel symbol attributes into kernel descriptor attributes
  - Make sure kernel symbol's visibility is not "higher" than protected

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

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

5 years ago[llvm-mca] Emit a message when no bottlenecks are identified.
Matt Davis [Thu, 7 Mar 2019 19:34:44 +0000 (19:34 +0000)]
[llvm-mca] Emit a message when no bottlenecks are identified.

Summary:
Since bottleneck hints are enabled via user request, it can be
confusing if no bottleneck information is presented.  Such is the
case when no bottlenecks are identified.  This patch emits a message
in that case.

Reviewers: andreadb

Reviewed By: andreadb

Subscribers: tschuett, gbedwell, llvm-commits

Tags: #llvm

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

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

5 years ago[GN] Remove DataLayoutTest.cpp from IR Unittests.
Mitch Phillips [Thu, 7 Mar 2019 18:58:45 +0000 (18:58 +0000)]
[GN] Remove DataLayoutTest.cpp from IR Unittests.

Merge of GN files to fit with rL355616.

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

5 years agoDelete x86_64 ShadowCallStack support
Vlad Tsyrklevich [Thu, 7 Mar 2019 18:56:36 +0000 (18:56 +0000)]
Delete x86_64 ShadowCallStack support

Summary:
ShadowCallStack on x86_64 suffered from the same racy security issues as
Return Flow Guard and had performance overhead as high as 13% depending
on the benchmark. x86_64 ShadowCallStack was always an experimental
feature and never shipped a runtime required to support it, as such
there are no expected downstream users.

Reviewers: pcc

Reviewed By: pcc

Subscribers: mgorny, javed.absar, hiraditya, jdoerfert, cfe-commits, #sanitizers, llvm-commits

Tags: #clang, #sanitizers, #llvm

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

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

5 years ago[PowerPC] Run clang format to avoid compiling warning.
Jinsong Ji [Thu, 7 Mar 2019 18:55:21 +0000 (18:55 +0000)]
[PowerPC] Run clang format to avoid compiling warning.

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

5 years ago[Sanitizer] Add 'dispatch' feature to be used in compiler-rt tests
Julian Lettner [Thu, 7 Mar 2019 18:15:23 +0000 (18:15 +0000)]
[Sanitizer] Add 'dispatch' feature to be used in compiler-rt tests

Reviewed By: dvyukov

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

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

5 years agoRollback of rL355585.
Mitch Phillips [Thu, 7 Mar 2019 18:13:39 +0000 (18:13 +0000)]
Rollback of rL355585.

Introduces memory leak in FunctionTest.GetPointerAlignment that breaks sanitizer buildbots:

```
=================================================================
==2453==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 128 byte(s) in 1 object(s) allocated from:
    #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105
    #1 0x16936bc in llvm::User::operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/User.cpp:151:19
    #2 0x7c3fe9 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:12
    #3 0x7c3fe9 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136
    #4 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #5 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
    #6 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #7 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #8 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #9 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #10 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
    #11 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #12 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
    #13 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

Indirect leak of 40 byte(s) in 1 object(s) allocated from:
    #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105
    #1 0x151be6b in make_unique<llvm::ValueSymbolTable> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/ADT/STLExtras.h:1349:29
    #2 0x151be6b in llvm::Function::Function(llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, unsigned int, llvm::Twine const&, llvm::Module*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/Function.cpp:241
    #3 0x7c4006 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:16
    #4 0x7c4006 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136
    #5 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #6 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
    #7 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #8 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #9 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #10 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #11 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
    #12 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #13 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
    #14 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

SUMMARY: AddressSanitizer: 168 byte(s) leaked in 2 allocation(s).
```

See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11358/steps/check-llvm%20asan/logs/stdio for more information.

Also introduces use-of-uninitialized-value in ConstantsTest.FoldGlobalVariablePtr:
```
==7070==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x14e703c in User /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5
    #1 0x14e703c in Constant /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/Constant.h:44
    #2 0x14e703c in llvm::GlobalValue::GlobalValue(llvm::Type*, llvm::Value::ValueTy, llvm::Use*, unsigned int, llvm::GlobalValue::LinkageTypes, llvm::Twine const&, unsigned int) /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalValue.h:78
    #3 0x14e5467 in GlobalObject /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalObject.h:34:9
    #4 0x14e5467 in llvm::GlobalVariable::GlobalVariable(llvm::Type*, bool, llvm::GlobalValue::LinkageTypes, llvm::Constant*, llvm::Twine const&, llvm::GlobalValue::ThreadLocalMode, unsigned int, bool) /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/Globals.cpp:314
    #5 0x6938f1 in llvm::(anonymous namespace)::ConstantsTest_FoldGlobalVariablePtr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm/unittests/IR/ConstantsTest.cpp:565:18
    #6 0x1a240a1 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc
    #7 0x1a240a1 in testing::Test::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2474
    #8 0x1a26d26 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #9 0x1a2815f in testing::TestCase::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #10 0x1a43de8 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #11 0x1a42c47 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc
    #12 0x1a42c47 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4257
    #13 0x1a0dfba in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #14 0x1a0dfba in main /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50
    #15 0x7f2081c412e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #16 0x4dff49 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/unittests/IR/IRTests+0x4dff49)

SUMMARY: MemorySanitizer: use-of-uninitialized-value /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5 in User
```

See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/30222/steps/check-llvm%20msan/logs/stdio for more information.

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

5 years ago[InterleavedAccessAnalysis] Fix integer overflow in insertMember.
Florian Hahn [Thu, 7 Mar 2019 17:50:16 +0000 (17:50 +0000)]
[InterleavedAccessAnalysis] Fix integer overflow in insertMember.

Without checking for integer overflow, invalid members can be added
 e.g. if the calculated key overflows, becomes positive and the largest key.

This fixes
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7560
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13128
      https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13229

Reviewers: Ayal, anna, hsaito, efriedma

Reviewed By: efriedma

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

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

5 years ago[DebugInfo] Fix the type of the formated variable
Petar Jovanovic [Thu, 7 Mar 2019 16:31:08 +0000 (16:31 +0000)]
[DebugInfo] Fix the type of the formated variable

Change the format type of *Personality and *LSDAAddress to PRIx64 since
they are of type uint64_t.
The problem was detected on mips builds, where it was printing junk values
and causing test failure.

Patch by Milos Stojanovic.

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

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

5 years agogn build: Port r342002
Nico Weber [Thu, 7 Mar 2019 15:44:59 +0000 (15:44 +0000)]
gn build: Port r342002

I had hoped we could remove the dependency on shell32.lib from lib/Support
(there isn't much depending on it), but looks like this will take a while. So
for now, port this over.

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

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

5 years agogn build: Merge r355522
Nico Weber [Thu, 7 Mar 2019 15:43:14 +0000 (15:43 +0000)]
gn build: Merge r355522

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

5 years ago[llvm-readobj] Dump DT_USED value as string like GNU readelf does
Xing GUO [Thu, 7 Mar 2019 14:53:10 +0000 (14:53 +0000)]
[llvm-readobj] Dump DT_USED value as string like GNU readelf does

Reviewers: jhenderson

Reviewed By: jhenderson

Subscribers: rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[LSR] Attempt to increase the accuracy of LSR's setup cost
David Green [Thu, 7 Mar 2019 13:44:40 +0000 (13:44 +0000)]
[LSR] Attempt to increase the accuracy of LSR's setup cost

In some loops, we end up generating loop induction variables that look like:
  {(-1 * (zext i16 (%i0 * %i1) to i32))<nsw>,+,1}
As opposed to the simpler:
  {(zext i16 (%i0 * %i1) to i32),+,-1}
i.e we count up from -limit to 0, not the simpler counting down from limit to
0. This is because the scores, as LSR calculates them, are the same and the
second is filtered in place of the first. We end up with a redundant SUB from 0
in the code.

This patch tries to make the calculation of the setup cost a little more
thoroughly, recursing into the scev members to better approximate the setup
required. The cost function for comparing LSR costs is:

return std::tie(C1.NumRegs, C1.AddRecCost, C1.NumIVMuls, C1.NumBaseAdds,
                C1.ScaleCost, C1.ImmCost, C1.SetupCost) <
       std::tie(C2.NumRegs, C2.AddRecCost, C2.NumIVMuls, C2.NumBaseAdds,
                C2.ScaleCost, C2.ImmCost, C2.SetupCost);
So this will only alter results if none of the other variables turn out to be
different.

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

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

5 years ago[MIPS GlobalISel] Fix mul operands
Petar Avramovic [Thu, 7 Mar 2019 13:28:29 +0000 (13:28 +0000)]
[MIPS GlobalISel] Fix mul operands

Unsigned mul high for MIPS32 is selected into two PseudoInstructions:
PseudoMULTu and PseudoMFHI that use accumulator register class ACC64 for
some of its operands. Registers in this class have appropriate hi and lo
register as subregisters: $lo0 and $hi0 are subregisters of $ac0 etc.
mul instruction implicit-defs $lo0 and $hi0 according to MipsInstrInfo.td.
In functions where mul and PseudoMULTu are present fastRegisterAllocator
will "run out of registers during register allocation" because
'calcSpillCost' for $ac0 will return spillImpossible because subregisters
$lo0 and $hi0 of $ac0 are reserved by mul instruction above. A solution is
to mark implicit-defs of $lo0 and $hi0 as dead in mul instruction.

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

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

5 years ago[yaml2obj] - Allow producing ELFDATANONE ELFs
George Rimar [Thu, 7 Mar 2019 12:09:19 +0000 (12:09 +0000)]
[yaml2obj] - Allow producing ELFDATANONE ELFs

I need this to remove a binary from LLD test suite.
The patch also simplifies the code a bit.

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

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

5 years agoFix & re-enable test that intermittently failed in debug mode.
Michael Platings [Thu, 7 Mar 2019 11:55:26 +0000 (11:55 +0000)]
Fix & re-enable test that intermittently failed in debug mode.

The Value class and derivates will have uninitialized member variables if not created via operator new.

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

5 years ago[IDF] Delete a redundant J-edge test
Fangrui Song [Thu, 7 Mar 2019 11:42:59 +0000 (11:42 +0000)]
[IDF] Delete a redundant J-edge test

In the DJ-graph based computation of iterated dominance frontiers,
SuccNode->getIDom() == Node is one of the tests to check if (Node,Succ)
is a J-edge. If it is true, since Node is dominated by Root,

  SuccLevel = level(Node)+1 > RootLevel

which means the next test SuccLevel > RootLevel will also be true. test
the check is redundant and can be deleted as it also involves one
indirection and provides no speed-up.

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

5 years agoTemporarily disable newly added test that fails in debug mode.
Michael Platings [Thu, 7 Mar 2019 10:27:10 +0000 (10:27 +0000)]
Temporarily disable newly added test that fails in debug mode.

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

5 years agoAdd newline to interpreter debugging output
Kristof Beyls [Thu, 7 Mar 2019 10:14:38 +0000 (10:14 +0000)]
Add newline to interpreter debugging output

When running lli --debug --force-interpreter=true the executed instructions are
printed but are missing newlines. This commit adds the missing newlines.

Patch by Andrew Brown.

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

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

5 years ago[IR][ARM] Add function pointer alignment to datalayout
Michael Platings [Thu, 7 Mar 2019 09:15:23 +0000 (09:15 +0000)]
[IR][ARM] Add function pointer alignment to datalayout

Use this feature to fix a bug on ARM where 4 byte alignment is
incorrectly assumed.

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

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

5 years ago[BDCE] Optimize find+insert with early insert
Fangrui Song [Thu, 7 Mar 2019 06:38:03 +0000 (06:38 +0000)]
[BDCE] Optimize find+insert with early insert

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

5 years ago[X86] Enable combineFMinNumFMaxNum for 512 bit vectors when AVX512 is enabled.
Craig Topper [Thu, 7 Mar 2019 06:30:19 +0000 (06:30 +0000)]
[X86] Enable combineFMinNumFMaxNum for 512 bit vectors when AVX512 is enabled.

Simplified by just checking if the vector type is legal rather than listing all combinations of types and features.

Fixes PR40984.

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

5 years ago[X86] Add 512-bit fminnum/maxnum test cases for PR40984. Also add v8f32 minnum/maxnum...
Craig Topper [Thu, 7 Mar 2019 05:56:52 +0000 (05:56 +0000)]
[X86] Add 512-bit fminnum/maxnum test cases for PR40984. Also add v8f32 minnum/maxnum tests. NFC

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

5 years ago[InterleavedAccessAnalysis] Use fixed size integers for InterleaveGroup.
Florian Hahn [Thu, 7 Mar 2019 02:19:11 +0000 (02:19 +0000)]
[InterleavedAccessAnalysis] Use fixed size integers for InterleaveGroup.

Reviewers: Ayal, hsaito, anna, efriedma, dorit

Reviewed By: efriedma

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoAMDGPU: Handle "uniform-work-group-size" attribute (fix for RADV)
Aakanksha Patil [Thu, 7 Mar 2019 00:54:04 +0000 (00:54 +0000)]
AMDGPU: Handle "uniform-work-group-size" attribute (fix for RADV)

A previous patch for "uniform-work-group-size" attribute was found to break
some RADV and possibly radeon SI tests and had to be retracted.
This patch fixes that.

Differential Revision: http://reviews.llvm.org/D58993

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

5 years ago[LoopRotate] fix crash encountered with callbr
Nick Desaulniers [Wed, 6 Mar 2019 23:04:40 +0000 (23:04 +0000)]
[LoopRotate] fix crash encountered with callbr

Summary:
While implementing inlining support for callbr
(https://bugs.llvm.org/show_bug.cgi?id=40722), I hit a crash in Loop
Rotation when trying to build the entire x86 Linux kernel
(drivers/char/random.c). This is a small fix up to r353563.

Test case is drivers/char/random.c (with callbr's inlined), then ran
through creduce, then `opt -opt-bisect-limit=<limit>`, then bugpoint.

Thanks to Craig Topper for immediately spotting the fix, and teaching me
how to fish.

Reviewers: craig.topper, jyknight

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits, srhines

Tags: #llvm

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

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

5 years ago[mips] Replace assertion by error message while lowering `RETURNADDR` and `FRAMEADDR`
Simon Atanasyan [Wed, 6 Mar 2019 22:40:28 +0000 (22:40 +0000)]
[mips] Replace assertion by error message while lowering `RETURNADDR` and `FRAMEADDR`

MIPS target supports lowering `RETURNADDR` and `FRAMEADDR` for a current
frame only. It's better to show an error message then crash on assertion
if `__builtin_return_address` is invoked with non-zero argument.

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

5 years ago[PGO] Fix hexagon buildbot errors in r355541
Rong Xu [Wed, 6 Mar 2019 22:16:47 +0000 (22:16 +0000)]
[PGO] Fix hexagon buildbot errors in r355541

Add "REQUIRES: x86-registered-target" to thinlto test cases.

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

5 years agogn build: Merge r355514.
Peter Collingbourne [Wed, 6 Mar 2019 21:21:45 +0000 (21:21 +0000)]
gn build: Merge r355514.

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

5 years ago[AArch64] Improve FP16 instruction selection for vector round and vector conver from...
Abderrazek Zaafrani [Wed, 6 Mar 2019 20:30:06 +0000 (20:30 +0000)]
[AArch64] Improve FP16 instruction selection for vector round and vector conver from half instructions
https://reviews.llvm.org/D58855

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

5 years ago[X86] Add vector mulo with power of two operand tests; NFC
Nikita Popov [Wed, 6 Mar 2019 20:25:49 +0000 (20:25 +0000)]
[X86] Add vector mulo with power of two operand tests; NFC

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

5 years ago[PS4] Emit a trap after a stack-protector fail call.
Paul Robinson [Wed, 6 Mar 2019 19:57:43 +0000 (19:57 +0000)]
[PS4] Emit a trap after a stack-protector fail call.

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

5 years ago[PGO] Context sensitive PGO (part 4)
Rong Xu [Wed, 6 Mar 2019 19:31:37 +0000 (19:31 +0000)]
[PGO] Context sensitive PGO (part 4)

Part 4 of CSPGO changes:
(1) add support in cmake for cspgo build.
(2) fix an issue in big endian.
(3) test cases.

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

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

5 years ago[AtomicExpand] Allow libcall expansion for non-zero address spaces (try 2)
Philip Reames [Wed, 6 Mar 2019 19:27:13 +0000 (19:27 +0000)]
[AtomicExpand] Allow libcall expansion for non-zero address spaces (try 2)

Restore a reverted commit, with the silly mistake fixed.  Sorry for the previous breakage.

Be consistent about how we treat atomics in non-zero address spaces.  If we get to the backend, we tend to lower them as if in address space 0.  Do the same if we need to insert a libcall instead.

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

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

5 years agoRevert "[IR][ARM] Add function pointer alignment to datalayout"
Mitch Phillips [Wed, 6 Mar 2019 19:17:18 +0000 (19:17 +0000)]
Revert "[IR][ARM] Add function pointer alignment to datalayout"

This reverts commit 2391bfca97290181ae65796ea6da135d1b6d037b.

This reverts rL355522 (https://reviews.llvm.org/D57335).

Kills buildbots that use '-Werror' with the following error:
/var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm/lib/IR/Value.cpp:657:7: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default]

See buildbots http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/30200/steps/check-llvm%20asan/logs/stdio for more information.

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

5 years ago[AArch64] add tests for uaddsat/usubsat; NFC
Sanjay Patel [Wed, 6 Mar 2019 19:02:01 +0000 (19:02 +0000)]
[AArch64] add tests for uaddsat/usubsat; NFC

The tests are copied from the sibling x86 test files.

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

5 years ago[AArch64] Remove a stray test from the AArch64 directory.
Amara Emerson [Wed, 6 Mar 2019 18:54:07 +0000 (18:54 +0000)]
[AArch64] Remove a stray test from the AArch64 directory.

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

5 years ago[DAGCombine] Improve select (not Cond), N1, N2 -> select Cond, N2, N1 fold
Simon Pilgrim [Wed, 6 Mar 2019 18:52:52 +0000 (18:52 +0000)]
[DAGCombine] Improve select (not Cond), N1, N2 -> select Cond, N2, N1 fold

Move the x86 combine from D58974 into the DAGCombine VSELECT code and update the SELECT version to use the isBooleanFlip helper as well.

Requested by @spatel on D59006

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

5 years ago[PowerPC] Use real pointers instead of undef
Simon Pilgrim [Wed, 6 Mar 2019 18:49:39 +0000 (18:49 +0000)]
[PowerPC] Use real pointers instead of undef

The reduced test removed the pointer arguments, but to better survive D58017 and D58070 we need them back.

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

5 years ago[InstCombine] Fold add nsw + sadd.with.overflow
Nikita Popov [Wed, 6 Mar 2019 18:30:00 +0000 (18:30 +0000)]
[InstCombine] Fold add nsw + sadd.with.overflow

Fold `add nsw` and `sadd.with.overflow` with constants if the addition
does not overflow.

Part of https://bugs.llvm.org/show_bug.cgi?id=38146.

Patch by Dan Robertson.

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

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

5 years ago[PPC] Adjust the computed branch offset for the possible shorter distance
Guozhi Wei [Wed, 6 Mar 2019 18:22:22 +0000 (18:22 +0000)]
[PPC] Adjust the computed branch offset for the possible shorter distance

In file PPCBranchSelector.cpp we tend to over estimate code size due to large
alignment and inline assembly. Usually it causes larger computed branch offset,
it is not big problem. But sometimes it may also causes smaller computed branch
offset than actual branch offset. If the offset is close to the limit of
encoding, it may cause problem at run time.
Following is a simplified example.

           actual        estimated
           address        address
 ...
bne Far      100            10c
.p2align 4
Near:        110            110
 ...
Far:        8108           8108

Actual offset:    0x8108 - 0x100 = 0x8008
Computed offset:  0x8108 - 0x10c = 0x7ffc

The computed offset is at most ((1 << alignment) - 4) bytes smaller than actual
offset. So we add this number to the offset for safety.

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

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

5 years ago[MC][MachO] Emit an error for emitting relocations of the form -SYM + cst
Francis Visoiu Mistrih [Wed, 6 Mar 2019 18:10:41 +0000 (18:10 +0000)]
[MC][MachO] Emit an error for emitting relocations of the form -SYM + cst

Emit an error for an unsupported relocation. mach-o relocations can't
encode the form -SYM + cst.

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

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

5 years ago[Hexagon] Avoid creating 5-instruction packets with vgather pseudos
Krzysztof Parzyszek [Wed, 6 Mar 2019 17:43:50 +0000 (17:43 +0000)]
[Hexagon] Avoid creating 5-instruction packets with vgather pseudos

Change the resource usage of the vgather pseudos from SLOT0+LD to
SLOT0+SLOT1.

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

5 years ago[IR][ARM] Add function pointer alignment to datalayout
Michael Platings [Wed, 6 Mar 2019 17:24:11 +0000 (17:24 +0000)]
[IR][ARM] Add function pointer alignment to datalayout

Use this feature to fix a bug on ARM where 4 byte alignment is
incorrectly assumed.

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

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

5 years ago[AMDGPU] Add support for 64 bit buffer atomic artihmetic instructions
Ryan Taylor [Wed, 6 Mar 2019 17:02:06 +0000 (17:02 +0000)]
[AMDGPU] Add support for 64 bit buffer atomic artihmetic instructions

Summary:
This adds support for 64 bit buffer atomic arithmetic instructions but does not include
cmpswap as that depends on a fix to the way the register pairs are handled

Change-Id: Ib207ea65fb69487ccad5066ea647ae8ddfe2ce61

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, jfb, llvm-commits

Tags: #llvm

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

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

5 years ago[DAGCombiner] Enable UADDO/USUBO vector combine support
Simon Pilgrim [Wed, 6 Mar 2019 16:11:03 +0000 (16:11 +0000)]
[DAGCombiner] Enable UADDO/USUBO vector combine support

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

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

5 years ago[TargetLowering] simplify code for uaddsat/usubsat expansion; NFC
Sanjay Patel [Wed, 6 Mar 2019 16:06:27 +0000 (16:06 +0000)]
[TargetLowering] simplify code for uaddsat/usubsat expansion; NFC

We had 2 local variable names for the same type.

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

5 years agoRevert "[CodeGen] Omit range checks from jump tables when lowering switches with...
Alexander Kornienko [Wed, 6 Mar 2019 15:23:50 +0000 (15:23 +0000)]
Revert "[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default"

This reverts commit 2a0f2c5ef3330846149598220467d9f3c6e8b99c (r355490).

The commit causes an assertion failure when compiling LLVM code:
$ cat repro.cpp
class QQQ {
public:
  bool x() const;
  bool y() const;
  unsigned getSizeInBits() const {
    if (y() || x())
      return getScalarSizeInBits();
    return getScalarSizeInBits() * 2;
  }
  unsigned getScalarSizeInBits() const;
};
int f(const QQQ &Ty) {
  switch (Ty.getSizeInBits()) {
    case 1:
    case 8:
      return 0;
    case 16:
      return 1;
    case 32:
      return 2;
    case 64:
      return 3;
    default:
      __builtin_unreachable();
  }
}
$ clang -O2 -o repro.o repro.cpp
assert.h assertion failed at llvm/include/llvm/ADT/ilist_iterator.h:139 in llvm::ilist_iterator::reference llvm::ilist_iterator<llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, true, false>::operator*() const [OptionsT = llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>, IsReverse = true, IsConst = false]: !NodePtr->isKnownSentinel()
*** Check failure stack trace: ***
    @     0x558aab4afc10  __assert_fail
    @     0x558aa885479b  llvm::ilist_iterator<>::operator*()
    @     0x558aa8854715  llvm::MachineInstrBundleIterator<>::operator*()
    @     0x558aa92c33c3  llvm::X86InstrInfo::optimizeCompareInstr()
    @     0x558aa9a9c251  (anonymous namespace)::PeepholeOptimizer::optimizeCmpInstr()
    @     0x558aa9a9b371  (anonymous namespace)::PeepholeOptimizer::runOnMachineFunction()
    @     0x558aa99a4fc8  llvm::MachineFunctionPass::runOnFunction()
    @     0x558aab019fc4  llvm::FPPassManager::runOnFunction()
    @     0x558aab01a3a5  llvm::FPPassManager::runOnModule()
    @     0x558aab01aa9b  (anonymous namespace)::MPPassManager::runOnModule()
    @     0x558aab01a635  llvm::legacy::PassManagerImpl::run()
    @     0x558aab01afe1  llvm::legacy::PassManager::run()
    @     0x558aa5914769  (anonymous namespace)::EmitAssemblyHelper::EmitAssembly()
    @     0x558aa5910f44  clang::EmitBackendOutput()
    @     0x558aa5906135  clang::BackendConsumer::HandleTranslationUnit()
    @     0x558aa6d165ad  clang::ParseAST()
    @     0x558aa6a94e22  clang::ASTFrontendAction::ExecuteAction()
    @     0x558aa590255d  clang::CodeGenAction::ExecuteAction()
    @     0x558aa6a94840  clang::FrontendAction::Execute()
    @     0x558aa6a38cca  clang::CompilerInstance::ExecuteAction()
    @     0x558aa4e2294b  clang::ExecuteCompilerInvocation()
    @     0x558aa4df6200  cc1_main()
    @     0x558aa4e1b37f  ExecuteCC1Tool()
    @     0x558aa4e1a725  main
    @     0x7ff20d56abbd  __libc_start_main
    @     0x558aa4df51c9  _start

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

5 years agoReland "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer"
Francis Visoiu Mistrih [Wed, 6 Mar 2019 15:20:13 +0000 (15:20 +0000)]
Reland "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer"

This allows us to store more info about where we're emitting the remarks
without cluttering LLVMContext. This is needed for future support for
the remark section.

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

Original llvm-svn: 355507

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

5 years ago[PowerPC] Add secure plt support for TLS symbols
Strahinja Petrovic [Wed, 6 Mar 2019 15:00:10 +0000 (15:00 +0000)]
[PowerPC] Add secure plt support for TLS symbols

This patch supports secure plt mode for TLS symbols.

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

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

5 years ago[CGP] Avoid repeatedly building DominatorTree causing long compile-time (NFC)
Teresa Johnson [Wed, 6 Mar 2019 14:57:40 +0000 (14:57 +0000)]
[CGP] Avoid repeatedly building DominatorTree causing long compile-time (NFC)

Summary:
In r354298 a DominatorTree construction was added via new function
combineToUSubWithOverflow, which was subsequently restructured into
replaceMathCmpWithIntrinsic in r354689. We are hitting a very long
compile time due to this repeated construction, once per math cmp in
the function.

We shouldn't need to build the DominatorTree more than once per
function, except when a transformation invalidates it. There is already
a boolean flag that is returned from these methods indicating whether
the DT has been modified. We can simply build the DT once per
Function walk in CodeGenPrepare::runOnFunction, since any time a change
is made we break out of the Function walk and restart it.

I modified the code so that both replaceMathCmpWithIntrinsic as well as
mergeSExts (which was also building a DT) use the DT constructed by the
run method.

From -mllvm -time-passes:
Before this patch: CodeGen Prepare user time is 328s
With this patch: CodeGen Prepare user time is 21s

Reviewers: spatel

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

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

5 years agoRevert "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer"
Francis Visoiu Mistrih [Wed, 6 Mar 2019 14:52:37 +0000 (14:52 +0000)]
Revert "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer"

This reverts commit 2e8c4997a2089f8228c843fd81b148d903472e02.

Breaks bots.

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

5 years ago[TargetLowering] simplify code for uaddsat/usubsat expansion; NFC
Sanjay Patel [Wed, 6 Mar 2019 14:34:59 +0000 (14:34 +0000)]
[TargetLowering] simplify code for uaddsat/usubsat expansion; NFC

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

5 years ago[Remarks] Refactor remark diagnostic emission in a RemarkStreamer
Francis Visoiu Mistrih [Wed, 6 Mar 2019 14:32:08 +0000 (14:32 +0000)]
[Remarks] Refactor remark diagnostic emission in a RemarkStreamer

This allows us to store more info about where we're emitting the remarks
without cluttering LLVMContext. This is needed for future support for
the remark section.

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

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

5 years ago[DAGCombiner] Add SADDO/SSUBO combine support
Simon Pilgrim [Wed, 6 Mar 2019 14:22:21 +0000 (14:22 +0000)]
[DAGCombiner] Add SADDO/SSUBO combine support

Basic constant handling folds, for both scalars and vectors

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

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

5 years ago[llvm-objcopy] - Remove dead code. NFCI.
George Rimar [Wed, 6 Mar 2019 14:12:18 +0000 (14:12 +0000)]
[llvm-objcopy] - Remove dead code. NFCI.

DecompressedSection can only be created if --decompress-debug-sections is specified.
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/ELFObjcopy.cpp#L492

If it is specified when !zlib::isAvailable(), we error out early when parsing the options:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/CopyConfig.cpp#L657

What means the code I am removing in this patch is dead.

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

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

5 years agoExpose template parameters of endian specific types as class members
Pavel Labath [Wed, 6 Mar 2019 14:09:02 +0000 (14:09 +0000)]
Expose template parameters of endian specific types as class members

Summary:
This allows generic code to query these parameters, and is a common
practice in a lot of other template classes.

Reviewers: zturner, Bigcheese

Subscribers: kristina, llvm-commits

Tags: #llvm

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

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

5 years ago[llvm-objcopy] - Remove an excessive zlib::isAvailable() check and dead code.
George Rimar [Wed, 6 Mar 2019 14:08:27 +0000 (14:08 +0000)]
[llvm-objcopy] - Remove an excessive zlib::isAvailable() check and dead code.

There are 2 places where llvm-objcopy creates CompressedSection:

For --compress-debug-sections. It might create the compressed section from
regular here:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/ELFObjcopy.cpp#L486

All initially compressed sections are created as CompressedSection during reading the sections
from an object:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/Object.cpp#L1118
Those have DebugCompressionType::None type and a different constructor.

Case 1 has the following code in its constructor:

if (!zlib::isAvailable()) {
  CompressionType = DebugCompressionType::None;
  return;
}
(https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/Object.cpp#L267)

We can never reach that code with because would report an error much earlier:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/CopyConfig.cpp#L480

So the code I am removing is dead. Landing this will address the issue mentioned in https://bugs.llvm.org/show_bug.cgi?id=40886.

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

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

5 years ago[llvm-objcopy] - Fix incorrect CompressedSection creation.
George Rimar [Wed, 6 Mar 2019 14:01:54 +0000 (14:01 +0000)]
[llvm-objcopy] - Fix incorrect CompressedSection creation.

We should create CompressedSection only if the section has SHF_COMPRESSED flag
or it's name starts from '.zdebug'.
Currently, we create it if section's data starts from ZLIB signature.

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

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

5 years ago[llvm-mca][X86] Add ADC/SBB with zero test cases
Simon Pilgrim [Wed, 6 Mar 2019 12:51:16 +0000 (12:51 +0000)]
[llvm-mca][X86] Add ADC/SBB with zero test cases

Some targets have fast-path handling for these patterns that we should model.

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

5 years ago[X86][NFC] Autogenerate check lines in cmovcmov.ll test
Roman Lebedev [Wed, 6 Mar 2019 11:47:43 +0000 (11:47 +0000)]
[X86][NFC] Autogenerate check lines in cmovcmov.ll test

Investigating 8-bit cmov promotion, this test comes up.

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

5 years ago[DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)
Simon Pilgrim [Wed, 6 Mar 2019 11:04:21 +0000 (11:04 +0000)]
[DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)

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

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

5 years ago[X86][SSE] VSELECT(XOR(Cond,-1), LHS, RHS) --> VSELECT(Cond, RHS, LHS)
Simon Pilgrim [Wed, 6 Mar 2019 10:54:43 +0000 (10:54 +0000)]
[X86][SSE] VSELECT(XOR(Cond,-1), LHS, RHS) --> VSELECT(Cond, RHS, LHS)

As noticed on D58965

DAGCombiner::visitSELECT has something similar, so we should be able to move this to DAGCombiner and support VSELECT as well at some point.

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

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

5 years ago[CodeGen] Omit range checks from jump tables when lowering switches with unreachable...
Ayonam Ray [Wed, 6 Mar 2019 10:01:02 +0000 (10:01 +0000)]
[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default

During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Differential Revision: https://reviews.llvm.org/D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev

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

6 years agoReversing the commit of revision 355483 since it is giving a regression on a newly...
Ayonam Ray [Wed, 6 Mar 2019 07:51:28 +0000 (07:51 +0000)]
Reversing the commit of revision 355483 since it is giving a regression on a newly added test.

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

6 years ago[X86] Enable the add with 128 -> sub with -128 encoding trick with X86ISD::ADD when...
Craig Topper [Wed, 6 Mar 2019 07:36:38 +0000 (07:36 +0000)]
[X86] Enable the add with 128 -> sub with -128 encoding trick with X86ISD::ADD when the carry flag isn't used.

This allows us to use an 8-bit sign extended immediate instead of a 16 or 32 bit immediate.

Also do similar for 0x80000000 with 64-bit adds to avoid having to use a movabsq.

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

6 years ago[X86] Suppress load folding for add/sub with 128 immediate.
Craig Topper [Wed, 6 Mar 2019 07:36:36 +0000 (07:36 +0000)]
[X86] Suppress load folding for add/sub with 128 immediate.

128 won't fit in a sign extended 8-bit immediate, but we can negate it to -128 and use the other operation. This results in a shorter encoding since the move would have used 16 or 32 bits for the immediate.

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