Commit Graph

178137 Commits

Author SHA1 Message Date
Xinliang David Li a67600cb79 Add optional arg to profile count getters to filter
synthetic profile count.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359131 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 19:51:16 +00:00
Craig Topper c28a81a948 [X86] Prevent folding a load into an AND if that AND is really a ZEXT_INREG that should use movzx.
This can save a 32-bit immediate move.

We would shrink the load and fold it if it was non-volatile, but that's trickier to check for.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359129 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 19:28:38 +00:00
Nico Weber 9d62c90835 llvm-cvtres: Remove a default argument. No behavior change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359128 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 19:13:38 +00:00
Adrian Prantl c66f2ef76d Revert using fcopyfile(3) to implement sys::fs::copy_file(Twine, int) on macOS
It turns out that I mesread the man page and fcopyfile(3) does not
actually support COPYFILE_CLONE for files.

<rdar://problem/50148757>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359127 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 19:08:43 +00:00
David Blaikie d7f88bede7 DebugInfo: Emit only declarations (not whole definitions) of non-unit user defined types into type units
While this doesn't come up in reasonable cases currently (the only user
defined types not in type units are ones without linkage - which makes
for near-ODR violations, because it'd be a type with linkage referencing
a type without linkage - such a type can't be validly defined in more
than one TU, so arguably it shouldn't be in a type unit to begin with -
but it's a convenient way to demonstrate an issue that will become more
revalent with homed modular debug info type definitions - which also
don't need to be in type units but more legitimately so).

Precursor to the Clang change to de-type-unit (by omitting the
'identifier') types homed due to strong linkage vtables. (making that
change without this one would lead to major type duplication in type
units)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359122 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 18:09:44 +00:00
Craig Topper fc1e159675 [X86] Remove dead nodes left after ReplaceAllUsesWith calls during address matching
ReplaceAllUsesWith doesn't remove the node that was replaced. So its left around in the graph messing up use counts on other nodes.

One thing to note, is that this isn't valid if the node being deleted is the root node of an LEA match that gets rejected. In that case the node needs to stay alive because the isel table walking code would still have a reference to it that its going to try to match next. I don't think that's the case here though because the nodes being deleted here should be "and", "srl", and "zero_extend" none of which can be the root node of an LEA match.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359121 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 18:02:07 +00:00
Stanislav Mekhanoshin e01c22c12c [AMDGPU] gfx1010 sgpr register changes
Differential Revision: https://reviews.llvm.org/D61045

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359117 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 17:28:30 +00:00
Simon Pilgrim be72558708 [X86][SSE] Add tests for bitcasting vXi1 bool vectors to non-simple types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359116 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 17:25:45 +00:00
Lang Hames a104dee58e [JITLink] Add support for passing arguments to jit-linked code.
The --args option can now be used to pass arguments to code linked with
llvm-jitlink. E.g.

$ llvm-jitlink file1.o file2.o --args a b c

is equivalent to:

$ ld -o program file1.o file2.o
$ ./program a b c

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359115 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 17:23:05 +00:00
Robert Widmann f26b156fd2 [LLVM-C] Deprecate the LLVMValueRef-returning metadata creation functions
Summary: There is still some value in using these functions while the remaining LLVMValueRef-based accessors are still around, but LLVMMDNodeInContext in particular has some wonky semantics that make it worth replacing outright.

Reviewers: whitequark, deadalnix

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359114 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 17:05:08 +00:00
Stanislav Mekhanoshin f43d543c45 [AMDGPU] Add gfx1010 target definitions
Differential Revision: https://reviews.llvm.org/D61041

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359113 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 17:03:15 +00:00
Simon Pilgrim 7847a7c9b0 [InstCombine][X86] Use generic expansion of PACKSS/PACKUS for constant folding. NFCI.
This patch rewrites the existing PACKSS/PACKUS constant folding code to expand as a generic expansion.

This is a first NFCI step toward expanding PACKSS/PACKUS intrinsics which are acting as non-saturating truncations (although technically the expansion could be used in all cases - but we'll probably want to be conservative).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359111 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 16:53:17 +00:00
JF Bastien 1c93fd793c Revert "[llvm-objdump] errorToErrorCode+message -> toString"
Revert r359100

It breaks llvm/test/Object/elf-invalid-phdr.test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359110 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 16:49:30 +00:00
Nico Weber aae1f9f35a llvm-undname: Fix assert-on->4GiB-string-literal, found by oss-fuzz
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359109 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 16:09:38 +00:00
Lang Hames ea4679cf0f [JITLink] Refer to FDE's CIE (not the most recent CIE) when parsing eh-frame.
Frame Descriptor Entries (FDEs) have a pointer back to a Common Information
Entry (CIE) that describes how the rest FDE should be parsed. JITLink had been
assuming that FDEs always referred to the most recent CIE encountered, but the
spec allows them to point back to any previously encountered CIE. This patch
fixes JITLink to look up the correct CIE for the FDE.

The testcase is a MachO binary with an FDE that refers to a CIE that is not the
one immediately proceeding it (the layout can be viewed wit
'dwarfdump --eh-frame <testcase>'. This test case had to be a binary as llvm-mc
now sorts FDEs (as of r356216) to ensure FDEs *do* point to the most recent CIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359105 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 15:15:55 +00:00
Fangrui Song 25a01d9e01 [llvm-objdump] Delete redundant check
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359102 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 15:09:23 +00:00
George Rimar 893591a76e [obj2yamp] - Simplify and cleanup the code in ELFDumper<ELFT>::dumpGroup a bit. NFC.
This makes the variables naming to match LLVM style,
simplifies the code used to extract the group members,
simplifies the loop and reorders the code around a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359101 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 15:03:53 +00:00
Fangrui Song cf72ee0ee4 [llvm-objdump] errorToErrorCode+message -> toString
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359100 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 15:03:46 +00:00
Dmitry Preobrazhensky 3c53015c0f [AMDGPU][MC] Parser cleanup and refactoring
Reviewers: artem.tamazov, arsenm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359096 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 14:06:15 +00:00
Sanjay Patel 03f6e8657c [x86] make sure horizontal op and broadcast types match to simplify (PR41414)
If the types don't match, we can't just remove the shuffle.
There may be some other opportunity for optimization here,
but this should prevent the crashing seen in:
https://bugs.llvm.org/show_bug.cgi?id=41414

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359095 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 14:05:08 +00:00
whitequark eccf5bf081 [LLVM-C] Use dyn_cast instead of unwrap in LLVMGetDebugLoc functions
Summary:
The `unwrap<Type>` calls can assert with:
```
Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast
```
so replace them with `dyn_cast`.

Reviewers: whitequark, abdulras, hiraditya, compnerd

Reviewed By: whitequark

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359093 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 13:30:03 +00:00
Fangrui Song e5c799a6ea [yaml2obj] Replace num_zeros with write_zeros
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359091 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 13:23:15 +00:00
George Rimar 37c286fa0b [yaml2elf] - Replace a loop with write_zeros(). NFC.
And apply clang-format to the method changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359090 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 13:02:15 +00:00
Simon Pilgrim bae5fa7acb [X86] Add shouldFoldConstantShiftPairToMask override placeholder. NFCI.
Prep work toward fixing PR40758

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359088 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 12:34:08 +00:00
Nico Weber 97ae15dc0f Let llvm-cvtres (and lld-link) report duplicate resources
If two .res files contain the same resource, cvtres.exe (and hence
link.exe) reject the input with this message:

    CVTRES : fatal error CVT1100: duplicate resource.  type:STRING, name:101, language:0x0409
    LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

llvm-cvtres (and lld-link) used to silently pick one of the duplicate
resources instead. This patch makes them report an error as well.
We slightly improve on cvtres by printing the name of two .res files
containing duplicate entries as well.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359083 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 11:42:59 +00:00
Simon Pilgrim 8b62c4ddd9 [X86][SSE] Add masked bit test cases for PR26697
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359082 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 10:34:15 +00:00
Bjorn Pettersson a80a3919ff Add "const" in GetUnderlyingObjects. NFC
Summary:
Both the input Value pointer and the returned Value
pointers in GetUnderlyingObjects are now declared as
const.

It turned out that all current (in-tree) uses of
GetUnderlyingObjects were trivial to update, being
satisfied with have those Value pointers declared
as const. Actually, in the past several of the users
had to use const_cast, just because of ValueTracking
not providing a version of GetUnderlyingObjects with
"const" Value pointers. With this patch we get rid
of those const casts.

Reviewers: hfinkel, materi, jkorous

Reviewed By: jkorous

Subscribers: dexonsmith, jkorous, jholewinski, sdardis, eraman, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359072 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 06:55:50 +00:00
Craig Topper 685ae82844 [Mips][CodeGen] Remove MachineFunction::setSubtarget. Change Mips to just copy the subtarget from the MachineFunction instead of recalculating it.
Summary:
The MachineFunction should have been created with the correct subtarget. As
long as there is no way to change it, MipsTargetMachine can just capture it
directly from the MachineFunction without calling getSubtargetImpl again.

While there, const correct the Subtarget pointer to avoid a const_cast.

I believe the Mips16Subtarget and NoMips16Subtarget members are never used, but
I'll leave there removal for a separate patch.

Reviewers: echristo, atanasyan

Reviewed By: atanasyan

Subscribers: sdardis, arichardson, hiraditya, jrtc27, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359071 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 06:48:31 +00:00
Fangrui Song 8b0afcf334 [CommandLine] Provide parser<unsigned long> instantiation to allow cl::opt<uint64_t> on LP64 platforms
Summary:
And migrate opt<unsigned long long> to opt<uint64_t>

Fixes PR19665

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359068 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 02:40:20 +00:00
Nico Weber ebe37abc9e llvm-cvtres: Accept /? as help flag, like cvtres.exe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359064 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 02:11:24 +00:00
Nico Weber 4f431337c8 gn build: Merge r359050 more
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359058 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 00:59:24 +00:00
Nico Weber 064cbbfc2b gn build: Merge r359050
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359056 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 00:44:14 +00:00
Alina Sbirlea 20b802a025 Revert [AliasAnalysis] AAResults preserves AAManager.
Triggers use-after-free.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359055 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 00:28:29 +00:00
Francis Visoiu Mistrih 2f2940ec9d [Remarks] Fix documentation indentation
Fix the documentation bot:

http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/30450/steps/docs-llvm-html/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359053 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 00:27:59 +00:00
Francis Visoiu Mistrih 04dcbb5165 [Remarks] Add string deduplication using a string table
* Add support for uniquing strings in the remark streamer and emitting the string table in the remarks section.

* Add parsing support for the string table in the RemarkParser.

From this remark:

```
--- !Missed
Pass:     inline
Name:     NoDefinition
DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
            Line: 7, Column: 3 }
Function: printArgsNoRet
Args:
  - Callee:   printf
  - String:   ' will not be inlined into '
  - Caller:   printArgsNoRet
    DebugLoc: { File: 'test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c',
                Line: 6, Column: 0 }
  - String:   ' because its definition is unavailable'
...
```

to:

```
--- !Missed
Pass: 0
Name: 1
DebugLoc: { File: 3, Line: 7, Column: 3 }
Function: 2
Args:
  - Callee:   4
  - String:   5
  - Caller:   2
    DebugLoc: { File: 3, Line: 6, Column: 0 }
  - String:   6
...
```

And the string table in the .remarks/__remarks section containing:

```
inline\0NoDefinition\0printArgsNoRet\0
test-suite/SingleSource/UnitTests/2002-04-17-PrintfChar.c\0printf\0
will not be inlined into \0 because its definition is unavailable\0
```

This is mostly supposed to be used for testing purposes, but it gives us
a 2x reduction in the remark size, and is an incremental change for the
updates to the remarks file format.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359050 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-24 00:06:24 +00:00
Josh Stone 07bbdf4564 [Lint] Permit aliasing noalias readonly arguments
Summary:
If two arguments are both readonly, then they have no memory dependency
that would violate noalias, even if they do actually overlap.

Reviewers: hfinkel, efriedma

Reviewed By: efriedma

Subscribers: efriedma, hiraditya, llvm-commits, tstellar

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359047 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 23:43:47 +00:00
Jessica Paquette 7fa516f0eb [AArch64][GlobalISel] Select G_INTRINSIC_ROUND
Add selection support for G_INTRINSIC_ROUND, add a selection test, and add
check lines to arm64-vfloatintrinsics.ll and f16-instructions.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359046 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 23:03:03 +00:00
Jessica Paquette aeabb06063 [AArch64][GlobalISel] Mark G_INTRINSIC_ROUND as a pre-isel floating point opcode
Add G_INTRINSIC_ROUND to isPreISelGenericFloatingPointOpcode to ensure that its
input and output are assigned the correct register bank.

Add a regbankselect test to verify that we get what we expect here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359044 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 22:47:00 +00:00
Dmitry Mikulin b06d1c065f The error message for mismatched value sites is very cryptic.
Make it more readable for an average user.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359043 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 22:26:55 +00:00
Alex Langford 0734b610d6 [CMake] Use add_dependencies in add_llvm_install_targets
Summary:
The CMake documentation says that the `DEPENDS` field of
add_custom_target is for files and output of custom commands. Adding a
dependency on a target should be done with `add_dependency`.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359042 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:59:07 +00:00
Francis Visoiu Mistrih a8196a8e04 [CGP] Look through bitcasts when duplicating returns for tail calls
The simple case of:

```
int *callee();
void *caller(void *a) {
  if (a == NULL)
    return callee();
  return a;
}
```

would generate a regular call instead of a tail call because we don't
look through the bitcast of the call to `callee` when duplicating the
return blocks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359041 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:57:46 +00:00
Francis Visoiu Mistrih 7f2f10be2a [X86] Add codegen prepare test exercising a bitcast + tail call
In preparation of https://reviews.llvm.org/D60837, add this test where
we don't perform a tail call because we don't look through a bitcast.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359040 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:57:43 +00:00
Heejin Ahn 65db0de9a6 [WebAssembly] Emit br_table for most switch instructions
Summary:
Always convert switches to br_tables unless there is only one case,
which is equivalent to a simple branch. This reduces code size for wasm,
and we defer possible jump table optimizations to the VM.
Addresses PR41502.

Reviewers: kripken, sunfish

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359038 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:30:30 +00:00
Heejin Ahn 4febd59e1b [WebAssembly] Make LBB markers not affected by test order
Summary:
This way we can change the order of tests or delete some of them without
affecting tests for other functions.

Reviewers: tlively

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359036 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:17:03 +00:00
Amy Huang 320b0cfdcd Revert "[MS] Emit S_HEAPALLOCSITE debug info" because of ToTWin64(db)
buildbot failure.

This reverts commit d07d6d617713bececf57f3547434dd52f0f13f9e and
c774f687b6880484a126ed3e3d737e74c926f0ae.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359034 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:12:58 +00:00
Jessica Paquette ad14805c43 [AArch64][GlobalISel] Legalize G_INTRINSIC_ROUND
Add it to the same rule as G_FCEIL etc. Add a legalizer test, and add a missing
switch case to AArch64LegalizerInfo.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359033 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 21:11:57 +00:00
Alina Sbirlea a7a3e6435d [MemorySSA] LCSSA preserves MemorySSA.
Summary:
Enabling MemorySSA in the old pass manager leads to MemorySSA being run
twice due to the fact that LCSSA and LoopSimplify do not preserve
MemorySSA. This is the first step to address that: target LCSSA.

LCSSA does not make any changes that invalidate MemorySSA, so it
preserves it by design. It must preserve AA as well, for this to hold.

After this patch, MemorySSA is still run twice in the old pass manager.
Step two follows: target LoopSimplify.

Subscribers: mehdi_amini, jlebar, Prazek, llvm-commits, george.burgess.iv, chandlerc

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359032 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 20:59:44 +00:00
Craig Topper 2aee714ecd [X86] Autogenerate complete checks. NFC
Prep for D60993

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359031 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 20:52:00 +00:00
Jessica Paquette a5a971abe2 [AArch64][GlobalISel] Actually select G_INTRINSIC_TRUNC
Apparently FileCheck wasn't actually matching the fallback check lines in
arm64-vfloatintrinsics.ll properly. So, there were selection fallbacks for
G_INTRINSIC_TRUNC there.

Actually hook it up into AArch64InstructionSelector.cpp and write a proper
selection test.

I guess I'll figure out the FileCheck magic to make the fallback checks work
properly in arm64-vfloatintrinsics.ll.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359030 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 20:46:19 +00:00
Akira Hatanaka 66aa9e14bd [ObjC][ARC] Check the basic block size before calling
DominatorTree::dominate.

ARC contract pass has an optimization that replaces the uses of the
argument of an ObjC runtime function call with the call result.

For example:

; Before optimization
%1 = tail call i8* @foo1()
%2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
store i8* %1, i8** @g0, align 8

; After optimization
%1 = tail call i8* @foo1()
%2 = tail call i8* @llvm.objc.retainAutoreleasedReturnValue(i8* %1)
store i8* %2, i8** @g0, align 8 // %1 is replaced with %2

Before replacing the argument use, DominatorTree::dominate is called to
determine whether the user instruction is dominated by the ObjC runtime
function call instruction. The call to DominatorTree::dominate can be
expensive if the two instructions belong to the same basic block and the
size of the basic block is large. This patch checks the basic block size
and just bails out if the size exceeds the limit set by command line
option "arc-contract-max-bb-size".

rdar://problem/49477063

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359027 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-23 19:49:03 +00:00