OSDN Git Service

android-x86/external-llvm.git
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

5 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

5 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

5 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

5 years ago[CodeGen] Omit range checks from jump tables when lowering switches with unreachable...
Ayonam Ray [Wed, 6 Mar 2019 07:27:45 +0000 (07:27 +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@355483 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r355439.
Peter Collingbourne [Wed, 6 Mar 2019 03:08:06 +0000 (03:08 +0000)]
gn build: Merge r355439.

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

5 years ago[NFC] Declare the member data of class PostGenericScheduler as "protected" instead...
QingShan Zhang [Wed, 6 Mar 2019 02:39:18 +0000 (02:39 +0000)]
[NFC] Declare the member data of class PostGenericScheduler as "protected" instead of "private"

Some target might try to subclass the PostGenericScheduler to custom the scheduling strategy.
We need to declare the member data of PostGenericScheduler as "protected", which acts the same as "GenericScheduler".

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

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

5 years ago[X86] Remove periods from the end of SubtargetFeature descriptions since the help...
Craig Topper [Wed, 6 Mar 2019 02:36:48 +0000 (02:36 +0000)]
[X86] Remove periods from the end of SubtargetFeature descriptions since the help printer adds a period.

Most features don't have periods already, but some did. When there is a period it causes llc -mattr=+help to print 2 periods.

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

5 years ago[WebAssembly] Remove trailing whitespaces in tests (NFC)
Heejin Ahn [Wed, 6 Mar 2019 02:00:22 +0000 (02:00 +0000)]
[WebAssembly] Remove trailing whitespaces in tests (NFC)

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

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

5 years ago[BinaryFormat] Add DT_USED tag into dynamic section.
Xing GUO [Wed, 6 Mar 2019 01:28:40 +0000 (01:28 +0000)]
[BinaryFormat] Add DT_USED tag into dynamic section.

Summary:
This tag is documented in https://docs.oracle.com/cd/E19253-01/817-1984/chapter6-42444/index.html
Though I could not find some docs that describe it in detail, I found some code snippets.

1.
```
/*
 * Look up the string in the string table and get its offset. If
 * this succeeds, then it is possible that there is a DT_NEEDED
 * dynamic entry that references it.
 */
have_string = elfedit_sec_findstr(argstate->str.sec,
    strpad_elt.dn_dyn.d_un.d_val, arg, &str_offset) != 0;
if (have_string) {
dyn = argstate->dynamic.data;
for (ndx = 0; ndx < numdyn; dyn++, ndx++) {
if (((dyn->d_tag == DT_NEEDED) ||
    (dyn->d_tag == DT_USED)) &&
    (dyn->d_un.d_val == str_offset))
goto done;
}
}
```
https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/cmd/sgs/elfedit/modules/common/syminfo.c#L512

2.
```
    case DT_USED:
    case DT_INIT_ARRAY:
    case DT_FINI_ARRAY:
      if (do_dynamic)
        {
          if (entry->d_tag == DT_USED
          && VALID_DYNAMIC_NAME (entry->d_un.d_val))
        {
          char *name = GET_DYNAMIC_NAME (entry->d_un.d_val);

          if (*name)
            {
              printf (_("Not needed object: [%s]\n"), name);
              break;
            }
        }

          print_vma (entry->d_un.d_val, PREFIX_HEX);
          putchar ('\n');
        }
      break;
```
http://web.mit.edu/freebsd/head/contrib/binutils/binutils/readelf.c

3.
```
#define DT_USED     0x7ffffffe  /* ignored - same as needed */
```
https://github.com/switchbrew/switch-tools/blob/master/src/elf_common.h

Reviewers: jhenderson, grimar

Reviewed By: jhenderson, grimar

Subscribers: emaste, krytarowski, fedor.sergeev, llvm-commits

Tags: #llvm

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

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

5 years agogn build: Add 32-bit Linux support.
Peter Collingbourne [Wed, 6 Mar 2019 01:28:32 +0000 (01:28 +0000)]
gn build: Add 32-bit Linux support.

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

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

5 years agoRevert "[AtomicExpand] Allow libcall expansion for non-zero address spaces" for build...
Mitch Phillips [Wed, 6 Mar 2019 00:25:40 +0000 (00:25 +0000)]
Revert "[AtomicExpand] Allow libcall expansion for non-zero address spaces" for buildbot failures.

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

5 years ago[ARM] Sink zext/sext operands for add and sub to enable vsubl generation.
Florian Hahn [Wed, 6 Mar 2019 00:10:03 +0000 (00:10 +0000)]
[ARM] Sink zext/sext operands for add and sub to enable vsubl generation.

This uses the infrastructure added in rL353152 to sink zext and sexts to
sub/add users, to enable vsubl/vaddl generation when NEON is available.

See https://bugs.llvm.org/show_bug.cgi?id=40025.

Reviewers: SjoerdMeijer, t.p.northover, samparker, efriedma

Reviewed By: samparker

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

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

5 years ago[DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.
Jonas Devlieghere [Tue, 5 Mar 2019 23:47:22 +0000 (23:47 +0000)]
[DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.

When dumping ToT clan's debug info with dwarfdump, we were seeing an
error saying that that the location list overflows the debug_loc
section. After reducing the testcase we figured out that we were
interpreting the DW_FORM_data4 as a section offset.

In DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section
offset. Until now we didn't check check for the DWARF version, because
some producers (read old versions of clang) were still emitting this.
The relevant code/comment was added in 2013, and I believe it's now
reasonable to start checking the version.

The FormValue class is a little bit of a mess because it cashes the
DWARF unit and context when it extracted the value itself. Several
methods of the class rely on it being present, or return an Optional for
the code path that needs it. At the same time the FormValue class also
used in places where there's no DWARF unit.

For this patch I went with the least invasive change: checking the
version from the CU when it's available. If it's not (because the form
value was created from a value directly) we default to the old behavior.

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

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

5 years ago[opt] Report if the provided architecture is invalid.
Florian Hahn [Tue, 5 Mar 2019 23:10:28 +0000 (23:10 +0000)]
[opt] Report if the provided architecture is invalid.

Partly addresses PR15026.

There are a few tests that passed in invalid architectures, which are fixed in: rL355349 and D58931

Reviewers: echristo, efriedma, rengolin, atrick

Reviewed By: efriedma

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

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

5 years ago[AtomicExpand] Allow libcall expansion for non-zero address spaces
Philip Reames [Tue, 5 Mar 2019 23:00:14 +0000 (23:00 +0000)]
[AtomicExpand] Allow libcall expansion for non-zero address spaces

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@355453 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86][NFC] Add proper test for promotion of i8 cmov's of trunc's
Roman Lebedev [Tue, 5 Mar 2019 22:43:53 +0000 (22:43 +0000)]
[X86][NFC] Add proper test for promotion of i8 cmov's of trunc's

There was no proper test for that code in X86TargetLowering::LowerSELECT().
Noticed accidentally while trying to modify the last branch in that function.

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

5 years ago[WebAssembly] Simplify iterator navigations (NFC)
Heejin Ahn [Tue, 5 Mar 2019 21:05:09 +0000 (21:05 +0000)]
[WebAssembly] Simplify iterator navigations (NFC)

Summary:
- Replaces some uses of `MachineFunction::iterator(MBB)` with
  `MBB->getIterator()` and `MachineBasicBlock::iterator(MI)` with
  `MI->getIterator()`, which are simpler.
- Replaces some uses of `std::prev` of `std::next` that takes a
  MachineFunction or MachineBasicBlock iterator with `getPrevNode` and
  `getNextNode`, which are also simpler.

Reviewers: sbc100

Subscribers: dschuff, sunfish, jgravelle-google, llvm-commits

Tags: #llvm

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

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

5 years ago[Remarks][NFC] Rename RemarkParser to YAMLRemarkParser
Francis Visoiu Mistrih [Tue, 5 Mar 2019 20:50:35 +0000 (20:50 +0000)]
[Remarks][NFC] Rename RemarkParser to YAMLRemarkParser

Rename it to reflect that it's parsing YAML remarks.

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

5 years ago[OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks
Francis Visoiu Mistrih [Tue, 5 Mar 2019 20:45:17 +0000 (20:45 +0000)]
[OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks

Getting rid of the name "optimization remarks" for anything that
involves handling remarks on the client side.

It's safer to do this now, before we get stuck with that name in all the
APIs and public interfaces we decide to export to users in the future.

This renames llvm/tools/opt-remarks to llvm/tools/remarks-shlib, and now
generates `libRemarks.dylib` instead of `libOptRemarks.dylib`.

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

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

5 years ago[WebAssembly] Disable MachineBlockPlacement pass
Heejin Ahn [Tue, 5 Mar 2019 20:35:34 +0000 (20:35 +0000)]
[WebAssembly] Disable MachineBlockPlacement pass

Summary:
This pass hurts code size for wasm and sometimes generates irreducible
control flow.
Context: https://github.com/emscripten-core/emscripten/pull/8233

Reviewers: kripken, dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

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

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

5 years ago[NFC][CodeGen][X86][AArch64] Add tests for C++ std::midpoint() pattern (PR40965)
Roman Lebedev [Tue, 5 Mar 2019 20:18:47 +0000 (20:18 +0000)]
[NFC][CodeGen][X86][AArch64] Add tests for C++ std::midpoint() pattern (PR40965)

Tests only for integers, not floating point or pointers.

The scalar 8-bit case uses branch instead of CMOV,
because there is no no 8-bit CMOV.

Vector tests are for consistency, since it can be vectorized.

https://bugs.llvm.org/show_bug.cgi?id=40965

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

5 years agoRevert r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZe...
Craig Topper [Tue, 5 Mar 2019 19:18:16 +0000 (19:18 +0000)]
Revert r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZerosV/immAllOnesV. Remove bitcasts from X86 patterns that are no longer necessary."

This caused the first matcher in the isel table for many targets to Opc_Scope instead of Opc_SwitchOpcode. This leads to a significant increase in isel match failures.

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

5 years ago[Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single...
Craig Topper [Tue, 5 Mar 2019 18:54:38 +0000 (18:54 +0000)]
[Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single array.

These arrays are both keyed by CPU name and go into the same tablegenerated file. Merge them so we only need to store keys once.

This also removes a weird space saving quirk where we used the ProcDesc.size() to create to build an ArrayRef for ProcSched.

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

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

5 years ago[X86] In X86DomainReassignment.cpp add enclosed registers to EnclosedEdges
Guozhi Wei [Tue, 5 Mar 2019 18:54:34 +0000 (18:54 +0000)]
[X86] In X86DomainReassignment.cpp add enclosed registers to EnclosedEdges

The variable X86DomainReassignment::EnclosedEdges is used to store registers that have been enclosed in some closure, so those registers will be ignored when create new closures. But there is no registers has ever been put into this set, so a single register can be enclosed in multiple closures, it significantly increase compile time.

This patch adds a register into EnclosedEdges when it is enclosed into a closure.

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

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

5 years ago[Subtarget] Create a separate SubtargetSubtargetKV struct for ProcDesc to remove...
Craig Topper [Tue, 5 Mar 2019 18:54:34 +0000 (18:54 +0000)]
[Subtarget] Create a separate SubtargetSubtargetKV struct for ProcDesc to remove fields from the stack tables that aren't needed for CPUs

The description for CPUs was just the CPU name wrapped with "Select the " and " processor". We can just do that directly in the help printer instead of making a separate version in the binary for each CPU.

Also remove the Value field that isn't needed and was always 0.

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

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

5 years ago[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubt...
Craig Topper [Tue, 5 Mar 2019 18:54:30 +0000 (18:54 +0000)]
[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubtargetInfo.h. Move all code that operates on ProcFeatures and ProcDesc arrays to MCSubtargetInfo.

The SubtargetFeature class managed a list of features as strings. And it also had functions for setting bits in a FeatureBitset.

The methods that operated on the Feature list as strings are used in other parts of the backend. But the parts that operate on FeatureBitset are very tightly coupled to MCSubtargetInfo and requires passing in the arrays that MCSubtargetInfo owns. And the same struct type is used for ProcFeatures and ProcDesc.

This has led to MCSubtargetInfo having 2 arrays keyed by CPU name. One containing a mapping from a CPU name to its features. And one containing a mapping from CPU name to its scheduler model.

I would like to make a single CPU array containing all CPU information and remove some unneeded fields the ProcDesc array currently has. But I don't want to make SubtargetFeatures.h have to know about the scheduler model type and have to forward declare or pull in the header file.

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

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

5 years agoAMDGPU: Preserve undef flag when expanding SI_IF
Matt Arsenault [Tue, 5 Mar 2019 18:38:00 +0000 (18:38 +0000)]
AMDGPU: Preserve undef flag when expanding SI_IF

Fixes undefined value verifier error.

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

5 years ago[X86] Enable 8-bit SHL to convert to LEA
Craig Topper [Tue, 5 Mar 2019 18:37:41 +0000 (18:37 +0000)]
[X86] Enable 8-bit SHL to convert to LEA

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

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

5 years ago[X86] Allow 8-bit INC/DEC to be converted to LEA.
Craig Topper [Tue, 5 Mar 2019 18:37:37 +0000 (18:37 +0000)]
[X86] Allow 8-bit INC/DEC to be converted to LEA.

We already do this for 16/32/64 as well as 8-bit add with register/immediate. Might as well do it for 8-bit INC/DEC too.

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

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

5 years ago[X86] Enable 8-bit OR with disjoint bits to convert to LEA
Craig Topper [Tue, 5 Mar 2019 18:37:33 +0000 (18:37 +0000)]
[X86] Enable 8-bit OR with disjoint bits to convert to LEA

We already support 8-bits adds in convertToThreeAddress. But we can also support 8-bit OR if the bits are disjoint. We already do this for 16/32/64.

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

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

5 years ago[SLP] Fix invalid triple in X86 tests
Florian Hahn [Tue, 5 Mar 2019 17:56:35 +0000 (17:56 +0000)]
[SLP] Fix invalid triple in X86 tests

x86-64 is an invalid architecture in triples. Changing it to the correct
triple (x86_64) changes some tests, because SLP is not deemed profitable
any more.

Reviewers: ABataev, RKSimon, spatel

Reviewed By: RKSimon

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

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

5 years agoTableGen: Allow lists to be concatenated through '#'
Javed Absar [Tue, 5 Mar 2019 17:16:07 +0000 (17:16 +0000)]
TableGen:  Allow lists to be concatenated through '#'

Currently one can concatenate strings using hash(#),
but not lists, although that would be a natural thing to do.

This patch allows one to write something like:
def : A<!listconcat([1,2], [3,4])>;
simply as :
def : A<[1,2] # [3,4]>;

This was missing feature was highlighted by Nicolai
at FOSDEM talk.

Reviewed by: nhaehnle, hfinkel

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

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

5 years ago[X86][SSE] Regenerate vector zero tests
Simon Pilgrim [Tue, 5 Mar 2019 16:52:14 +0000 (16:52 +0000)]
[X86][SSE] Regenerate vector zero tests

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

5 years ago[SDAG] move FP constant folding to helper function; NFC
Sanjay Patel [Tue, 5 Mar 2019 16:42:33 +0000 (16:42 +0000)]
[SDAG] move FP constant folding to helper function; NFC

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

5 years agoRevert "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"
Jessica Paquette [Tue, 5 Mar 2019 15:47:00 +0000 (15:47 +0000)]
Revert "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"

This broke test-suite::aarch64_neon_intrinsics.test

Reverting while I look into it.

Example failure:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17740

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

5 years ago[X86] Add SMULO/UMULO combine tests
Simon Pilgrim [Tue, 5 Mar 2019 15:36:45 +0000 (15:36 +0000)]
[X86] Add SMULO/UMULO combine tests

Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

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

5 years agoFix typo in constant vector
Simon Pilgrim [Tue, 5 Mar 2019 15:06:01 +0000 (15:06 +0000)]
Fix typo in constant vector

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

5 years ago[X86] Add SADDO/UADDO and SSUBO/USUBO combine tests
Simon Pilgrim [Tue, 5 Mar 2019 14:52:42 +0000 (14:52 +0000)]
[X86] Add SADDO/UADDO and SSUBO/USUBO combine tests

Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

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

5 years ago[X86] Add test cases for D58874
Simon Pilgrim [Tue, 5 Mar 2019 13:52:09 +0000 (13:52 +0000)]
[X86] Add test cases for D58874

Add scalar and vector test cases for missing (add (add (xor a, -1), b), 1) -> (sub b, a) fold

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

5 years ago[llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.
George Rimar [Tue, 5 Mar 2019 13:07:43 +0000 (13:07 +0000)]
[llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.

When --compress-debug-sections is given, llvm-objcopy do not compress
sections that have "ZLIB" header in data. Normally this signature is used
in zlib-gnu compression format. But if zlib-gnu used then the name of the compressed
section should start from .z* (e.g .zdebug_info). If it does not, then it is not
a zlib-gnu format and section should be treated as a normal uncompressed section.

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

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

5 years ago[AMDGPU] Fix DPP operand order in atomic optimizer
Carl Ritson [Tue, 5 Mar 2019 12:21:44 +0000 (12:21 +0000)]
[AMDGPU] Fix DPP operand order in atomic optimizer

Summary:
Ensure order of operands in DPP atomic optimizer final WWM step is appropriate for sub instructions.

Change-Id: I631d050e1c00a3b4bc7c11a90437064403c4cf30

Reviewers: sheredom, tpr

Reviewed By: sheredom

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

Tags: #llvm

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

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

5 years ago[SCEV] Ensure that isHighCostExpansion takes into account what is being divided
David Green [Tue, 5 Mar 2019 12:12:18 +0000 (12:12 +0000)]
[SCEV] Ensure that isHighCostExpansion takes into account what is being divided

A SCEV is not low-cost just because you can divide it by a power of 2. We need to also
check what we are dividing to make sure it too is not a high-code expansion. This helps
to not expand the exit value of certain loops, helping not to bloat the code.

The change in no-iv-rewrite.ll is reverting back to what it was testing before rL194116,
and looks a lot like the other tests in replace-loop-exit-folds.ll.

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

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

5 years ago[llvm-objcopy] - Report "no zlib available" error properly when --compress-debug...
George Rimar [Tue, 5 Mar 2019 11:32:14 +0000 (11:32 +0000)]
[llvm-objcopy] - Report "no zlib available" error properly when --compress-debug-sections is used.

If zlib is not available, and --compress-debug-sections is passed,
we want to report an error. Currently, it is only reported for
--compress_debug_sections= form of the option.

Fixes the https://bugs.llvm.org/show_bug.cgi?id=40886.

I do not think there is a way to write a test for this.

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

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

5 years ago[SCEV] Add some extra tests for IndVarSimplifys loop exit values. NFC.
David Green [Tue, 5 Mar 2019 11:18:55 +0000 (11:18 +0000)]
[SCEV] Add some extra tests for IndVarSimplifys loop exit values. NFC.

Add some tests for various loops of the form:
  while(S >= 32) {
    S -= 32;
    something();
  };
  return S;

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

5 years ago[WebAssembly] Rename a variable in LateEHPrepare (NFC)
Heejin Ahn [Tue, 5 Mar 2019 11:11:34 +0000 (11:11 +0000)]
[WebAssembly] Rename a variable in LateEHPrepare (NFC)

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

5 years agoAdd wildcard support to all update_*_test_checks.py scripts (PR37500)
Simon Pilgrim [Tue, 5 Mar 2019 10:44:37 +0000 (10:44 +0000)]
Add wildcard support to all update_*_test_checks.py scripts (PR37500)

We can already update multiple files in each update call, this extends it to work with wildcards as well in the same way as update_mca_test_checks.py (to support shells that won't do this for us - windows command prompt etc.)

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

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

5 years ago[ARM] Fix select_cc lowering for fp16
Oliver Stannard [Tue, 5 Mar 2019 10:42:34 +0000 (10:42 +0000)]
[ARM] Fix select_cc lowering for fp16

When lowering a select_cc node where the true and false values are of type f16,
we can't use a general conditional move because the FP16 instructions do not
support conditional execution. Instead, we must ensure that the condition code
is one of the four supported by the VSEL instruction.

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

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

5 years ago[AMDGPU] Omit KILL instructions from hazard recognizer
David Stuttard [Tue, 5 Mar 2019 10:25:16 +0000 (10:25 +0000)]
[AMDGPU] Omit KILL instructions from hazard recognizer

Summary:
In some cases the KILL was causing a hazard to be introduced as these were
scheduled into hazard slots, but don't result in an instruction.

KILL shouldn't be considered for hazard recognition.

Change-Id: Ib6d2a2160f8c94cd0ce611ab198c7e4f46aeffcf

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

Tags: #llvm

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

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

5 years ago[LangRef] Add 'callbr' instruction to the 'blockaddress' section.
Craig Topper [Tue, 5 Mar 2019 05:23:37 +0000 (05:23 +0000)]
[LangRef] Add 'callbr' instruction to the 'blockaddress' section.

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

5 years ago[PowerPC] fix killed/dead flag after convert x-form to d-form tranformation.
Chen Zheng [Tue, 5 Mar 2019 04:56:54 +0000 (04:56 +0000)]
[PowerPC] fix killed/dead flag after convert x-form to d-form tranformation.
Differential Revision: https://reviews.llvm.org/D58428

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