platform/upstream/llvm.git
5 years agoAdd nofree attribute to CodeGenOpenCL/convergent.cl test
Brian Homerding [Mon, 8 Jul 2019 16:24:10 +0000 (16:24 +0000)]
Add nofree attribute to CodeGenOpenCL/convergent.cl test

The revision at https://reviews.llvm.org/rL365336 added inference of the nofree
attribute.  This revision updates the test to reflect this.

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

llvm-svn: 365341

5 years ago[Bitcode][NFC] Remove unused variable from BitcodeAnalyzer
Francis Visoiu Mistrih [Mon, 8 Jul 2019 16:19:45 +0000 (16:19 +0000)]
[Bitcode][NFC] Remove unused variable from BitcodeAnalyzer

llvm-svn: 365340

5 years agoTeach the IRBuilder about fadd and friends.
Kevin P. Neal [Mon, 8 Jul 2019 16:18:18 +0000 (16:18 +0000)]
Teach the IRBuilder about fadd and friends.

The IRBuilder has calls to create floating point instructions like fadd.
It does not have calls to create constrained versions of them. This patch
adds support for constrained creation of fadd, fsub, fmul, fdiv, and frem.

Reviewed by: John McCall, Sanjay Patel
Approved by: John McCall
Differential Revision: https://reviews.llvm.org/D53157

llvm-svn: 365339

5 years ago[lldb] [test] Update NetBSD XFAILs in test suite
Michal Gorny [Mon, 8 Jul 2019 16:16:07 +0000 (16:16 +0000)]
[lldb] [test] Update NetBSD XFAILs in test suite

llvm-svn: 365338

5 years ago[pstl] Use a different namespace for each backend
Louis Dionne [Mon, 8 Jul 2019 16:05:00 +0000 (16:05 +0000)]
[pstl] Use a different namespace for each backend

Also, use a single point of customization to set what namespace __par_backend
"points to", which provides a better separation of concerns.

llvm-svn: 365337

5 years agoAdd, and infer, a nofree function attribute
Brian Homerding [Mon, 8 Jul 2019 15:57:56 +0000 (15:57 +0000)]
Add, and infer, a nofree function attribute

This patch adds a function attribute, nofree, to indicate that a function does
not, directly or indirectly, call a memory-deallocation function (e.g., free,
C++'s operator delete).

Reviewers: jdoerfert

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

llvm-svn: 365336

5 years ago[docs][llvm-readobj][llvm-readelf] Improve wording
James Henderson [Mon, 8 Jul 2019 15:46:26 +0000 (15:46 +0000)]
[docs][llvm-readobj][llvm-readelf] Improve wording

llvm-svn: 365335

5 years ago[OPENMP]Add -Wunintialized to the erroneous tests for future fix PR42392,
Alexey Bataev [Mon, 8 Jul 2019 15:45:24 +0000 (15:45 +0000)]
[OPENMP]Add -Wunintialized to the erroneous tests for future fix PR42392,
NFC.

llvm-svn: 365334

5 years ago[InstCombine] fix typo in test; NFC
Sanjay Patel [Mon, 8 Jul 2019 15:38:03 +0000 (15:38 +0000)]
[InstCombine] fix typo in test; NFC

I added this test in rL365325, but didn't mean to create an undef insert.

llvm-svn: 365333

5 years ago[OPENMP]Make __kmpc_push_tripcount thread safe.
Alexey Bataev [Mon, 8 Jul 2019 15:30:23 +0000 (15:30 +0000)]
[OPENMP]Make __kmpc_push_tripcount thread safe.

Summary:
__kmpc_push_tripcount function is not thread safe and may lead to data
race when the target regions are executed in parallel threads. The patch
makes loopTripCnt counter thread aware and stores the tripcount value
per thread in the map. Access to map is guarded by mutex to prevent
data race in the map itself.
Test is for NVPTX target because it does not work correctly on the
host. Seems to me, there is a problem in libomp with target regions in
the parallel threads.

Reviewers: grokos

Subscribers: guansong, jfb, jdoerfert, openmp-commits, kkwli0, caomhin

Tags: #openmp

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

llvm-svn: 365332

5 years ago[clangd] A code tweak to expand a macro
Ilya Biryukov [Mon, 8 Jul 2019 15:25:16 +0000 (15:25 +0000)]
[clangd] A code tweak to expand a macro

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 365331

5 years ago[PowerPC][NFC]Update testcases using script.
Jinsong Ji [Mon, 8 Jul 2019 15:24:32 +0000 (15:24 +0000)]
[PowerPC][NFC]Update testcases using script.

llvm-svn: 365330

5 years ago[RISCV][NFC] Make use of Triple::isRISCV
Alex Bradbury [Mon, 8 Jul 2019 15:07:12 +0000 (15:07 +0000)]
[RISCV][NFC] Make use of Triple::isRISCV

Use new helper introduced in rL365327.

llvm-svn: 365329

5 years ago[X86] ISD::INSERT_SUBVECTOR - use uint64_t index. NFCI.
Simon Pilgrim [Mon, 8 Jul 2019 14:52:56 +0000 (14:52 +0000)]
[X86] ISD::INSERT_SUBVECTOR - use uint64_t index. NFCI.

Keep the uint64_t type from getConstantOperandVal to stop truncation/extension overflow warnings in MSVC in subvector index math.

llvm-svn: 365328

5 years ago[Triple] Add isRISCV function
Alex Bradbury [Mon, 8 Jul 2019 14:52:36 +0000 (14:52 +0000)]
[Triple] Add isRISCV function

This matches isARM, isThumb, isAArch64 and similar helpers. Future commits
which clean-up code that currently checks for Triple::riscv32 ||
Triple::riscv64.

Differential Revision: https://reviews.llvm.org/D54215
Patch by Simon Cook.
Test case added by Alex Bradbury.

llvm-svn: 365327

5 years ago[libc++] Take 2: Do not cleverly link against libc++abi just because it happens to...
Louis Dionne [Mon, 8 Jul 2019 14:49:35 +0000 (14:49 +0000)]
[libc++] Take 2: Do not cleverly link against libc++abi just because it happens to be there

Summary:
Otherwise, when libcxxabi is not an enabled project in the monorepo, we
get a link error because we try to link against non-existent cxxabi_shared.

More generally, we shouldn't change the behavior of the build based on
implicit things like whether a file happens to be at a specific path or
not.

This is a re-application of r365222 that had been reverted in r365233
because it broke the build bots. However, the build bots now specify
explicitly what ABI library they want to use (libc++abi), so this
commit should now be OK to merge.

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

llvm-svn: 365326

5 years ago[InstCombine] add tests for splat shuffles; NFC
Sanjay Patel [Mon, 8 Jul 2019 14:49:21 +0000 (14:49 +0000)]
[InstCombine] add tests for splat shuffles; NFC

llvm-svn: 365325

5 years ago[Float2Int] Add support for unary FNeg to Float2Int
Cameron McInally [Mon, 8 Jul 2019 14:46:07 +0000 (14:46 +0000)]
[Float2Int] Add support for unary FNeg to Float2Int

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

llvm-svn: 365324

5 years ago[MIPS GlobalISel] Register bank select for G_LOAD. Select i64 load
Petar Avramovic [Mon, 8 Jul 2019 14:45:52 +0000 (14:45 +0000)]
[MIPS GlobalISel] Register bank select for G_LOAD. Select i64 load

Select gprb or fprb when loaded value is used by either:
 copy to physical register or
 instruction with only one mapping available for that use operand.

Load of integer s64 is handled with narrowScalar when mapping is applied,
produced artifacts are combined away. Manually set gprb to all register
operands of instructions created during narrowScalar.

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

llvm-svn: 365323

5 years ago[MIPS GlobalISel] Register bank select for G_STORE. Select i64 store
Petar Avramovic [Mon, 8 Jul 2019 14:36:36 +0000 (14:36 +0000)]
[MIPS GlobalISel] Register bank select for G_STORE. Select i64 store

Select gprb or fprb when stored value is defined by either:
 copy from physical register or
 instruction with only one mapping available for that def operand.

Store of integer s64 is handled with narrowScalar when mapping is applied,
produced artifacts are combined away. Manually set gprb to all register
operands of instructions created during narrowScalar.

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

llvm-svn: 365322

5 years ago[AMDGPU][MC] Corrected parsing of FLAT offset modifier
Dmitry Preobrazhensky [Mon, 8 Jul 2019 14:27:37 +0000 (14:27 +0000)]
[AMDGPU][MC] Corrected parsing of FLAT offset modifier

Summary of changes:

- simplified handling of FLAT offset: offset_s13 and offset_u12 have been replaced with flat_offset;
- provided information about error position for pre-gfx9 targets;
- improved errors handling.

Reviewers: artem.tamazov, arsenm, rampitec

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

llvm-svn: 365321

5 years agoGlobalISel: widenScalar for G_BUILD_VECTOR
Matt Arsenault [Mon, 8 Jul 2019 13:48:06 +0000 (13:48 +0000)]
GlobalISel: widenScalar for G_BUILD_VECTOR

llvm-svn: 365320

5 years agoGlobalISel: Check address space when looking up iPTR size
Matt Arsenault [Mon, 8 Jul 2019 13:48:04 +0000 (13:48 +0000)]
GlobalISel: Check address space when looking up iPTR size

Fixes AMDGPU patterns for 32-bit address spaces always failing. Tests
will be included in future patches when additional issues are solved.

llvm-svn: 365319

5 years agoReapply [llvm-ar][test] Increase llvm-ar test coverage
Owen Reynolds [Mon, 8 Jul 2019 13:41:52 +0000 (13:41 +0000)]
Reapply [llvm-ar][test] Increase llvm-ar test coverage

This change adds tests to cover existing llvm-ar functionality.

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

llvm-svn: 365318

5 years agoRevert [llvm-ar][test] Increase llvm-ar test coverage
Owen Reynolds [Mon, 8 Jul 2019 13:08:25 +0000 (13:08 +0000)]
Revert [llvm-ar][test] Increase llvm-ar test coverage

Reverted due to test failures

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

llvm-svn: 365317

5 years ago[llvm-ar][test] Increase llvm-ar test coverage
Owen Reynolds [Mon, 8 Jul 2019 12:54:24 +0000 (12:54 +0000)]
[llvm-ar][test] Increase llvm-ar test coverage

This change adds tests to cover existing llvm-ar functionality.

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

llvm-svn: 365316

5 years ago[ASTImporter] Fix import of lambda in function param
Gabor Marton [Mon, 8 Jul 2019 12:49:13 +0000 (12:49 +0000)]
[ASTImporter] Fix import of lambda in function param

Summary:
The current import implementation fails to import the definition of a
lambda class if the lambda class is defined in a function param.
E.g., the lambda class below will be imported without any methods:
```
  template <typename F>
  void f(F L = [](){}) {}
```

Reviewers: a_sidorin, a.sidorin, shafik

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 365315

5 years ago[analyzer] Add analyzer option to limit the number of imported TUs
Endre Fulop [Mon, 8 Jul 2019 12:37:10 +0000 (12:37 +0000)]
[analyzer] Add analyzer option to limit the number of imported TUs

Summary:
During CTU analysis of complex projects, the loaded AST-contents of
imported TUs can grow bigger than available system memory. This option
introduces a threshold on the number of TUs to be imported for a single
TU in order to prevent such cases.

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

llvm-svn: 365314

5 years ago[lit] Parse command-line options from LIT_OPTS
Joel E. Denny [Mon, 8 Jul 2019 12:18:40 +0000 (12:18 +0000)]
[lit] Parse command-line options from LIT_OPTS

Similar to `FILECHECK_OPTS` for FileCheck, `LIT_OPTS` makes it easy to
adjust lit behavior when running the test suite via ninja.  For
example:

```
$ LIT_OPTS='--time-tests -vv --filter=threadprivate' \
  ninja check-clang-openmp
```

Reviewed By: probinson

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

llvm-svn: 365313

5 years ago[docs][llvm-objcopy] Add description of binary input/output to doc
James Henderson [Mon, 8 Jul 2019 11:41:54 +0000 (11:41 +0000)]
[docs][llvm-objcopy] Add description of binary input/output to doc

We briefly referred to being able to specify --target=binary without
explaining what binary input/output meant. This change adds a section on
this.

Reviewed by: MaskRay, abrachet

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

llvm-svn: 365312

5 years ago[clangd] Use xxhash instead of SHA1 for background index file digests.
Sam McCall [Mon, 8 Jul 2019 11:33:17 +0000 (11:33 +0000)]
[clangd] Use xxhash instead of SHA1 for background index file digests.

Summary:
Currently SHA1 is about 10% of our CPU, this patch reduces it to ~1%.

xxhash is a well-defined (stable) non-cryptographic hash optimized for
fast checksums (like crc32).
Collisions shouldn't be a problem, despite the reduced length:
 - for actual file content (used to invalidate bg index shards), there
   are only two versions that can collide (new shard and old shard).
 - for file paths in bg index shard filenames, we would need 2^32 files
   with the same filename to expect a collision. Imperfect hashing may
   reduce this a bit but it's well beyond what's plausible.

This will invalidate shards on disk (as usual; I bumped the version),
but this time the filenames are changing so the old files will stick
around :-( So this is more expensive than the usual bump, but would be
good to land before the v9 branch when everyone will start using bg index.

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 365311

5 years ago[lld] Use -o /dev/null in test when output is not needed.
Sam Clegg [Mon, 8 Jul 2019 11:14:10 +0000 (11:14 +0000)]
[lld] Use -o /dev/null in test when output is not needed.

Fix for feedback nit from rL364998

llvm-svn: 365310

5 years ago[TargetLowering] SimplifyDemandedBits - just call computeKnownBits for BUILD_VECTOR...
Simon Pilgrim [Mon, 8 Jul 2019 11:00:39 +0000 (11:00 +0000)]
[TargetLowering] SimplifyDemandedBits - just call computeKnownBits for BUILD_VECTOR cases.

Don't do this locally, computeKnownBits does this better (and can handle non-constant cases as well).

A next step would be to actually simplify non-constant elements - building on what we already do in SimplifyDemandedVectorElts.

llvm-svn: 365309

5 years ago[lld][WebAssembly] Fix __start/__stop symbols when combining input segments
Sam Clegg [Mon, 8 Jul 2019 10:35:08 +0000 (10:35 +0000)]
[lld][WebAssembly] Fix __start/__stop symbols when combining input segments

We should be generating one __start/__stop pair per output segment
not per input segment.  The test wasn't catching this because it was
only linking a single object file.

Fixes PR41565

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

llvm-svn: 365308

5 years ago[ubsan][test] Fix cast-overflow.cpp and delete float-divide-by-zero test after D63793...
Fangrui Song [Mon, 8 Jul 2019 09:47:04 +0000 (09:47 +0000)]
[ubsan][test] Fix cast-overflow.cpp and delete float-divide-by-zero test after D63793/rC365272

llvm-svn: 365307

5 years ago[ARM] Relax constraints on operands of VQxDMLxDH instructions
Mikhail Maltsev [Mon, 8 Jul 2019 09:44:52 +0000 (09:44 +0000)]
[ARM] Relax constraints on operands of VQxDMLxDH instructions

Summary:
According to a recently updated Armv8-M spec
(https://static.docs.arm.com/ddi0553/bh/DDI0553B_h_armv8m_arm.pdf) the
32-bit width versions of the following instructions:
* VQDMLADH
* VQDMLADHX
* VQRDMLADH
* VQRDMLADHX
* VQDMLSDH
* VQDMLSDHX
* VQRDMLSDH
* VQRDMLSDHX
are no longer unpredictable when their output register is the same as
one of the input registers.

This patch updates the assembler parser and the corresponding tests
and also removes @earlyclobber from the instruction constraints.

Reviewers: simon_tatham, ostannard, dmgreen, SjoerdMeijer, samparker

Reviewed By: simon_tatham

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 365306

5 years ago[RISCV] Specify registers used for exception handling
Alex Bradbury [Mon, 8 Jul 2019 09:38:06 +0000 (09:38 +0000)]
[RISCV] Specify registers used for exception handling

Implements the handling of __builtin_eh_return_regno().

Differential Revision: https://reviews.llvm.org/D63417
Patch by Edward Jones.

llvm-svn: 365305

5 years ago[lld][WebAssembly] Fix typo in error message
Sam Clegg [Mon, 8 Jul 2019 09:34:30 +0000 (09:34 +0000)]
[lld][WebAssembly] Fix typo in error message

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

llvm-svn: 365304

5 years ago[ubsan][test] Fix several UBSan-* :: TestCases/ImplicitConversion tests on Solaris
Rainer Orth [Mon, 8 Jul 2019 09:22:05 +0000 (09:22 +0000)]
[ubsan][test] Fix several UBSan-* :: TestCases/ImplicitConversion tests on Solaris

A couple of UBSan-*  :: TestCases/ImplicitConversion testcases FAIL on Solaris/x86
(and Solaris/SPARC with https://reviews.llvm.org/D40900):

  FAIL: UBSan-AddressSanitizer-i386 :: TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c (49187 of 49849)
  ******************** TEST 'UBSan-AddressSanitizer-i386 :: TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c' FAILED ********************
  [...]
  Command Output (stderr):
  --
  /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:53:11: error: CHECK: expected string not found in input
  // CHECK: {{.*}}signed-integer-truncation-or-sign-change-blacklist.c:[[@LINE-1]]:10: runtime error: implicit conversion from type '{{.*}}' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type '{{.*}}' (aka 'signed char') changed the value to -1 (8-bit, signed)
            ^
  <stdin>:1:1: note: scanning from here
  /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:52:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'char') changed the value to -1 (8-bit, signed)
  ^
  <stdin>:1:1: note: with "@LINE-1" equal to "52"
  /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:52:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'char') changed the value to -1 (8-bit, signed)
  ^
  <stdin>:1:69: note: possible intended match here
  /vol/llvm/src/compiler-rt/local/test/ubsan/TestCases/ImplicitConversion/signed-integer-truncation-or-sign-change-blacklist.c:52:10: runtime error: implicit conversion from type 'uint32_t' (aka 'unsigned int') of value 4294967295 (32-bit, unsigned) to type 'int8_t' (aka 'char') changed the value to -1 (8-bit, signed)
                                                                      ^

This is always a difference for int8_t where signed char is expected, but only
char seen.

I could trace this to <sys/int_types.h> which has

  /*
   * Basic / Extended integer types
   *
   * The following defines the basic fixed-size integer types.
   *
   * Implementations are free to typedef them to Standard C integer types or
   * extensions that they support. If an implementation does not support one
   * of the particular integer data types below, then it should not define the
   * typedefs and macros corresponding to that data type.  Note that int8_t
   * is not defined in -Xs mode on ISAs for which the ABI specifies "char"
   * as an unsigned entity because there is no way to define an eight bit
   * signed integral.
   */
  #if defined(_CHAR_IS_SIGNED)
  typedef char int8_t;
  #else
  #if defined(__STDC__)
  typedef signed char int8_t;
  #endif
  #endif

_CHAR_IS_SIGNED is always defined on both sparc and x86.  Since it seems ok
to have either form, I've changed the affected tests to use
'{{(signed )?}}char' instead of 'signed char'.

Tested on x86_64-pc-solaris2.11, sparcv9-sun-solaris2.11, and x86_64-pc-linux-gnu.

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

llvm-svn: 365303

5 years ago[ubsan][test] Don't disable ubsan testing on 64-bit Solaris/x86
Rainer Orth [Mon, 8 Jul 2019 09:18:38 +0000 (09:18 +0000)]
[ubsan][test] Don't disable ubsan testing on 64-bit Solaris/x86

Unlike asan, which isn't supported yet on 64-bit Solaris/x86, there's no reason to disable
ubsan.  This patch does that, but keeps the 64-bit ubsan-with-asan tests disabled.

Tested on x86_64-pc-solaris2.11.

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

llvm-svn: 365302

5 years ago[RISCV] Specify registers used in DWARF exception handling
Alex Bradbury [Mon, 8 Jul 2019 09:16:47 +0000 (09:16 +0000)]
[RISCV] Specify registers used in DWARF exception handling

Defines RISCV registers for getExceptionPointerRegister() and
getExceptionSelectorRegister().

Differential Revision: https://reviews.llvm.org/D63411
Patch by Edward Jones.
Modified by Alex Bradbury to add CHECK lines to exception-pointer-register.ll.

llvm-svn: 365301

5 years ago[AArch64] Fix scalar vuqadd intrinsics operands
Diogo N. Sampaio [Mon, 8 Jul 2019 08:47:47 +0000 (08:47 +0000)]
[AArch64] Fix scalar vuqadd intrinsics operands

Summary:
Change the vuqadd scalar instrinsics to have the second argument as unsigned values, not signed,
accordingly to https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics

So now the compiler correctly warns that a undefined negative float conversion is being done.

Reviewers: LukeCheeseman, john.brawn

Reviewed By: john.brawn

Subscribers: john.brawn, javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

llvm-svn: 365300

5 years ago[ARM] Fix null pointer dereference in CodeGen/ARM/Windows/stack-protector-msvc.ll...
Fangrui Song [Mon, 8 Jul 2019 08:43:31 +0000 (08:43 +0000)]
[ARM] Fix null pointer dereference in CodeGen/ARM/Windows/stack-protector-msvc.ll.test after D64292/r365283

CLI.CS may not be set.

llvm-svn: 365299

5 years ago[AArch64] Fix vsqadd scalar intrinsics operands
Diogo N. Sampaio [Mon, 8 Jul 2019 08:35:05 +0000 (08:35 +0000)]
[AArch64] Fix vsqadd scalar intrinsics operands

Summary:
Change the vsqadd scalar instrinsics to have the second argument as signed values, not unsigned,
accordingly to https://developer.arm.com/architectures/instruction-sets/simd-isas/neon/intrinsics

The existing unsigned argument can cause faulty code as negative float to unsigned conversion is
undefined, which llvm/clang optimizes away.

Reviewers: LukeCheeseman, john.brawn

Reviewed By: john.brawn

Subscribers: john.brawn, javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

llvm-svn: 365298

5 years ago[UpdateTestChecks] Skip over .Lfunc_begin for RISC-V
Alex Bradbury [Mon, 8 Jul 2019 08:34:16 +0000 (08:34 +0000)]
[UpdateTestChecks] Skip over .Lfunc_begin for RISC-V

This mirrors the change made for X86 in rL336987. Without this patch,
update_llc_test_checks will completely skip functions with personality
functions.

llvm-svn: 365297

5 years ago[WebAssembly] Add static_assert(sizeof(SymbolUnion) <= 96)
Fangrui Song [Mon, 8 Jul 2019 07:30:07 +0000 (07:30 +0000)]
[WebAssembly] Add static_assert(sizeof(SymbolUnion) <= 96)

On Windows, the bitfield layout rule places `ussigned Referenced : 1` at
byte offset 40, instead of byte offset 37 on *NIX. The consequence is that
sizeof(SymbolUnion) == 104 on Windows while 96 on *NIX.

To eliminate this difference, change these unsigned bitfields to bool.

Reviewed By: ruiu

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

llvm-svn: 365296

5 years agoChange LaunchThread interface to return an Expected for non-Apple-non-Windows
Fangrui Song [Mon, 8 Jul 2019 07:07:05 +0000 (07:07 +0000)]
Change LaunchThread interface to return an Expected for non-Apple-non-Windows

Fixes Linux build errors after D64163/r365226

llvm-svn: 365295

5 years ago[AMDGPU] Use a named predicate instead of a magic number.
Jay Foad [Mon, 8 Jul 2019 07:04:58 +0000 (07:04 +0000)]
[AMDGPU] Use a named predicate instead of a magic number.

Reviewers: arsenm

Reviewed By: arsenm

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

Tags: #llvm

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

llvm-svn: 365294

5 years ago[X86] Allow execution domain fixing to turn SHUFPD into SHUFPS.
Craig Topper [Mon, 8 Jul 2019 06:52:49 +0000 (06:52 +0000)]
[X86] Allow execution domain fixing to turn SHUFPD into SHUFPS.

This can help with code size on SSE targets where SHUFPD requires
a 0x66 prefix and SHUFPS doesn't.

llvm-svn: 365293

5 years ago[X86] Make movsd commutable to shufpd with a 0x02 immediate on pre-SSE4.1 targets.
Craig Topper [Mon, 8 Jul 2019 06:52:43 +0000 (06:52 +0000)]
[X86] Make movsd commutable to shufpd with a 0x02 immediate on pre-SSE4.1 targets.

This can help avoid a copy or enable load folding.

On SSE4.1 targets we can commute it to blendi instead.

I had to make shufpd with a 0x02 immediate commutable as well
since we expect commuting to be reversible.

llvm-svn: 365292

5 years ago[RISCV] Support z and i operand modifiers
Alex Bradbury [Mon, 8 Jul 2019 05:00:26 +0000 (05:00 +0000)]
[RISCV] Support z and i operand modifiers

Differential Revision: https://reviews.llvm.org/D57792
Patch by James Clarke.

llvm-svn: 365291

5 years agoMake forward_list::remove/remove_if/unique all return void before C++20; undoes that...
Marshall Clow [Mon, 8 Jul 2019 03:45:28 +0000 (03:45 +0000)]
Make forward_list::remove/remove_if/unique all return void before C++20; undoes that bit of D58332. Thanks to Mikhail Maltsev for pointing this out

llvm-svn: 365290

5 years ago[clangd] Avoid slow ostreams in URI conversion.
Sam McCall [Mon, 8 Jul 2019 02:46:21 +0000 (02:46 +0000)]
[clangd] Avoid slow ostreams in URI conversion.

This speeds up some hot paths significantly (e.g.  dex::generateProximityURIs
by a third or so)

llvm-svn: 365289

5 years ago[clangd] Encapsulate fields in dex token. NFC
Sam McCall [Mon, 8 Jul 2019 02:37:06 +0000 (02:37 +0000)]
[clangd] Encapsulate fields in dex token. NFC

llvm-svn: 365288

5 years ago[X86] Add MOVSDrr->MOVLPDrm entry to load folding table. Add custom handling to turn...
Craig Topper [Mon, 8 Jul 2019 02:10:20 +0000 (02:10 +0000)]
[X86] Add MOVSDrr->MOVLPDrm entry to load folding table. Add custom handling to turn UNPCKLPDrr->MOVHPDrm when load is under aligned.

If the load is aligned we can turn UNPCKLPDrr into UNPCKLPDrm.

llvm-svn: 365287

5 years ago[llvm-bcanalyzer] Refactor and move to libLLVMBitReader
Francis Visoiu Mistrih [Mon, 8 Jul 2019 02:06:34 +0000 (02:06 +0000)]
[llvm-bcanalyzer] Refactor and move to libLLVMBitReader

This allows us to use the analyzer from unit tests.

* Refactor the interface to use proper error handling for most functions
  after JF's work.
* Move everything into a BitstreamAnalyzer class.
* Move that to Bitcode/BitcodeAnalyzer.h.

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

llvm-svn: 365286

5 years ago[NFC][PowerPC] Add the test add_cmp.ll
Kang Zhang [Mon, 8 Jul 2019 01:51:29 +0000 (01:51 +0000)]
[NFC][PowerPC] Add the test add_cmp.ll

llvm-svn: 365285

5 years agoRevert "[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS"
Petr Hosek [Sun, 7 Jul 2019 22:12:01 +0000 (22:12 +0000)]
Revert "[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS"

This reverts commit r365260 which broke the following tests:

    Clang :: CodeGenCXX/cfi-mfcall.cpp
    Clang :: CodeGenObjC/ubsan-nullability.m
    LLVM :: Transforms/LoopVectorize/AArch64/pr36032.ll

llvm-svn: 365284

5 years ago[ARM] Add support for MSVC stack cookie checking
Martin Storsjo [Sun, 7 Jul 2019 18:57:31 +0000 (18:57 +0000)]
[ARM] Add support for MSVC stack cookie checking

Heavily based on the same for AArch64, from SVN r346469.

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

llvm-svn: 365283

5 years agoProcess: generalise Windows thread setup
Saleem Abdulrasool [Sun, 7 Jul 2019 17:58:11 +0000 (17:58 +0000)]
Process: generalise Windows thread setup

The Windows build currently cannot support debugging foreign targets or
debugging Windows ARM NT and Windows ARM64 targets.  Do not assume a
x64/x86 host.  This enables building lldb for Windows ARM64.

llvm-svn: 365282

5 years agoMake ~mutex and ~condition_variable trivial on Windows.
Eric Fiselier [Sun, 7 Jul 2019 17:24:03 +0000 (17:24 +0000)]
Make ~mutex and ~condition_variable trivial on Windows.

The implementations of __libcpp_mutex_destroy and __libcpp_condvar_destroy
are already NOPs, so this optimization is safe to perform.

See r365273 and PR27658 for more information.

llvm-svn: 365281

5 years agogn build: Merge r355546
Nico Weber [Sun, 7 Jul 2019 16:49:44 +0000 (16:49 +0000)]
gn build: Merge r355546

Found by inspection; the sync script doesn't sync .ipp files.

llvm-svn: 365280

5 years agogn build: Merge r365273
Nico Weber [Sun, 7 Jul 2019 16:44:07 +0000 (16:44 +0000)]
gn build: Merge r365273

llvm-svn: 365279

5 years agogn build: Sort sync script output
Nico Weber [Sun, 7 Jul 2019 16:40:29 +0000 (16:40 +0000)]
gn build: Sort sync script output

llvm-svn: 365278

5 years agogn build: Sort cxx_sources in libcxx build file
Nico Weber [Sun, 7 Jul 2019 16:36:11 +0000 (16:36 +0000)]
gn build: Sort cxx_sources in libcxx build file

Since these are in a custom list, `gn format` doesn't automatically sort
them.

Now their order matches the CMake build.

No additions or deletions, this just sorts the files that are there.

llvm-svn: 365277

5 years agogn build: Merge r365258 and follow-ups r365263, r365264
Nico Weber [Sun, 7 Jul 2019 15:43:32 +0000 (15:43 +0000)]
gn build: Merge r365258 and follow-ups r365263, r365264

llvm-svn: 365276

5 years ago[X86] Make sure load isn't volatile before shrinking it in MOVDDUP isel patterns.
Craig Topper [Sun, 7 Jul 2019 05:33:20 +0000 (05:33 +0000)]
[X86] Make sure load isn't volatile before shrinking it in MOVDDUP isel patterns.

llvm-svn: 365275

5 years ago[CodeGen] Add larger vector types for i32 and f32
David Majnemer [Sun, 7 Jul 2019 04:47:37 +0000 (04:47 +0000)]
[CodeGen] Add larger vector types for i32 and f32

Some out of tree backend require larger vector type. Since maintaining the changes out of tree is difficult due to the many manual changes needed when adding a new type we are adding it even if no backend currently use it.

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

Patch by Thomas Raoux!

llvm-svn: 365274

5 years agoFix PR27658 - Make ~mutex trivial when possible.
Eric Fiselier [Sun, 7 Jul 2019 01:20:54 +0000 (01:20 +0000)]
Fix PR27658 - Make ~mutex trivial when possible.

Currently std::mutex has a constexpr constructor, but a non-trivial
destruction.

The constexpr constructor is required to ensure the construction of a
mutex with static storage duration happens at compile time, during
constant initialization, and not during dynamic initialization.
This means that static mutex's are always initialized and can be used
safely during dynamic initialization without the "static initialization
order fiasco".

A trivial destructor is important for similar reasons. If a mutex is
used during dynamic initialization it might also be used during program
termination. If a static mutex has a non-trivial destructor it will be
invoked during termination. This can introduce the "static
deinitialization order fiasco".

Additionally, function-local statics emit a guard variable around
non-trivially destructible types. This results in horrible codegen and
adds a runtime cost to every call to that function. non-local static's
also result in slightly worse codegen but it's not as big of a problem.

Example codegen can be found here: https://goo.gl/3CSzbM

Note: This optimization is not safe with every pthread implementation.
Some implementations allocate on the first call to pthread_mutex_lock
and free the allocation in pthread_mutex_destroy.

Also, changing the triviality of the destructor is not an ABI break.
At least to the best of my knowledge :-)

llvm-svn: 365273

5 years agoTreat the range of representable values of floating-point types as [-inf, +inf] not...
Richard Smith [Sat, 6 Jul 2019 21:05:52 +0000 (21:05 +0000)]
Treat the range of representable values of floating-point types as [-inf, +inf] not as [-max, +max].

Summary:
Prior to r329065, we used [-max, max] as the range of representable
values because LLVM's `fptrunc` did not guarantee defined behavior when
truncating from a larger floating-point type to a smaller one. Now that
has been fixed, we can make clang follow normal IEEE 754 semantics in this
regard and take the larger range [-inf, +inf] as the range of representable
values.

In practice, this affects two parts of the frontend:
 * the constant evaluator no longer treats floating-point evaluations
   that result in +-inf as being undefined (because they no longer leave
   the range of representable values of the type)
 * UBSan no longer treats conversions to floating-point type that are
   outside the [-max, +max] range as being undefined

In passing, also remove the float-divide-by-zero sanitizer from
-fsanitize=undefined, on the basis that while it's undefined per C++
rules (and we disallow it in constant expressions for that reason), it
is defined by Clang / LLVM / IEEE 754.

Reviewers: rnk, BillyONeal

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 365272

5 years ago[X86] SimplifyDemandedVectorEltsForTargetNode - fix shadow variable warning. NFCI.
Simon Pilgrim [Sat, 6 Jul 2019 18:46:09 +0000 (18:46 +0000)]
[X86] SimplifyDemandedVectorEltsForTargetNode - fix shadow variable warning. NFCI.

Fixes cppcheck warning.

llvm-svn: 365271

5 years ago[X86] LowerBuildVectorv16i8 - pull out repeated getOperand() call. NFCI.
Simon Pilgrim [Sat, 6 Jul 2019 18:33:29 +0000 (18:33 +0000)]
[X86] LowerBuildVectorv16i8 - pull out repeated getOperand() call. NFCI.

llvm-svn: 365270

5 years ago[DAGCombine] convertBuildVecZextToZext - remove duplicate getOpcode() call. NFCI.
Simon Pilgrim [Sat, 6 Jul 2019 18:32:15 +0000 (18:32 +0000)]
[DAGCombine] convertBuildVecZextToZext - remove duplicate getOpcode() call. NFCI.

llvm-svn: 365269

5 years ago[X86] Add PS<->PD domain changing support for MOVH/MOVL load instructions and MOVH...
Craig Topper [Sat, 6 Jul 2019 17:59:57 +0000 (17:59 +0000)]
[X86] Add PS<->PD domain changing support for MOVH/MOVL load instructions and MOVH store instructions.

These instructions don't have an integer domain equivalent, but
we can at least change between the two floating point domains.

This allows a smaller encoding on SSE targets if we can turn
PD into PS.

llvm-svn: 365268

5 years ago[X86] Remove patterns from MOVLPSmr and MOVHPSmr instructions.
Craig Topper [Sat, 6 Jul 2019 17:59:51 +0000 (17:59 +0000)]
[X86] Remove patterns from MOVLPSmr and MOVHPSmr instructions.

These patterns are the same as the MOVLPDmr and MOVHPDmr patterns,
but with a bitcast at the end. We can just select the PD instruction
and let execution domain fixing switch to PS.

llvm-svn: 365267

5 years ago[X86] Add patterns to select MOVLPDrm from MOVSD+load and MOVHPD from UNPCKL+load.
Craig Topper [Sat, 6 Jul 2019 17:59:45 +0000 (17:59 +0000)]
[X86] Add patterns to select MOVLPDrm from MOVSD+load and MOVHPD from UNPCKL+load.

These narrow the load so we can only do it if the load isn't
volatile.

There also tests in vector-shuffle-128-v4.ll that this should
support, but we don't seem to fold bitcast+load on pre-sse4.2
targets due to the slow unaligned mem 16 flag.

llvm-svn: 365266

5 years ago[X86] Copy some test cases from vector-shuffle-sse1.ll to vector-shuffle-128-v4.ll...
Craig Topper [Sat, 6 Jul 2019 17:59:41 +0000 (17:59 +0000)]
[X86] Copy some test cases from vector-shuffle-sse1.ll to vector-shuffle-128-v4.ll and v8 where sse1 did better load folding. NFC

llvm-svn: 365265

5 years ago[Rewrite] Try to fix buildbot link fail left by r365263
Joel E. Denny [Sat, 6 Jul 2019 16:28:32 +0000 (16:28 +0000)]
[Rewrite] Try to fix buildbot link fail left by r365263

http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/10272

llvm-svn: 365264

5 years ago[Rewrite] Try to fix buildbot link fail caused by r365258
Joel E. Denny [Sat, 6 Jul 2019 13:44:57 +0000 (13:44 +0000)]
[Rewrite] Try to fix buildbot link fail caused by r365258

http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/10270

llvm-svn: 365263

5 years ago[LFTR] Regenerate test checks; NFC
Nikita Popov [Sat, 6 Jul 2019 08:54:15 +0000 (08:54 +0000)]
[LFTR] Regenerate test checks; NFC

llvm-svn: 365262

5 years agoMake list::remove/remove_if/unique all return void before C++20; undoes that bit...
Marshall Clow [Sat, 6 Jul 2019 06:10:03 +0000 (06:10 +0000)]
Make list::remove/remove_if/unique all return void before C++20; undoes that bit of D58332. Thanks to Mikhail Maltsev for pointing this out

llvm-svn: 365261

5 years ago[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS
Philip Reames [Sat, 6 Jul 2019 04:28:00 +0000 (04:28 +0000)]
[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS

Without this, we have the unfortunate property that tests are dependent on the order of operads passed the CreateOr and CreateAnd functions.  In actual usage, we'd promptly optimize them away, but it made tests slightly more verbose than they should have been.

llvm-svn: 365260

5 years ago[IRBuilder] Introduce helpers for and/or of multiple values at once
Philip Reames [Sat, 6 Jul 2019 03:46:18 +0000 (03:46 +0000)]
[IRBuilder] Introduce helpers for and/or of multiple values at once

We had versions of this code scattered around, so consolidate into one location.

Not strictly NFC since the order of intermediate results may change in some places, but since these operations are associatives, should not change results.

llvm-svn: 365259

5 years ago[Rewrite] Extend to further accept CharSourceRange
Joel E. Denny [Sat, 6 Jul 2019 02:55:06 +0000 (02:55 +0000)]
[Rewrite] Extend to further accept CharSourceRange

Some Rewrite functions are already overloaded to accept
CharSourceRange, and this extends others in the same manner.  I'm
calling these in code that's not ready to upstream, but I figure they
might be useful to others in the meantime.

Reviewed By: jdoerfert

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

llvm-svn: 365258

5 years ago[TSan] Attempt to fix iOS on-device test
Julian Lettner [Sat, 6 Jul 2019 00:49:44 +0000 (00:49 +0000)]
[TSan] Attempt to fix iOS on-device test

llvm-svn: 365257

5 years ago[RegisterCoalescer] Fix an overzealous assert
Quentin Colombet [Sat, 6 Jul 2019 00:34:54 +0000 (00:34 +0000)]
[RegisterCoalescer] Fix an overzealous assert

Although removeCopyByCommutingDef deals with full copies, it is still
possible to copy undef lanes and thus, we wouldn't have any a value
number for these lanes.

This fixes PR40215.

llvm-svn: 365256

5 years agoRegUsageInfoCollector: Skip AMDGPU entry point functions
Matt Arsenault [Fri, 5 Jul 2019 23:33:43 +0000 (23:33 +0000)]
RegUsageInfoCollector: Skip AMDGPU entry point functions

I'm not sure if it's worth it or not to add a hook to disable the pass
for an arbitrary function.

This pass is taking up to 5% of compile time in tiny programs by
iterating through all of the physical registers in every register
class. This pass should be rewritten in terms of regunits. For now,
skip doing anything for entry point functions. The vast majority of
functions in the real world aren't callable, so just not running this
will give the majority of the benefit.

llvm-svn: 365255

5 years agoXFAIL a few failing TSan-fiber tests for iOS
Julian Lettner [Fri, 5 Jul 2019 23:23:36 +0000 (23:23 +0000)]
XFAIL a few failing TSan-fiber tests for iOS

llvm-svn: 365254

5 years agoRemove `XFAIL: ios` from test that passes in CI
Julian Lettner [Fri, 5 Jul 2019 22:53:18 +0000 (22:53 +0000)]
Remove `XFAIL: ios` from test that passes in CI

llvm-svn: 365253

5 years agoRevert "[FileCheck] Simplify numeric variable interface"
Michael Liao [Fri, 5 Jul 2019 22:23:27 +0000 (22:23 +0000)]
Revert "[FileCheck] Simplify numeric variable interface"

This reverts commit 096600a4b073dd94a366cc8e57bff93c34ff6966.

llvm-svn: 365251

5 years ago[LLDBAssert] Use unreachable instead of assert(0)
Jonas Devlieghere [Fri, 5 Jul 2019 21:54:20 +0000 (21:54 +0000)]
[LLDBAssert] Use unreachable instead of assert(0)

As per Davide's suggestion offline.

llvm-svn: 365250

5 years ago[FileCheck] Simplify numeric variable interface
Thomas Preud'homme [Fri, 5 Jul 2019 21:49:59 +0000 (21:49 +0000)]
[FileCheck] Simplify numeric variable interface

Summary:
This patch simplifies 2 aspects in the FileCheckNumericVariable code.

First, setValue() method is turned into a void function since being
called only on undefined variable is an invariant and is now asserted
rather than returned. This remove the assert from the callers.

Second, clearValue() method is also turned into a void function since
the only caller does not check its return value since it may be trying
to clear the value of variable that is already cleared without this
being noteworthy.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 365249

5 years agoImprove MSVC visualization of annot_template_id tokens
Mike Spertus [Fri, 5 Jul 2019 21:41:30 +0000 (21:41 +0000)]
Improve MSVC visualization of annot_template_id tokens

Now shows the actual annotated template. E.g.,
{annot_template_id (A<int, double>)}

Also a few miscellaneous fixes to visualizers of other types

llvm-svn: 365248

5 years ago[lldb] Added assert to VerifyDecl
Raphael Isemann [Fri, 5 Jul 2019 21:32:39 +0000 (21:32 +0000)]
[lldb] Added assert to VerifyDecl

We could VerifyDecl sometimes with a nullptr. It would be nice if we
could get an actual assert here instead of triggering UB.

llvm-svn: 365247

5 years agolldb_assert: abort when assertions are enabled.
Jonas Devlieghere [Fri, 5 Jul 2019 21:22:54 +0000 (21:22 +0000)]
lldb_assert: abort when assertions are enabled.

We had a long discussion in D59911 about lldb_assert and what it means.
The result was the assert manifesto on lldb.llvm.org.

> LLDB provides lldb_assert() as a soft alternative to cover the middle
> ground of situations that indicate a recoverable bug in LLDB. In a
> Debug configuration lldb_assert() behaves like assert(). In a Release
> configuration it will print a warning and encourage the user to file a
> bug report, similar to LLVM’s crash handler, and then return
> execution.

However, currently lldb_assert doesn't behave they way it's being
described there: it doesn't abort in a debug/assert build. This patch
fixes that by adding a call to assert() in lldb_assert().

Differential revision: https://reviews.llvm.org/D64267#1571962

llvm-svn: 365246

5 years agoAMDGPU: Fix assert in clang test
Matt Arsenault [Fri, 5 Jul 2019 21:09:53 +0000 (21:09 +0000)]
AMDGPU: Fix assert in clang test

llvm-svn: 365245

5 years agoRevert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.4"
Julian Lettner [Fri, 5 Jul 2019 21:03:46 +0000 (21:03 +0000)]
Revert "[TSan] Improve handling of stack pointer mangling in {set,long}jmp, pt.4"

This reverts commit 6bb13da7c16f2a677cc285bb6ffeb79dfb0cfe64.

llvm-svn: 365244

5 years ago[CplusPlus] ISVTableName is unused. NFCI.
Davide Italiano [Fri, 5 Jul 2019 20:45:57 +0000 (20:45 +0000)]
[CplusPlus] ISVTableName is unused. NFCI.

Reviewers: teemperor, JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 365243

5 years ago[SystemZ] Fix addcarry of usubo (PR42512)
Nikita Popov [Fri, 5 Jul 2019 20:35:11 +0000 (20:35 +0000)]
[SystemZ] Fix addcarry of usubo (PR42512)

Only custom lower uaddo+addcarry or usubo+subcarry chains and leave
mixtures like usubo+addcarry or uaddo+subcarry to the generic
legalizer. Otherwise we run into issues because SystemZ uses
different CC values for carries and borrows.

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

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

llvm-svn: 365242

5 years agoAMDGPU: Make AMDGPUPerfHintAnalysis an SCC pass
Matt Arsenault [Fri, 5 Jul 2019 20:26:13 +0000 (20:26 +0000)]
AMDGPU: Make AMDGPUPerfHintAnalysis an SCC pass

Add a string attribute instead of directly setting
MachineFunctionInfo. This avoids trying to get the analysis in the
MachineFunctionInfo in a way that doesn't work with the new pass
manager.

This will also avoid re-visiting the call graph for every single
function.

llvm-svn: 365241