]> granicus.if.org Git - llvm/log
llvm
5 years ago[MIPS GlobalISel] Select indirect branch
Petar Avramovic [Thu, 12 Sep 2019 11:44:36 +0000 (11:44 +0000)]
[MIPS GlobalISel] Select indirect branch

Select G_BRINDIRECT for MIPS32.

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

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

5 years ago[MIPS GlobalISel] Lower G_DYN_STACKALLOC
Petar Avramovic [Thu, 12 Sep 2019 11:39:50 +0000 (11:39 +0000)]
[MIPS GlobalISel] Lower G_DYN_STACKALLOC

IRTranslator creates G_DYN_STACKALLOC instruction during expansion of
alloca when argument that tells number of elements to allocate on stack
is a virtual register. Use default lowering for MIPS32.

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

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

5 years ago[MIPS GlobalISel] Select G_IMPLICIT_DEF
Petar Avramovic [Thu, 12 Sep 2019 11:32:38 +0000 (11:32 +0000)]
[MIPS GlobalISel] Select G_IMPLICIT_DEF

G_IMPLICIT_DEF is used for both integer and floating point implicit-def.
Handle G_IMPLICIT_DEF as ambiguous opcode in MipsRegisterBankInfo.
Select G_IMPLICIT_DEF for MIPS32.

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

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

5 years ago[DAGCombine] visitFDIV - Use isCheaperToUseNegatedFPOps helper for (fdiv (fneg X...
Simon Pilgrim [Thu, 12 Sep 2019 11:03:09 +0000 (11:03 +0000)]
[DAGCombine] visitFDIV - Use isCheaperToUseNegatedFPOps helper for (fdiv (fneg X), (fneg Y)) -> (fdiv X, Y). NFCI.

Minor cleanup to use equivalent helper code.

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

5 years agoAArch64: support arm64_32, an ILP32 slice for watchOS.
Tim Northover [Thu, 12 Sep 2019 10:22:23 +0000 (10:22 +0000)]
AArch64: support arm64_32, an ILP32 slice for watchOS.

This is the main CodeGen patch to support the arm64_32 watchOS ABI in LLVM.
FastISel is mostly disabled for now since it would generate incorrect code for
ILP32.

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

5 years agoCodeGenPrep: add separate hook say when GEPs should be used for sinking. NFCI.
Tim Northover [Thu, 12 Sep 2019 10:21:00 +0000 (10:21 +0000)]
CodeGenPrep: add separate hook say when GEPs should be used for sinking. NFCI.

Up to now, we've decided whether to sink address calculations using GEPs or
normal arithmetic based on the useAA hook, but there are other reasons GEPs
might be preferred. So this patch splits the two questions, with a default
implementation falling back to useAA.

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

5 years ago[InstSimplify] simplifyUnsignedRangeCheck(): handle more cases (PR43251)
Roman Lebedev [Thu, 12 Sep 2019 09:26:17 +0000 (09:26 +0000)]
[InstSimplify] simplifyUnsignedRangeCheck(): handle more cases (PR43251)

Summary:
I don't have a direct motivational case for this,
but it would be good to have this for completeness/symmetry.

This pattern is basically the motivational pattern from
https://bugs.llvm.org/show_bug.cgi?id=43251
but with different predicate that requires that the offset is non-zero.

The completeness bit comes from the fact that a similar pattern (offset != zero)
will be needed for https://bugs.llvm.org/show_bug.cgi?id=43259,
so it'd seem to be good to not overlook very similar patterns..

Proofs: https://rise4fun.com/Alive/21b

Also, there is something odd with `isKnownNonZero()`, if the non-zero
knowledge was specified as an assumption, it didn't pick it up (PR43267)

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[PowerPC][MCP][NFC] Pre-commit test cases for https://reviews.llvm.org/D65267
Kai Luo [Thu, 12 Sep 2019 09:00:44 +0000 (09:00 +0000)]
[PowerPC][MCP][NFC] Pre-commit test cases for https://reviews.llvm.org/D65267

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

5 years ago[DAGCombiner] Improve division estimation of floating points.
Qiu Chaofan [Thu, 12 Sep 2019 07:51:24 +0000 (07:51 +0000)]
[DAGCombiner] Improve division estimation of floating points.

Current implementation of estimating divisions loses precision since it
estimates reciprocal first and does multiplication.  This patch is to re-order
arithmetic operations in the last iteration in DAGCombiner to improve the
accuracy.

Reviewed By: Sanjay Patel, Jinsong Ji

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

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

5 years ago[LegalizeTypes] Remove code for softening a float type to itself.
Craig Topper [Thu, 12 Sep 2019 05:55:14 +0000 (05:55 +0000)]
[LegalizeTypes] Remove code for softening a float type to itself.

This was previously used to turn fp128 operations into libcalls
on X86. This is now done through op legalization after r371672.

This restores much of this code to before r254653.

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

5 years agoMake SwitchInstProfUpdateWrapper strict permanently
Yevgeny Rouban [Thu, 12 Sep 2019 03:41:34 +0000 (03:41 +0000)]
Make SwitchInstProfUpdateWrapper strict permanently

We have been using -switch-inst-prof-update-wrapper-strict
set to true by default for some time. It is time to remove
the safety stuff and make SwitchInstProfUpdateWrapper
intolerant to inconsistencies in !prof branch_weights
metadata of SwitchInst.

This patch gets rid of the Invalid state of
SwitchInstProfUpdateWrapper and the option
-switch-inst-prof-update-wrapper-strict. So there is only
two states: changed and unchanged.

Reviewers: davidx, nikic, eraman, reames, chandlerc
Reviewed By: davidx
Differential Revision: https://reviews.llvm.org/D67435

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

5 years agogn build: Merge r371700
Nico Weber [Thu, 12 Sep 2019 01:25:34 +0000 (01:25 +0000)]
gn build: Merge r371700

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

5 years agoReapply llvm-reduce: Add pass to reduce parameters""
David Blaikie [Thu, 12 Sep 2019 01:20:48 +0000 (01:20 +0000)]
Reapply llvm-reduce: Add pass to reduce parameters""

Fixing a couple of asan-identified bugs
* use of an invalid "Use" iterator after the element was removed
* use of StringRef to Function name after the Function was erased

This reapplies r371567, which was reverted in r371580.

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

5 years agoPR43278: llvm-reduce: Use temporary file names (and ToolOutputFile) rather than uniqu...
David Blaikie [Thu, 12 Sep 2019 00:31:57 +0000 (00:31 +0000)]
PR43278: llvm-reduce: Use temporary file names (and ToolOutputFile) rather than unique ones - to ensure they're cleaned up

This modifies the tool somewhat to only create files when about to run
the "interestingness" test, and delete them immediately after - this
means some more files will be created sometimes (when "double checking"
work - which should probably be fixed/avoided anyway).

This now creates temporary files, rather than only unique ones, and also
uses ToolOutputFile (without ever calling "keep") to ensure the files
are deleted as soon as the interestingness test is run.

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

5 years ago[X86] Enable -mprefer-vector-width=256 by default for Skylake-avx512 and later Intel...
Craig Topper [Wed, 11 Sep 2019 23:54:36 +0000 (23:54 +0000)]
[X86] Enable -mprefer-vector-width=256 by default for Skylake-avx512 and later Intel CPUs.

AVX512 instructions can cause a frequency drop on these CPUs. This
can negate the performance gains from using wider vectors. Enabling
prefer-vector-width=256 will prevent generation of zmm registers
unless explicit 512 bit operations are used in the original source
code.

I believe gcc and icc both do something similar to this by default.

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

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

5 years ago[AArch64][GlobalISel] Fall back on attempts to allocate split types on the stack.
Amara Emerson [Wed, 11 Sep 2019 23:53:23 +0000 (23:53 +0000)]
[AArch64][GlobalISel] Fall back on attempts to allocate split types on the stack.

First we were asserting that the ValNo of a VA was the wrong value. It doesn't actually
make a difference for us in CallLowering but fix that anyway to silence the assert.

The bigger issue was that after fixing the assert we were generating invalid MIR
because the merging/unmerging of values split across multiple registers wasn't
also implemented for memory locs. This happens when we run out of registers and
have to pass the split types like i128 -> i64 x 2 on the stack. This is do-able, but
for now just fall back.

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

5 years ago[GlobalISel][AArch64] Check caller for swifterror params in tailcall eligibility
Jessica Paquette [Wed, 11 Sep 2019 23:44:16 +0000 (23:44 +0000)]
[GlobalISel][AArch64] Check caller for swifterror params in tailcall eligibility

Before, we only checked the callee for swifterror. However, we should also be
checking the caller to see if it has a swifterror parameter.

Since we don't currently handle outgoing arguments, this didn't show up in the
swifterror.ll testcase.

Also, remove the swifterror checks from call-translator-tail-call.ll, since
they are covered by the existing swifterror testing. Better to have it all in
one place.

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

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

5 years ago[TableGen] Skip CRLF conversion when writing output
Reid Kleckner [Wed, 11 Sep 2019 22:33:50 +0000 (22:33 +0000)]
[TableGen] Skip CRLF conversion when writing output

Doing the CRLF translation while writing the file defeats our
optimization to not update the file if it hasn't changed.

Fixes PR43271.

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

5 years ago[InstCombine] rename variable for readability; NFC
Sanjay Patel [Wed, 11 Sep 2019 22:31:34 +0000 (22:31 +0000)]
[InstCombine] rename variable for readability; NFC

There's more that can be done here, but "OpI"
doesn't convey that we casted to BinaryOperator.

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

5 years agoAdd some missing changes to GSYM that was addressing a gcc compilation error due...
David Blaikie [Wed, 11 Sep 2019 22:24:45 +0000 (22:24 +0000)]
Add some missing changes to GSYM that was addressing a gcc compilation error due to a type and variable with the same name

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

5 years agoPR43278: Temporarily disable llvm-reduce tests due to exhausting temp files
David Blaikie [Wed, 11 Sep 2019 22:15:16 +0000 (22:15 +0000)]
PR43278: Temporarily disable llvm-reduce tests due to exhausting temp files

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

5 years ago[X86] Fix latent bugs in 32-bit CMPXCHG8B inserter
Reid Kleckner [Wed, 11 Sep 2019 21:56:17 +0000 (21:56 +0000)]
[X86] Fix latent bugs in 32-bit CMPXCHG8B inserter

I found three issues:
1. the loop over E[ABCD]X copies run over BB start
2. the direct address of cmpxchg8b could be a frame index
3. the displacement of cmpxchg8b could be a global instead of an
   immediate

These were all introduced together in r287875, and should be fixed with
this change.

Issue reported by Zachary Turner.

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

5 years ago[ConstantFolding] Refactor math functions to use LLVM ones (NFC)
Evandro Menezes [Wed, 11 Sep 2019 21:46:57 +0000 (21:46 +0000)]
[ConstantFolding] Refactor math functions to use LLVM ones (NFC)

When possible, replace calls to library routines on the host with equivalent
ones in LLVM.

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

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

5 years agoRevert [llvm-nm] Add tapi file support
Cyndy Ishida [Wed, 11 Sep 2019 21:35:28 +0000 (21:35 +0000)]
Revert [llvm-nm] Add tapi file support

This reverts r371576 (git commit f88f46358dbffa20af3b054a9346e5154789d50f)

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

5 years agoRevert [Object][TextAPI] NFC, fix tapi lit tests
Cyndy Ishida [Wed, 11 Sep 2019 21:32:55 +0000 (21:32 +0000)]
Revert [Object][TextAPI] NFC, fix tapi lit tests

This reverts r371577 (git commit b2b0ccab2f76733679eeceecf31b21ebc1fe23ac)

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

5 years ago[X86] Add test case for v16i64->v16i32 truncate on min-legal-vector-width=256.
Craig Topper [Wed, 11 Sep 2019 21:30:42 +0000 (21:30 +0000)]
[X86] Add test case for v16i64->v16i32 truncate on min-legal-vector-width=256.

I think this case would crash before I added back the -x86-experimental-vector-widening command line option. Adding this test case to prevent breaking it again when we remove the option.

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

5 years ago[X86] Move x86_64 fp128 conversion to libcalls from type legalization to DAG legalization
Craig Topper [Wed, 11 Sep 2019 21:30:09 +0000 (21:30 +0000)]
[X86] Move x86_64 fp128 conversion to libcalls from type legalization to DAG legalization

fp128 is considered a legal type for a register, but has almost no legal operations so everything needs to be converted to a libcall. Previously this was implemented by tricking type legalization into softening the operations with various checks for "is legal in hardware register" to change the behavior to still use f128 as the resulting type instead of converting to i128.

This patch abandons this approach and instead moves the libcall conversions to LegalizeDAG. This is the approach taken by AArch64 where they also have a legal fp128 type, but no legal operations. I think this is more in spirit with how SelectionDAG's phases are supposed to work.

I had to make some hacks for STRICT_FP_ROUND because some of the strict FP handling checks if ISD::FP_ROUND is Legal for a given result type, but I had to make ISD::FP_ROUND Custom to allow making a libcall when the input is f128. For all other types the Custom handler just returns the original node. These hacks are incomplete and don't work for a strict truncate from f128, but I don't think it worked before either since LegalizeFloatTypes doesn't know about strict ops yet. I've also raised PR43209 against AArch64 which currently crashes on a strict ftrunc from f64->f32 because of FP_ROUND being marked Custom for the same reason there.

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

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

5 years agoAMDGPU: Move m0 initializations earlier
Austin Kerbow [Wed, 11 Sep 2019 21:28:41 +0000 (21:28 +0000)]
AMDGPU: Move m0 initializations earlier

Summary:
After hoisting and merging m0 initializations schedule them as early as
possible in the MBB. This helps the scheduler avoid hazards in some
cases.

Reviewers: rampitec, arsenm

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

Tags: #llvm

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

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

5 years agogn build: Merge r371661
Nico Weber [Wed, 11 Sep 2019 21:24:15 +0000 (21:24 +0000)]
gn build: Merge r371661

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

5 years agogn build: Merge r371657
Nico Weber [Wed, 11 Sep 2019 21:24:11 +0000 (21:24 +0000)]
gn build: Merge r371657

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

5 years ago[DWARF] Emit call site parameter info when tuning for lldb
Vedant Kumar [Wed, 11 Sep 2019 21:23:39 +0000 (21:23 +0000)]
[DWARF] Emit call site parameter info when tuning for lldb

Emit debug entry values using standard DWARF5 opcodes when the debugger
tuning is set to lldb.

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

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

5 years agoAll Errors must be checked
Chris Bieneman [Wed, 11 Sep 2019 20:54:38 +0000 (20:54 +0000)]
All Errors must be checked

Summary: If an error is ever returned from any of the functions called here, the error must be joined with the Result Error before being returned otherwise the Result Error will assert on destruction.

Reviewers: lhames

Subscribers: llvm-commits

Tags: #llvm

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

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

5 years agoAdd a LineTable class to GSYM and test it.
Greg Clayton [Wed, 11 Sep 2019 20:51:03 +0000 (20:51 +0000)]
Add a LineTable class to GSYM and test it.

This patch adds the ability to create a gsym::LineTable object, populate it, encode and decode it and test all functionality.

The full format of the LineTable encoding is specified in the header file LineTable.h.

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

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

5 years ago[llvm-reduce] Fix a bug, improve error handling when running test
Reid Kleckner [Wed, 11 Sep 2019 20:29:22 +0000 (20:29 +0000)]
[llvm-reduce] Fix a bug, improve error handling when running test

llvm::sys::ExecuteAndWait can report errors, so let's make use of that.

Second, while iterating uses of functions to remove, a call can appear
multiple times. Use a SetVector so we don't attempt to erase such a call
twice.

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

5 years agoUpdate link to the DWARF spec.
Adrian Prantl [Wed, 11 Sep 2019 19:57:29 +0000 (19:57 +0000)]
Update link to the DWARF spec.

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

5 years ago[AMDGPU] Fix crash in phi-elimination hook.
Michael Liao [Wed, 11 Sep 2019 19:55:20 +0000 (19:55 +0000)]
[AMDGPU] Fix crash in phi-elimination hook.

Summary: - Pre-check in case there's just a single PHI insn.

Reviewers: alex-t, rampitec, arsenm

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

Tags: #llvm

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

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

5 years agoUpdate documentation.
Adrian Prantl [Wed, 11 Sep 2019 19:49:38 +0000 (19:49 +0000)]
Update documentation.

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

5 years agoFix test failures after r371640
Matt Arsenault [Wed, 11 Sep 2019 18:55:20 +0000 (18:55 +0000)]
Fix test failures after r371640

r371640 evidently fixed bug 39481

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

5 years ago[ConstantHoisting] Fix non-determinism.
Eli Friedman [Wed, 11 Sep 2019 18:55:00 +0000 (18:55 +0000)]
[ConstantHoisting] Fix non-determinism.

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

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

5 years ago[IRMover] Don't map globals if their types are the same
Pirama Arumuga Nainar [Wed, 11 Sep 2019 18:35:49 +0000 (18:35 +0000)]
[IRMover] Don't map globals if their types are the same

Summary:
During IR Linking, if the types of two globals in destination and source
modules are the same, it can only be because the global in the
destination module is originally from the source module and got added to
the destination module from a shared metadata.

We shouldn't map this type to itself in case the type's components get
remapped to a new type from the destination (for instance, during the
loop over SrcM->getIdentifiedStructTypes() further below in
IRLinker::computeTypeMapping()).

Fixes PR40312.

Reviewers: tejohnson, pcc, srhines

Subscribers: mehdi_amini, hiraditya, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

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

5 years agoLiveIntervals: Split live intervals on multiple dead defs
Matt Arsenault [Wed, 11 Sep 2019 17:59:21 +0000 (17:59 +0000)]
LiveIntervals: Split live intervals on multiple dead defs

If there are multiple dead defs of the same virtual register, these
are required to be split into multiple virtual registers with separate
live intervals to avoid a verifier error.

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

5 years agogn build: Merge r371635
Nico Weber [Wed, 11 Sep 2019 16:26:59 +0000 (16:26 +0000)]
gn build: Merge r371635

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

5 years agoReland "clang-misexpect: Profile Guided Validation of Performance Annotations in...
Petr Hosek [Wed, 11 Sep 2019 16:19:50 +0000 (16:19 +0000)]
Reland "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM"

This patch contains the basic functionality for reporting potentially
incorrect usage of __builtin_expect() by comparing the developer's
annotation against a collected PGO profile. A more detailed proposal and
discussion appears on the CFE-dev mailing list
(http://lists.llvm.org/pipermail/cfe-dev/2019-July/062971.html) and a
prototype of the initial frontend changes appear here in D65300

We revised the work in D65300 by moving the misexpect check into the
LLVM backend, and adding support for IR and sampling based profiles, in
addition to frontend instrumentation.

We add new misexpect metadata tags to those instructions directly
influenced by the llvm.expect intrinsic (branch, switch, and select)
when lowering the intrinsics. The misexpect metadata contains
information about the expected target of the intrinsic so that we can
check against the correct PGO counter when emitting diagnostics, and the
compiler's values for the LikelyBranchWeight and UnlikelyBranchWeight.
We use these branch weight values to determine when to emit the
diagnostic to the user.

A future patch should address the comment at the top of
LowerExpectIntrisic.cpp to hoist the LikelyBranchWeight and
UnlikelyBranchWeight values into a shared space that can be accessed
outside of the LowerExpectIntrinsic pass. Once that is done, the
misexpect metadata can be updated to be smaller.

In the long term, it is possible to reconstruct portions of the
misexpect metadata from the existing profile data. However, we have
avoided this to keep the code simple, and because some kind of metadata
tag will be required to identify which branch/switch/select instructions
are influenced by the use of llvm.expect

Patch By: paulkirth
Differential Revision: https://reviews.llvm.org/D66324

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

5 years agoRevert [InstCombine] Use SimplifyFMulInst to simplify multiply in fma.
Florian Hahn [Wed, 11 Sep 2019 16:17:03 +0000 (16:17 +0000)]
Revert [InstCombine] Use SimplifyFMulInst to simplify multiply in fma.

This introduces additional rounding error in some cases. See D67434.

This reverts r371518 (git commit 18a1f0818b659cee13865b4fad2648d85984a4ed)

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

5 years ago[InstSimplify] Pass SimplifyQuery into simplifyUnsignedRangeCheck() and use it for...
Roman Lebedev [Wed, 11 Sep 2019 15:32:46 +0000 (15:32 +0000)]
[InstSimplify] Pass SimplifyQuery into simplifyUnsignedRangeCheck() and use it for isKnownNonZero()

This was actually the original intention in D67332,
but i messed up and forgot about it.
This patch was originally part of D67411, but precommitting this.

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

5 years ago[NFC][InstSimplify] Add extra test for D67411 with @llvm.assume
Roman Lebedev [Wed, 11 Sep 2019 15:28:03 +0000 (15:28 +0000)]
[NFC][InstSimplify] Add extra test for D67411 with @llvm.assume

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

5 years agogn build: Merge r371562
Nico Weber [Wed, 11 Sep 2019 14:40:16 +0000 (14:40 +0000)]
gn build: Merge r371562

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

5 years agoLLVM: Optimization Pass: Remove conflicting attribute, if any, before
Whitney Tsang [Wed, 11 Sep 2019 14:26:22 +0000 (14:26 +0000)]
LLVM: Optimization Pass: Remove conflicting attribute, if any, before
adding new read attribute to an argument
Summary: Update optimization pass to prevent adding read-attribute to an
argument without removing its conflicting attribute.

A read attribute, based on the result of the attribute deduction
process, might be added to an argument. The attribute might be in
conflict with other read/write attribute currently associated with the
argument. To ensure the compatibility of attributes, conflicting
attribute, if any, must be removed before a new one is added.

The following snippet shows the current behavior of the compiler, where
the compilation process is aborted due to incompatible attributes.

$ cat x.ll
; ModuleID = 'x.bc'

%_type_of_d-ccc = type <{ i8*, i8, i8, i8, i8 }>

@d-ccc = internal global %_type_of_d-ccc <{ i8* null, i8 1, i8 13, i8 0,
i8 -127 }>, align 8

define void @foo(i32* writeonly %.aaa) {
foo_entry:
  %_param_.aaa = alloca i32*, align 8
  store i32* %.aaa, i32** %_param_.aaa, align 8
  store i8 0, i8* getelementptr inbounds (%_type_of_d-ccc,
%_type_of_d-ccc* @d-ccc, i32 0, i32 3)
  ret void
}

$ opt -O3 x.ll
Attributes 'readnone and writeonly' are incompatible!
void (i32*)* @foo
in function foo
LLVM ERROR: Broken function found, compilation aborted!
The purpose of this changeset is to fix the above error. This fix is
based on a suggestion from Johannes @jdoerfert (many thanks!!!)
Authored By: anhtuyen
Reviewer: nicholas, rnk, chandlerc, jdoerfert
Reviewed By: rnk
Subscribers: hiraditya, jdoerfert, llvm-commits, anhtuyen, LLVM
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D58694

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

5 years ago[ConstProp] add tests for fma that produce NaN; NFC
Sanjay Patel [Wed, 11 Sep 2019 14:18:48 +0000 (14:18 +0000)]
[ConstProp] add tests for fma that produce NaN; NFC

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

5 years ago[ConstProp] move test file from InstSimplify; NFC
Sanjay Patel [Wed, 11 Sep 2019 14:01:11 +0000 (14:01 +0000)]
[ConstProp] move test file from InstSimplify; NFC

These are constant folding tests; there is no code
directly in InstSimplify for this.

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

5 years ago[InstSimplify] regenerate test CHECKs; NFC
Sanjay Patel [Wed, 11 Sep 2019 13:56:07 +0000 (13:56 +0000)]
[InstSimplify] regenerate test CHECKs; NFC

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

5 years ago[Alignment][NFC] use llvm::Align for AsmPrinter::EmitAlignment
Guillaume Chatelet [Wed, 11 Sep 2019 13:37:35 +0000 (13:37 +0000)]
[Alignment][NFC] use llvm::Align for AsmPrinter::EmitAlignment

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: dschuff, sdardis, nemanjai, hiraditya, kbarton, jrtc27, MaskRay, atanasyan, jsji, llvm-commits

Tags: #llvm

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

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

5 years ago[LangRef] add link for fma intrinsic
Sanjay Patel [Wed, 11 Sep 2019 13:25:32 +0000 (13:25 +0000)]
[LangRef] add link for fma intrinsic

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

5 years ago[LangRef] fix punctuation; NFC
Sanjay Patel [Wed, 11 Sep 2019 12:22:24 +0000 (12:22 +0000)]
[LangRef] fix punctuation; NFC

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

5 years agogn build: add include_dir that's necessary after r371564
Nico Weber [Wed, 11 Sep 2019 12:21:09 +0000 (12:21 +0000)]
gn build: add include_dir that's necessary after r371564

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

5 years ago[InstCombine] fold sign-bit compares of srem
Sanjay Patel [Wed, 11 Sep 2019 12:04:26 +0000 (12:04 +0000)]
[InstCombine] fold sign-bit compares of srem

(srem X, pow2C) sgt/slt 0 can be reduced using bit hacks by masking
off the sign bit and the module (low) bits:
https://rise4fun.com/Alive/jSO
A '2' divisor allows slightly more folding:
https://rise4fun.com/Alive/tDBM

Any chance to remove an 'srem' use is probably worthwhile, but this is limited
to the one-use improvement case because doing more may expose other missing
folds. That means it does nothing for PR21929 yet:
https://bugs.llvm.org/show_bug.cgi?id=21929

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

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

5 years ago[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing
Guillaume Chatelet [Wed, 11 Sep 2019 11:16:48 +0000 (11:16 +0000)]
[Alignment] Use llvm::Align in MachineFunction and TargetLowering - fixes mir parsing

Summary:
This catches malformed mir files which specify alignment as log2 instead of pow2.
See https://reviews.llvm.org/D65945 for reference,

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: MatzeB, qcolombet, dschuff, arsenm, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, s.egerton, pzheng, llvm-commits

Tags: #llvm

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

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

5 years ago[mips][msa] Fix infinite loop for mips.nori.b intrinsic
Simon Atanasyan [Wed, 11 Sep 2019 11:16:06 +0000 (11:16 +0000)]
[mips][msa] Fix infinite loop for mips.nori.b intrinsic

When value of immediate in `mips.nori.b` is 255 (which has all ones in
binary form as 8bit integer) DAGCombiner and Legalizer would fall in an
infinite loop. DAGCombiner would try to simplify `or %value, -1` by
turning `%value` into UNDEF. Legalizer will turn it back into `Constant<0>`
which would then be again turned into UNDEF by DAGCombiner. To avoid this
loop we make UNDEF legal for MSA int types on Mips.

Patch by Mirko Brkusanin.

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

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

5 years agoFix -Wdocumentation warning - void function doesn't need a @returns. NFCI.
Simon Pilgrim [Wed, 11 Sep 2019 11:12:00 +0000 (11:12 +0000)]
Fix -Wdocumentation warning - void function doesn't need a @returns. NFCI.

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

5 years ago[NFC] Updated objsize-64.ll test
David Bolvansky [Wed, 11 Sep 2019 10:51:26 +0000 (10:51 +0000)]
[NFC] Updated objsize-64.ll test

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

5 years ago[NFC] Fixed test
David Bolvansky [Wed, 11 Sep 2019 10:42:30 +0000 (10:42 +0000)]
[NFC] Fixed test

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

5 years ago[InstCombine] Fixed handling of isOpNewLike (PR11748)
David Bolvansky [Wed, 11 Sep 2019 10:37:03 +0000 (10:37 +0000)]
[InstCombine] Fixed handling of isOpNewLike (PR11748)

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

5 years ago[LoopInterchange] Drop unused splitInnerLoopHeader declaration.
Florian Hahn [Wed, 11 Sep 2019 10:32:15 +0000 (10:32 +0000)]
[LoopInterchange] Drop unused splitInnerLoopHeader declaration.

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

5 years agoRevert "clang-misexpect: Profile Guided Validation of Performance Annotations in...
Dmitri Gribenko [Wed, 11 Sep 2019 09:16:17 +0000 (09:16 +0000)]
Revert "clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM"

This reverts commit r371584. It introduced a dependency from compiler-rt
to llvm/include/ADT, which is problematic for multiple reasons.

One is that it is a novel dependency edge, which needs cross-compliation
machinery for llvm/include/ADT (yes, it is true that right now
compiler-rt included only header-only libraries, however, if we allow
compiler-rt to depend on anything from ADT, other libraries will
eventually get used).

Secondly, depending on ADT from compiler-rt exposes ADT symbols from
compiler-rt, which would cause ODR violations when Clang is built with
the profile library.

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

5 years ago[LoopInterchange] Properly move condition, induction increment and ops to latch.
Florian Hahn [Wed, 11 Sep 2019 08:23:23 +0000 (08:23 +0000)]
[LoopInterchange] Properly move condition, induction increment and ops to latch.

Currently we only rely on the induction increment to come before the
condition to ensure the required instructions get moved to the new
latch.

This patch duplicates and moves the required instructions to the
newly created latch. We move the condition to the end of the new block,
then process its operands. We stop at operands that are defined
outside the loop, or are the induction PHI.

We duplicate the instructions and update the uses in the moved
instructions, to ensure other users remain intact. See the added
test2 for such an example.

Reviewers: efriedma, mcrosier

Reviewed By: efriedma

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

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

5 years ago[NFC][ARM] Add and modify tests
Sam Parker [Wed, 11 Sep 2019 08:17:48 +0000 (08:17 +0000)]
[NFC][ARM] Add and modify tests

Add test for ParallelDSP.

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

5 years ago[LTO] Avoid calling GlobalValue::getGUID (MD5) twice
Fangrui Song [Wed, 11 Sep 2019 07:38:21 +0000 (07:38 +0000)]
[LTO] Avoid calling GlobalValue::getGUID (MD5) twice

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

5 years ago[TLI][AMDGPU] AMDPAL does not have library functions
Tim Renouf [Wed, 11 Sep 2019 07:26:39 +0000 (07:26 +0000)]
[TLI][AMDGPU] AMDPAL does not have library functions

Configure TLI to say that r600/amdgpu does not have any library
functions, such that InstCombine does not do anything like turn sin/cos
into the library function @tan with sufficient fast math flags.

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

Change-Id: I02f907d3e64832117ea9800e9f9285282856e5df

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

5 years ago[llvm-objcopy] Simplify --prefix-alloc-sections
Fangrui Song [Wed, 11 Sep 2019 07:23:35 +0000 (07:23 +0000)]
[llvm-objcopy] Simplify --prefix-alloc-sections

Handle --prefix-alloc-sections after --rename-sections so that --prefix-alloc-sections code
does not have to check if renaming has been performed.

Reviewed By: jhenderson

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

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

5 years ago[Attributor] Implement "noalias" callsite argument deduction
Hideto Ueno [Wed, 11 Sep 2019 07:00:33 +0000 (07:00 +0000)]
[Attributor] Implement "noalias" callsite argument deduction

Summary: Now, `nocapture` is deduced in Attributor therefore, this patch introduces deduction for `noalias` callsite argument using `nocapture`.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[Attributor][Fix] Manifest nocapture only in CSArgument or Argument
Hideto Ueno [Wed, 11 Sep 2019 06:52:11 +0000 (06:52 +0000)]
[Attributor][Fix] Manifest nocapture only in CSArgument or Argument

Summary:
We can query to Attributor whether the value is captured in the scope or not on the following way:

```
    const auto & NoCapAA = A.getAAFor<AANoCapture>(*this, IRPosition::value(V));
```
And if V is CallSiteReturned then `getDeducedAttribute` will add `nocatpure` to the callsite returned value. It is not valid.
This patch checks the position is an argument or call site argument.

This is tested in D67286.

Reviewers: jdoerfert, sstefan1

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

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

5 years ago[Debuginfo][Instcombiner] Do not clone dbg.declare.
Alexey Lapshin [Wed, 11 Sep 2019 06:07:16 +0000 (06:07 +0000)]
[Debuginfo][Instcombiner] Do not clone dbg.declare.

TryToSinkInstruction() has a bug: While updating debug info for
sunk instruction, it could clone dbg.declare intrinsic.
That is wrong. There could be only one dbg.declare.
The fix is to not clone dbg.declare intrinsic and to update
it`s arguments, to not to point to sunk instruction.

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

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

5 years ago[llvm-nm] Fix -DBUILD_SHARED_LIBS=ON builds after D66160/r371576
Fangrui Song [Wed, 11 Sep 2019 01:49:00 +0000 (01:49 +0000)]
[llvm-nm] Fix -DBUILD_SHARED_LIBS=ON builds after D66160/r371576

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

5 years agoclang-misexpect: Profile Guided Validation of Performance Annotations in LLVM
Petr Hosek [Wed, 11 Sep 2019 01:09:16 +0000 (01:09 +0000)]
clang-misexpect: Profile Guided Validation of Performance Annotations in LLVM

This patch contains the basic functionality for reporting potentially
incorrect usage of __builtin_expect() by comparing the developer's
annotation against a collected PGO profile. A more detailed proposal and
discussion appears on the CFE-dev mailing list
(http://lists.llvm.org/pipermail/cfe-dev/2019-July/062971.html) and a
prototype of the initial frontend changes appear here in D65300

We revised the work in D65300 by moving the misexpect check into the
LLVM backend, and adding support for IR and sampling based profiles, in
addition to frontend instrumentation.

We add new misexpect metadata tags to those instructions directly
influenced by the llvm.expect intrinsic (branch, switch, and select)
when lowering the intrinsics. The misexpect metadata contains
information about the expected target of the intrinsic so that we can
check against the correct PGO counter when emitting diagnostics, and the
compiler's values for the LikelyBranchWeight and UnlikelyBranchWeight.
We use these branch weight values to determine when to emit the
diagnostic to the user.

A future patch should address the comment at the top of
LowerExpectIntrisic.cpp to hoist the LikelyBranchWeight and
UnlikelyBranchWeight values into a shared space that can be accessed
outside of the LowerExpectIntrinsic pass. Once that is done, the
misexpect metadata can be updated to be smaller.

In the long term, it is possible to reconstruct portions of the
misexpect metadata from the existing profile data. However, we have
avoided this to keep the code simple, and because some kind of metadata
tag will be required to identify which branch/switch/select instructions
are influenced by the use of llvm.expect

Patch By: paulkirth
Differential Revision: https://reviews.llvm.org/D66324

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

5 years agoRevert "llvm-reduce: Add pass to reduce parameters"
David Blaikie [Wed, 11 Sep 2019 00:44:17 +0000 (00:44 +0000)]
Revert "llvm-reduce: Add pass to reduce parameters"

Looks to be failing on asan buildbots

This reverts commit r371567.

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

5 years agoRevert "Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds."
Petr Hosek [Wed, 11 Sep 2019 00:43:35 +0000 (00:43 +0000)]
Revert "Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds."

This reverts commit r371566: this doesn't correctly handle the case
where LLVM_ENABLE_RUNTIMES contains a list of values.

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

5 years ago[Object][TextAPI] NFC, fix tapi lit tests
Cyndy Ishida [Wed, 11 Sep 2019 00:13:01 +0000 (00:13 +0000)]
[Object][TextAPI] NFC, fix tapi lit tests

FileCheck command had wrong casing, which works fine on macOS, repairs the linux build bots

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

5 years ago[llvm-nm] Add tapi file support
Cyndy Ishida [Wed, 11 Sep 2019 00:00:53 +0000 (00:00 +0000)]
[llvm-nm] Add tapi file support

Summary:
This commit is the final one for adding tapi support to the llvm-nm implementation.
This commit also has accompanying tests the additions to lib/Object

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: hiraditya, plotfi, dexonsmith, rupprecht, llvm-commits

Tags: #llvm

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

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

5 years ago[MemorySSA] MemorySSA should not model debuginfo, and need not update it.
Alina Sbirlea [Tue, 10 Sep 2019 23:36:43 +0000 (23:36 +0000)]
[MemorySSA] MemorySSA should not model debuginfo, and need not update it.

Reverts the change in r371084, but keeps the test.
After r371565, debuginfo cannot be modelled in MemorySSA, even with a
non-standard AA pipeline.

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

5 years ago[GlobalISel] When a tail call is emitted in a block, stop translating it
Jessica Paquette [Tue, 10 Sep 2019 23:34:45 +0000 (23:34 +0000)]
[GlobalISel] When a tail call is emitted in a block, stop translating it

This fixes a crash in tail call translation caused by assume and lifetime_end
intrinsics.

It's possible to have instructions other than a return after a tail call which
will still have `Analysis::isInTailCallPosition` return true. (Namely,
lifetime_end and assume intrinsics.)

If we emit a tail call, we should stop translating instructions in the block.
Otherwise, we can end up emitting an extra return, or dead instructions in
general. This makes the verifier unhappy, and is generally unfortunate for
codegen.

This also removes the code from AArch64CallLowering that checks if we have a
tail call when lowering a return. This is covered by the new code now.

Also update call-translator-tail-call.ll to show that we now properly tail call
in the presence of lifetime_end and assume.

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

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

5 years ago[AArch64][GlobalISel] Support sibling calls with mismatched calling conventions
Jessica Paquette [Tue, 10 Sep 2019 23:25:12 +0000 (23:25 +0000)]
[AArch64][GlobalISel] Support sibling calls with mismatched calling conventions

Add support for sibcalling calls whose calling convention differs from the
caller's.

- Port over `CCState::resultsCombatible` from CallingConvLower.cpp into
  CallLowering. This is used to verify that the way the caller and callee CC
  handle incoming arguments matches up.

- Add `CallLowering::analyzeCallResult`. This is basically a port of
  `CCState::AnalyzeCallResult`, but using `ArgInfo` rather than `ISD::InputArg`.

- Add `AArch64CallLowering::doCallerAndCalleePassArgsTheSameWay`. This checks
  that the calling conventions are compatible, and that the caller and callee
  preserve the same registers.

For testing:

- Update call-translator-tail-call.ll to show that we can now handle this.

- Add a GISel line to tailcall-ccmismatch.ll to show that we will not tail call
  when the regmasks don't line up.

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

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

5 years agoUpdate ReleaseNotes: add enabling of MemorySSA.
Alina Sbirlea [Tue, 10 Sep 2019 23:22:37 +0000 (23:22 +0000)]
Update ReleaseNotes: add enabling of MemorySSA.

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

5 years agoReland "Change the X86 datalayout to add three address spaces
Amy Huang [Tue, 10 Sep 2019 23:15:38 +0000 (23:15 +0000)]
Reland "Change the X86 datalayout to add three address spaces
 for 32 bit signed, 32 bit unsigned, and 64 bit pointers."
This reverts 57076d3199fc2b0af4a3736b7749dd5462cacda5.

Original review at https://reviews.llvm.org/D64931.
Review for added fix at https://reviews.llvm.org/D66843.

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

5 years agollvm-reduce: Add pass to reduce parameters
David Blaikie [Tue, 10 Sep 2019 23:10:10 +0000 (23:10 +0000)]
llvm-reduce: Add pass to reduce parameters

Patch by Diego Treviño!

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

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

5 years agoAdding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.
Puyan Lotfi [Tue, 10 Sep 2019 22:55:47 +0000 (22:55 +0000)]
Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.

On some platforms, certain runtimes are not supported. For runtimes builds of
those platforms it would be nice if we could disable certain runtimes (ie
libunwind on Windows).

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

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

5 years ago[MemorySSA] Do not create memoryaccesses for debug info intrinsics.
Alina Sbirlea [Tue, 10 Sep 2019 22:35:27 +0000 (22:35 +0000)]
[MemorySSA] Do not create memoryaccesses for debug info intrinsics.

Summary:
Do not model debuginfo intrinsics in MemorySSA.
Regularly these are non-memory modifying instructions. With -disable-basicaa, they were being modelled as Defs.

Reviewers: george.burgess.iv

Subscribers: aprantl, Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

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

5 years agollvm-reduce: Remove some unused headers/more narrowly include them
David Blaikie [Tue, 10 Sep 2019 22:31:35 +0000 (22:31 +0000)]
llvm-reduce: Remove some unused headers/more narrowly include them

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

5 years agollvm-remove: Remove "using namespace" in header.
David Blaikie [Tue, 10 Sep 2019 22:10:00 +0000 (22:10 +0000)]
llvm-remove: Remove "using namespace" in header.

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

5 years agollvm-reduce: Add pass to reduce Metadata
David Blaikie [Tue, 10 Sep 2019 22:09:58 +0000 (22:09 +0000)]
llvm-reduce: Add pass to reduce Metadata

Patch by Diego Treviño!

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

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

5 years agoMove LLVM_ENABLE_ABI_BREAKING_CHECKS variables to their own file
Eric Christopher [Tue, 10 Sep 2019 22:05:01 +0000 (22:05 +0000)]
Move LLVM_ENABLE_ABI_BREAKING_CHECKS variables to their own file
so that you don't have to link Error.o and all of its dependencies.

In more detail: global initializers in Error.o can't be elided with
-ffunction-sections/-gc-sections since they always need to be run
causing a fairly significant binary bloat if all you want is the
ABI breaking checks code.

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

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

5 years ago[Loads] Move generic code out of vectorizer into a location it might be reused [NFC]
Philip Reames [Tue, 10 Sep 2019 21:33:53 +0000 (21:33 +0000)]
[Loads] Move generic code out of vectorizer into a location it might be reused [NFC]

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

5 years ago[ValueTracking] Factor our common speculation suppression logic [NFC]
Philip Reames [Tue, 10 Sep 2019 21:12:29 +0000 (21:12 +0000)]
[ValueTracking] Factor our common speculation suppression logic [NFC]

Expose a utility function so that all places which want to suppress speculation (when otherwise legal) due to ordering and/or sanitizer interaction can do so.

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

5 years agollvm-reduce: Simplify testing using -implicit-check-not
David Blaikie [Tue, 10 Sep 2019 20:52:14 +0000 (20:52 +0000)]
llvm-reduce: Simplify testing using -implicit-check-not

Also fix llvm-reduce to use the specified output file name directly,
without appending '.ll' to the name.

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

5 years ago[x86] add test for false dependency with AVX; NFC
Sanjay Patel [Tue, 10 Sep 2019 20:04:10 +0000 (20:04 +0000)]
[x86] add test for false dependency with AVX; NFC

Goes with D67363

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

5 years ago[NFC][InstCombine] rewrite test added in r371537 to use non-null pointer instead
Roman Lebedev [Tue, 10 Sep 2019 19:30:17 +0000 (19:30 +0000)]
[NFC][InstCombine] rewrite test added in r371537 to use non-null pointer instead

I only want to ensure that %offset is non-zero there,
it doesn't matter how that info is conveyed.
As filed in PR43267, the assumption way does not work.

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

5 years ago[X86] Updated target specific selection dag code to conservatively check for isAtomic...
Philip Reames [Tue, 10 Sep 2019 18:43:15 +0000 (18:43 +0000)]
[X86] Updated target specific selection dag code to conservatively check for isAtomic in addition to isVolatile

See D66309 for context.

This is the first sweep of x86 target specific code to add isAtomic bailouts where appropriate. The intention here is to have the switch from AtomicSDNode to LoadSDNode/StoreSDNode be close to NFC; that is, I'm not looking to allow additional optimizations at this time.

Sorry for the lack of tests.  As discussed in the review, most of these are vector tests (for which atomicity is not well defined) and I couldn't figure out to exercise the anyextend cases which aren't vector specific.

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

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

5 years ago[NFC][InstSimplify] rewrite test added in r371537 to use non-null pointer instead
Roman Lebedev [Tue, 10 Sep 2019 18:40:00 +0000 (18:40 +0000)]
[NFC][InstSimplify] rewrite test added in r371537 to use non-null pointer instead

I only want to ensure that %offset is non-zero there,
it doesn't matter how that info is conveyed.
As filed in PR43267, the assumption way does not work.

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

5 years agoGlobalISel/TableGen: Handle REG_SEQUENCE patterns
Matt Arsenault [Tue, 10 Sep 2019 17:57:33 +0000 (17:57 +0000)]
GlobalISel/TableGen: Handle REG_SEQUENCE patterns

The scalar f64 patterns don't work yet because they fail on multiple
results from the unused implicit def of scc in the result bit
operation.

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

5 years ago[BPI] Adjust the probability for floating point unordered comparison
Guozhi Wei [Tue, 10 Sep 2019 17:25:11 +0000 (17:25 +0000)]
[BPI] Adjust the probability for floating point unordered comparison

Since NaN is very rare in normal programs, so the probability for floating point unordered comparison should be extremely small. Current probability is 3/8, it is too large, this patch changes it to a tiny number.

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

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

5 years agoAMDGPU/GlobalISel: Select G_FABS/G_FNEG
Matt Arsenault [Tue, 10 Sep 2019 17:19:46 +0000 (17:19 +0000)]
AMDGPU/GlobalISel: Select G_FABS/G_FNEG

f64 doesn't work yet because tablegen currently doesn't handlde
REG_SEQUENCE.

This does regress some multi use VALU fneg cases since now the
immediate remains in an SGPR, and more moves are used for legalizing
the xor. This is a SIFixSGPRCopies deficiency.

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