platform/upstream/llvm.git
5 years agoWhen building a header module, treat inputs as headers rather than
Richard Smith [Fri, 2 Nov 2018 00:24:40 +0000 (00:24 +0000)]
When building a header module, treat inputs as headers rather than
source files.

This suppresses certain warnings (eg, '#include_next in main source
file').

llvm-svn: 345915

5 years ago[NFC][LICM] Factor out instruction erasing logic
Max Kazantsev [Fri, 2 Nov 2018 00:21:45 +0000 (00:21 +0000)]
[NFC][LICM] Factor out instruction erasing logic

This patch factors out a function that makes all required updates
whenever an instruction gets erased.

Differential Revision: https://reviews.llvm.org/D54011
Reviewed By: apilipenko

llvm-svn: 345914

5 years ago[WebAssembly] Expand inserts and extracts with variable indices
Thomas Lively [Fri, 2 Nov 2018 00:06:56 +0000 (00:06 +0000)]
[WebAssembly] Expand inserts and extracts with variable indices

Reviewers: aheejin, dschuff

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

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

llvm-svn: 345913

5 years agoWhen no FileCheck binary is specified, look in the llvm/clang bin
Jason Molenda [Thu, 1 Nov 2018 23:41:05 +0000 (23:41 +0000)]
When no FileCheck binary is specified, look in the llvm/clang bin
dirs relative to the source directory (Xcode build style) to find
one, use it if found.

llvm-svn: 345912

5 years ago[AliasSetTracker] Misc cleanup (NFCI)
Alina Sbirlea [Thu, 1 Nov 2018 23:37:51 +0000 (23:37 +0000)]
[AliasSetTracker] Misc cleanup (NFCI)

Summary: Remove two redundant checks, add one in the unit test. Remove an unused method. Fix computation of TotalMayAliasSetSize.
llvm-svn: 345911

5 years ago[gold-plugin] Fix a bunch of build warnings
Mandeep Singh Grang [Thu, 1 Nov 2018 23:34:12 +0000 (23:34 +0000)]
[gold-plugin] Fix a bunch of build warnings

Phabricator: https://reviews.llvm.org/D53997
llvm-svn: 345910

5 years ago[COFF, ARM64] Implement Intrinsic.sponentry for AArch64
Mandeep Singh Grang [Thu, 1 Nov 2018 23:22:25 +0000 (23:22 +0000)]
[COFF, ARM64] Implement Intrinsic.sponentry for AArch64

Summary: This patch adds Intrinsic.sponentry. This intrinsic is required to correctly support setjmp for AArch64 Windows platform.

Patch by: Yin Ma (yinma@codeaurora.org)

Reviewers: mgrang, ssijaric, eli.friedman, TomTan, mstorsjo, rnk, compnerd, efriedma

Reviewed By: efriedma

Subscribers: efriedma, javed.absar, kristof.beyls, chrib, llvm-commits

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

llvm-svn: 345909

5 years ago[DAGCombiner] Make the isTruncateOf call from visitZERO_EXTEND work for vectors....
Craig Topper [Thu, 1 Nov 2018 23:21:45 +0000 (23:21 +0000)]
[DAGCombiner] Make the isTruncateOf call from visitZERO_EXTEND work for vectors. Remove FIXME.

I'm having trouble creating a test case for the ISD::TRUNCATE part of this that shows any codegen differences. But I was able to test the setcc path which is what the test changes here cover.

llvm-svn: 345908

5 years ago[X86] Add test cases for adding vector support to isTruncateOf in DAGCombiner::visitZ...
Craig Topper [Thu, 1 Nov 2018 23:21:42 +0000 (23:21 +0000)]
[X86] Add test cases for adding vector support to isTruncateOf in DAGCombiner::visitZERO_EXTEND

llvm-svn: 345907

5 years ago[MachineOutliner][NFC] Remember when you map something illegal across MBBs
Jessica Paquette [Thu, 1 Nov 2018 23:09:06 +0000 (23:09 +0000)]
[MachineOutliner][NFC] Remember when you map something illegal across MBBs

Instruction mapping in the outliner uses "illegal numbers" to signify that
something can't ever be part of an outlining candidate. This means that the
number is unique and can't be part of any repeated substring.

Because each of these is unique, we can use a single unique number to represent
a range of things we can't outline.

The outliner tries to leverage this using a flag which is set in an MBB when
the previous instruction we tried to map was "illegal". This patch improves
that logic to work across MBBs. As a bonus, this also simplifies the mapping
logic somewhat.

This also updates the machine-outliner-remarks test, which was impacted by the
order of Candidates on an OutlinedFunction changing. This order isn't
guaranteed, so I added a FIXME to fix that in a follow-up. The order of
Candidates on an OutlinedFunction isn't important, so this still is NFC.

llvm-svn: 345906

5 years ago[XRay] Fix TSC and atomic custom/typed event accounting
Dean Michael Berris [Thu, 1 Nov 2018 22:57:50 +0000 (22:57 +0000)]
[XRay] Fix TSC and atomic custom/typed event accounting

Summary:
This is a follow-on change to D53858 which turns out to have had a TSC
accounting bug when writing out function exit records in FDR mode.

This change adds a number of tests to ensure that:

- We are handling the delta between the exit TSC and the last TSC we've
  seen.

- We are writing the custom event and typed event records as a single
  update to the buffer extents.

- We are able to catch boundary conditions when loading FDR logs.

We introduce a TSC matcher to the test helpers, which we use in the
testing/verification of the TSC accounting change.

Reviewers: mboerger

Subscribers: mgorny, hiraditya, jfb, llvm-commits

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

llvm-svn: 345905

5 years ago[IR] remove fake binop query for fneg
Sanjay Patel [Thu, 1 Nov 2018 22:56:15 +0000 (22:56 +0000)]
[IR] remove fake binop query for fneg

We want to remove this fneg API because it would silently fail
if we add an actual fneg instruction to IR (as proposed in
D53877 ).

We have a newer 'match' API that makes checking for
these patterns simpler. It also works with vectors
that may include undef elements in constants.

If any out-of-tree users need updating, they can model
their code changes on this commit:
https://reviews.llvm.org/rL345295

llvm-svn: 345904

5 years ago[CodeGen] Fix assertion on referencing constexpr Obj-C object with ARC.
Volodymyr Sapsai [Thu, 1 Nov 2018 22:50:08 +0000 (22:50 +0000)]
[CodeGen] Fix assertion on referencing constexpr Obj-C object with ARC.

Failed assertion is
> Assertion failed: ((ND->isUsed(false) || !isa<VarDecl>(ND) || !E->getLocation().isValid()) && "Should not use decl without marking it used!"), function EmitDeclRefLValue, file llvm-project/clang/lib/CodeGen/CGExpr.cpp, line 2437.

`EmitDeclRefLValue` mentions
> // A DeclRefExpr for a reference initialized by a constant expression can
> // appear without being odr-used. Directly emit the constant initializer.

The fix is to use the similar approach for non-references as for references. It
is achieved by trying to emit a constant before we attempt to load non-odr-used
variable as LValue.

rdar://problem/40650504

Reviewers: ahatanak, rjmccall

Reviewed By: rjmccall

Subscribers: dexonsmith, erik.pilkington, cfe-commits

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

llvm-svn: 345903

5 years ago[AMDGPU] Handle the idot8 pattern generated by FE.
Farhana Aleen [Thu, 1 Nov 2018 22:48:19 +0000 (22:48 +0000)]
[AMDGPU] Handle the idot8 pattern generated by FE.

Summary: Different variants of idot8 codegen dag patterns are not generated by llvm-tablegen due to a huge
         increase in the compile time. Support the pattern that clang FE generates after reordering the
         additions in integer-dot8 source language pattern.

Author: FarhanaAleen

Reviewed By: arsenm

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

llvm-svn: 345902

5 years ago[File] Remove static method to get permissions.
Jonas Devlieghere [Thu, 1 Nov 2018 22:46:49 +0000 (22:46 +0000)]
[File] Remove static method to get permissions.

This patch removes the static accessor in File to get a file's
permissions. Permissions should be checked through the FileSystem class.

llvm-svn: 345901

5 years agoFix test assumption that Linux implies glibc.
Dan Albert [Thu, 1 Nov 2018 22:35:51 +0000 (22:35 +0000)]
Fix test assumption that Linux implies glibc.

Summary:
This fixes an regression when using bionic introduced in r345173.

I need to follow up and figure out what exactly is implied by
TEST_HAS_C11_FEATURES and see what the correct configuration is for
bionic (new versions should have everything the tests care about,
versions that predate C11 certainly don't), but this gets the tests
back to the old behavior.

Reviewers: EricWF

Reviewed By: EricWF

Subscribers: mclow.lists, christof, ldionne, libcxx-commits, cfe-commits

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

llvm-svn: 345900

5 years ago[ELF] Change sh_link of .rel{,a}.plt to make GNU strip happy
Fangrui Song [Thu, 1 Nov 2018 22:28:58 +0000 (22:28 +0000)]
[ELF] Change sh_link of .rel{,a}.plt to make GNU strip happy

Summary:
D52830 sets sh_link to .symtab in static link, which breaks executable stripped by GNU strip.
It may also be odd that .rela.plt (SHF_ALLOC) points to .symtab (non-SHF_ALLOC).

Change the logic on pcc's suggestion.

Before:

% clang -fuse-ld=lld -static -xc =(printf 'int main(){}') # or gcc
% strip a.out; ./a.out
unexpected reloc type in static binary[1]    61634 segmentation fault  ./a.out

Reviewers: ruiu, grimar, emaste, espindola

Reviewed By: ruiu

Subscribers: pcc, arichardson, llvm-commits

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

llvm-svn: 345899

5 years ago[FileSystem] Update SetFile signature.
Jonas Devlieghere [Thu, 1 Nov 2018 22:16:34 +0000 (22:16 +0000)]
[FileSystem] Update SetFile signature.

llvm-svn: 345898

5 years ago[CodeGen] Move `emitConstant` from ScalarExprEmitter to CodeGenFunction. NFC.
Volodymyr Sapsai [Thu, 1 Nov 2018 21:57:05 +0000 (21:57 +0000)]
[CodeGen] Move `emitConstant` from ScalarExprEmitter to CodeGenFunction. NFC.

The goal is to use `emitConstant` in more places. Didn't move
`ComplexExprEmitter::emitConstant` because it returns a different type.

Reviewers: rjmccall, ahatanak

Reviewed By: rjmccall

Subscribers: dexonsmith, erik.pilkington, cfe-commits

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

llvm-svn: 345897

5 years ago[llvm-objcopy/strip] [NFC] Clean up tablegen opts (clang-format + reorganizing things).
Jordan Rupprecht [Thu, 1 Nov 2018 21:38:14 +0000 (21:38 +0000)]
[llvm-objcopy/strip] [NFC] Clean up tablegen opts (clang-format + reorganizing things).

llvm-svn: 345896

5 years ago[FileSystem] Change FileSpec constructor signature (2/2)
Jonas Devlieghere [Thu, 1 Nov 2018 21:26:58 +0000 (21:26 +0000)]
[FileSystem] Change FileSpec constructor signature (2/2)

Fix breakage due to the recent FileSpec change that extracts the path
resultion logic into FileSystem for the FreeBSD host.

llvm-svn: 345895

5 years agoSilence -Wimplicit-fallthrough in gold plugin
Reid Kleckner [Thu, 1 Nov 2018 21:24:33 +0000 (21:24 +0000)]
Silence -Wimplicit-fallthrough in gold plugin

Fatal errors are likely fatal, but in case they aren't, return instead
of printing a second warning.

llvm-svn: 345894

5 years agoRevert "Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using...
Louis Dionne [Thu, 1 Nov 2018 21:24:32 +0000 (21:24 +0000)]
Revert "Bug 39129: Speeding up partition_point/lower_bound/upper_bound/ by using unsigned division by 2 when possible."

This reverts r345525. I'm reverting because that patch apparently caused
a regression on certain platforms (see https://reviews.llvm.org/D53994).
Since we don't fully understand the reasons for the regression, I'm
reverting until we can provide a fix we understand.

llvm-svn: 345893

5 years ago[COFF, ARM64] Implement llvm.addressofreturnaddress intrinsic
Mandeep Singh Grang [Thu, 1 Nov 2018 21:23:47 +0000 (21:23 +0000)]
[COFF, ARM64] Implement llvm.addressofreturnaddress intrinsic

Reviewers: rnk, mstorsjo, efriedma, TomTan

Reviewed By: efriedma

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

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

llvm-svn: 345892

5 years ago[FileSystem] Change FileSpec constructor signature.
Jonas Devlieghere [Thu, 1 Nov 2018 21:18:25 +0000 (21:18 +0000)]
[FileSystem] Change FileSpec constructor signature.

Fix breakage due to the recent FileSpec change that extracts the path
resultion logic into FileSystem for the Android host.

llvm-svn: 345891

5 years ago[FileSystem] Move path resolution logic out of FileSpec
Jonas Devlieghere [Thu, 1 Nov 2018 21:05:36 +0000 (21:05 +0000)]
[FileSystem] Move path resolution logic out of FileSpec

This patch removes the logic for resolving paths out of FileSpec and
updates call sites to rely on the FileSystem class instead.

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

llvm-svn: 345890

5 years ago[CMake][Fuchsia] Don't restrict Linux runtimes to UNIX
Petr Hosek [Thu, 1 Nov 2018 20:36:33 +0000 (20:36 +0000)]
[CMake][Fuchsia] Don't restrict Linux runtimes to UNIX

This allows building Linux runtimes on any platform if the correct
sysroot is provided via CMake option.

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

llvm-svn: 345889

5 years ago[WebAssembly] Fix signature parsing for 'try' in AsmParser
Heejin Ahn [Thu, 1 Nov 2018 20:32:15 +0000 (20:32 +0000)]
[WebAssembly] Fix signature parsing for 'try' in AsmParser

Summary:
Like `block` or `loop`, `try` can take an optional signature which can
be omitted. This patch allows `try`'s signature to be omitted. Also
added some tests for EH instructions.

Reviewers: aardappel

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

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

llvm-svn: 345888

5 years agoEnable -Wimplicit-fallthrough for clang as well as GCC
Reid Kleckner [Thu, 1 Nov 2018 20:31:44 +0000 (20:31 +0000)]
Enable -Wimplicit-fallthrough for clang as well as GCC

All instances of this warning should already be fixed across all LLVM
subprojects, at least on Linux.

llvm-svn: 345887

5 years agoOmit "virtual" if overridden.
Rui Ueyama [Thu, 1 Nov 2018 20:08:39 +0000 (20:08 +0000)]
Omit "virtual" if overridden.

llvm-svn: 345886

5 years agoUse llvm_unreachable for unreachable code.
Rui Ueyama [Thu, 1 Nov 2018 20:08:29 +0000 (20:08 +0000)]
Use llvm_unreachable for unreachable code.

llvm-svn: 345885

5 years agoSet MAttrs in LTO mode
Fangrui Song [Thu, 1 Nov 2018 20:02:49 +0000 (20:02 +0000)]
Set MAttrs in LTO mode

Summary: Without this patch, MAttrs are not set.

Patch by Yin Ma

Reviewers: espindola, MaskRay, ruiu, pcc

Reviewed By: MaskRay, pcc

Subscribers: pcc, emaste, sbc100, inglorion, arichardson, aheejin, steven_wu, llvm-commits

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

llvm-svn: 345884

5 years ago[Hexagon] Remove unintended fallthrough from MC duplex code
Reid Kleckner [Thu, 1 Nov 2018 19:59:27 +0000 (19:59 +0000)]
[Hexagon] Remove unintended fallthrough from MC duplex code

I added these annotations in r345878 because I wasn't sure if the
fallthrough was intended. Krzysztof Parzyszek confirmed that they should
be breaks, so that's what this patch does.

Reviewers: kparzysz

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

llvm-svn: 345883

5 years agoFix clang -Wimplicit-fallthrough warnings across llvm, NFC
Reid Kleckner [Thu, 1 Nov 2018 19:54:45 +0000 (19:54 +0000)]
Fix clang -Wimplicit-fallthrough warnings across llvm, NFC

This patch should not introduce any behavior changes. It consists of
mostly one of two changes:
1. Replacing fall through comments with the LLVM_FALLTHROUGH macro
2. Inserting 'break' before falling through into a case block consisting
   of only 'break'.

We were already using this warning with GCC, but its warning behaves
slightly differently. In this patch, the following differences are
relevant:
1. GCC recognizes comments that say "fall through" as annotations, clang
   doesn't
2. GCC doesn't warn on "case N: foo(); default: break;", clang does
3. GCC doesn't warn when the case contains a switch, but falls through
   the outer case.

I will enable the warning separately in a follow-up patch so that it can
be cleanly reverted if necessary.

Reviewers: alexfh, rsmith, lattner, rtrieu, EricWF, bollu

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

llvm-svn: 345882

5 years ago[LoopInterchange] Fix unused variables in release build
Florian Hahn [Thu, 1 Nov 2018 19:51:13 +0000 (19:51 +0000)]
[LoopInterchange] Fix unused variables in release build

llvm-svn: 345881

5 years ago[WebAssembly] Fixup `main` signature by default
Sam Clegg [Thu, 1 Nov 2018 19:38:44 +0000 (19:38 +0000)]
[WebAssembly] Fixup `main` signature by default

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

llvm-svn: 345880

5 years ago[codeview] Add breaks to fix -Wimplicit-fallthrough
Reid Kleckner [Thu, 1 Nov 2018 19:36:29 +0000 (19:36 +0000)]
[codeview] Add breaks to fix -Wimplicit-fallthrough

This is a minor bug fix. Previously, if you tried to encode the RSP
register on the x86 platform, that might have succeeded and been encoded
incorrectly. However, no existing producer or consumer passes the x86_64
registers when targeting x86_32.

llvm-svn: 345879

5 years agoAnnotate possibly unintended fallthroughs in Hexagon MC code, NFC
Reid Kleckner [Thu, 1 Nov 2018 19:32:04 +0000 (19:32 +0000)]
Annotate possibly unintended fallthroughs in Hexagon MC code, NFC

Clang's -Wimplicit-fallthrough check fires on these switch cases. GCC
does not warn when a case body that ends in a switch falls through to a
case label of an outer switch.

It's not clear if these fall throughs are truly intended.  The Hexagon
tests pass regardless of whether these case blocks fall through or
break.

For now, I have applied the intended fallthrough annotation macro with a
FIXME comment to unblock enabling the warning. I will send a follow-up
patch that converts them to breaks to the Hexagon maintainers.

llvm-svn: 345878

5 years ago[LoopInterchange] Remove support for inner-only reductions.
Florian Hahn [Thu, 1 Nov 2018 19:25:00 +0000 (19:25 +0000)]
[LoopInterchange] Remove support for inner-only reductions.

Inner-loop only reductions require additional checks to make sure they
form a load-phi-store cycle across inner and outer loop. Otherwise the
reduction value is not properly preserved. This patch disables
interchanging such loops for now, as it causes miscompiles in some
cases and it seems to apply only for a tiny amount of loops. Across the
test-suite, SPEC2000 and SPEC2006, 61 instead of 62 loops are
interchange with inner loop reduction support disabled. With
-loop-interchange-threshold=-1000, 3256 instead of 3267.

See the discussion and history of D53027 for an outline of how such legality
checks could look like.

Reviewers: efriedma, mcrosier, davide

Reviewed By: efriedma

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

llvm-svn: 345877

5 years agoRemove unnecessary fallthrough annotation after unreachable
Reid Kleckner [Thu, 1 Nov 2018 19:11:05 +0000 (19:11 +0000)]
Remove unnecessary fallthrough annotation after unreachable

Clang's -Wimplicit-fallthrough implementation warns on this. I built
clang with GCC 7.3 in +asserts and -asserts mode, and GCC doesn't warn
on this in either configuration. I think it is unnecessary. I separated
it from the large mechanical patch (https://reviews.llvm.org/D53950) in
case I am wrong and it has to be reverted.

llvm-svn: 345876

5 years ago[GlobalISel] Fix a bug in LegalizeRuleSet::clampMaxNumElements
Volkan Keles [Thu, 1 Nov 2018 19:01:53 +0000 (19:01 +0000)]
[GlobalISel] Fix a bug in LegalizeRuleSet::clampMaxNumElements

Summary:
This function was causing a crash when `MaxElements == 1` because
it was trying to create a single element vector type.

Reviewers: dsanders, aemerson, aditya_nandakumar

Reviewed By: dsanders

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

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

llvm-svn: 345875

5 years agoOutput "rule" information in SARIF exports.
Aaron Ballman [Thu, 1 Nov 2018 18:57:38 +0000 (18:57 +0000)]
Output "rule" information in SARIF exports.

SARIF allows you to export descriptions about rules that are present in the SARIF log. Expose the help text table generated into Checkers.inc as the rule's "full description" and export all of the rules present in the analysis output. This information is useful for analysis result viewers like CodeSonar.

llvm-svn: 345874

5 years agoAdd LLVM_FALLTHROUGH annotation after switch
Reid Kleckner [Thu, 1 Nov 2018 18:53:02 +0000 (18:53 +0000)]
Add LLVM_FALLTHROUGH annotation after switch

This silences a -Wimplicit-fallthrough warning from clang. GCC does not
appear to warn when the case body ends in a switch.

This is a somewhat surprising but intended fallthrough that I pulled out
from my mechanical patch. The code intends to handle 'Yi' and related
constraints as the 'x' constraint.

llvm-svn: 345873

5 years agoRevert "[COFF, ARM64] Change setjmp for AArch64 Windows to use Intrinsic.sponentry"
Mandeep Singh Grang [Thu, 1 Nov 2018 18:38:26 +0000 (18:38 +0000)]
Revert "[COFF, ARM64] Change setjmp for AArch64 Windows to use Intrinsic.sponentry"

This reverts commit 619111f5ccf349b635e4987ec02d15777c571495.

llvm-svn: 345872

5 years agoRevert "Reapply Logging: make os_log buffer size an integer constant expression."
Tim Northover [Thu, 1 Nov 2018 18:37:42 +0000 (18:37 +0000)]
Revert "Reapply Logging: make os_log buffer size an integer constant expression."

Still more dependency hell.

llvm-svn: 345871

5 years agoUse C++11 fallthrough attribute syntax when available and add a break
Reid Kleckner [Thu, 1 Nov 2018 18:24:03 +0000 (18:24 +0000)]
Use C++11 fallthrough attribute syntax when available and add a break

Summary:
This silences the two -Wimplicit-fallthrough warnings clang finds in
ItaniumDemangle.h in libc++abi.

Clang does not have a GNU attribute spelling for this attribute, so this
is necessary.

I will commit the same change to the LLVM demangler soon.

Reviewers: EricWF, ldionne

Subscribers: christof, erik.pilkington, cfe-commits

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

llvm-svn: 345870

5 years ago[LegalizeDAG] Add generic vector CTPOP expansion (PR32655)
Simon Pilgrim [Thu, 1 Nov 2018 18:22:11 +0000 (18:22 +0000)]
[LegalizeDAG] Add generic vector CTPOP expansion (PR32655)

This patch adds support for expanding vector CTPOP instructions and removes the x86 'bitmath' lowering which replicates the same expansion.

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

llvm-svn: 345869

5 years ago[Hexagon] Fix MO_JumpTable const extender conversion
Reid Kleckner [Thu, 1 Nov 2018 18:14:45 +0000 (18:14 +0000)]
[Hexagon] Fix MO_JumpTable const extender conversion

Previously this case fell through to unreachable, so it is clearly not
covered by any test case in LLVM. It may be dynamically unreachable, in
fact. However, if it were to run, this is what it would logically do.
The assert suggests that the intended behavior was not to allow folding
offsets from jump table indices, which makes sense.

llvm-svn: 345868

5 years ago[OpenMP][libomptarget] Add runtime function for pushing coalesced global records
Gheorghe-Teodor Bercea [Thu, 1 Nov 2018 18:08:12 +0000 (18:08 +0000)]
[OpenMP][libomptarget] Add runtime function for pushing coalesced global records

Summary: In the case of coalesced global records, we need to push the exact data size passed in. This patch fixes this by outlining the common functionality of the previous push function and by adding a separate entry point for coalesced pushes. The pop function remains unchanged.

Reviewers: ABataev, grokos, caomhin

Reviewed By: ABataev, grokos

Subscribers: jholewinski, cfe-commits, Hahnfeld, guansong, jfb, openmp-commits

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

llvm-svn: 345867

5 years agoReapply Logging: make os_log buffer size an integer constant expression.
Tim Northover [Thu, 1 Nov 2018 18:04:49 +0000 (18:04 +0000)]
Reapply Logging: make os_log buffer size an integer constant expression.

The size of an os_log buffer is known at any stage of compilation, so making it
a constant expression means that the common idiom of declaring a buffer for it
won't result in a VLA. That allows the compiler to skip saving and restoring
the stack pointer around such buffers.

This also moves the OSLog helpers from libclangAnalysis to libclangAST
to avoid a circular dependency.

llvm-svn: 345866

5 years ago[llvm-mca] Add extra counters for move elimination in view RegisterFileStatistics.
Andrea Di Biagio [Thu, 1 Nov 2018 18:04:39 +0000 (18:04 +0000)]
[llvm-mca] Add extra counters for move elimination in view RegisterFileStatistics.

This patch teaches view RegisterFileStatistics how to report events for
optimizable register moves.

For each processor register file, view RegisterFileStatistics reports the
following extra information:
 - Number of optimizable register moves
 - Number of register moves eliminated
 - Number of zero moves (i.e. register moves that propagate a zero)
 - Max Number of moves eliminated per cycle.

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

llvm-svn: 345865

5 years ago[AArch64] Fix unintended fallthrough and strengthen cast
Reid Kleckner [Thu, 1 Nov 2018 18:02:27 +0000 (18:02 +0000)]
[AArch64] Fix unintended fallthrough and strengthen cast

This was added in r330630. GCC's -Wimplicit-fallthrough seems to not
fire when the previous case contains a switch itself.

This fallthrough was bening because the helper function implementing the
case used dyn_cast to re-check the type of the node in question. After
fixing the fallthrough, we can strengthen the cast.

llvm-svn: 345864

5 years agoRevert "[COFF, ARM64] Implement Intrinsic.sponentry for AArch64"
Mandeep Singh Grang [Thu, 1 Nov 2018 17:53:57 +0000 (17:53 +0000)]
Revert "[COFF, ARM64] Implement Intrinsic.sponentry for AArch64"

This reverts commit 585b6667b4712e3c7f32401e929855b3313b4ff2.

llvm-svn: 345863

5 years agoReplace two fallthrough annotations after covered switch with unreachable
Reid Kleckner [Thu, 1 Nov 2018 17:51:48 +0000 (17:51 +0000)]
Replace two fallthrough annotations after covered switch with unreachable

Both preceding switches handle all possible enumerators, so the
fallthrough is actually unreachable. This strengthens that to an
assertion.

The first instance had a comment from 2010 indicating that fallthrough
was possible, but that was back when we had a unary operator for
offsetof. Now it is its own expression kind, so the annotation was
stale.

llvm-svn: 345862

5 years ago[llvm-strip] Support --keep and --strip-all-gnu from llvm-objcopy
Jordan Rupprecht [Thu, 1 Nov 2018 17:48:46 +0000 (17:48 +0000)]
[llvm-strip] Support --keep and --strip-all-gnu from llvm-objcopy

Summary: Add --keep and --strip-all-gnu from llvm-objcopy into llvm-strip.

Reviewers: jakehehrlich, jhenderson, alexshap

Reviewed By: jhenderson, alexshap

Subscribers: llvm-commits

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

llvm-svn: 345861

5 years ago[FileSystem] Fix typo in ProcessFreeBSD
Jonas Devlieghere [Thu, 1 Nov 2018 17:46:31 +0000 (17:46 +0000)]
[FileSystem] Fix typo in ProcessFreeBSD

llvm-svn: 345860

5 years ago[llvm-objcopy] Support --{enable,disable}-deterministic-archives
Jordan Rupprecht [Thu, 1 Nov 2018 17:36:37 +0000 (17:36 +0000)]
[llvm-objcopy] Support --{enable,disable}-deterministic-archives

Summary: ar and objcopy/strip all support configuring whether archives are written deterministically (timestamps/UIDs/GIDs/etc zero'd). This has been ported to llvm-ar (the U/D modifiers) but not yet to llvm-objcopy/strip.

Reviewers: jakehehrlich, jhenderson, alexshap

Reviewed By: jhenderson

Subscribers: ruiu, mgrang, llvm-commits

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

llvm-svn: 345859

5 years agoFix the issue that not recognizing single acronym with prefix as ObjC property name.
Yan Zhang [Thu, 1 Nov 2018 17:36:18 +0000 (17:36 +0000)]
Fix the issue that not recognizing single acronym with prefix as ObjC property name.

Summary: This will make clang-tidy accept property names like xyz_URL (URL is a common acronym).

Reviewers: benhamilton, hokein

Reviewed By: benhamilton

Subscribers: jfb, cfe-commits

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

llvm-svn: 345858

5 years ago[FileSystem] Fix Exists call sites
Jonas Devlieghere [Thu, 1 Nov 2018 17:35:31 +0000 (17:35 +0000)]
[FileSystem] Fix Exists call sites

There were some calls left to Exists() on non-darwin platforms (Windows,
Linux and FreeBSD) that weren't yet updated to use the FileSystem.

llvm-svn: 345857

5 years ago[llvm-objcopy] Don't apply --localize flags to common symbols
Jordan Rupprecht [Thu, 1 Nov 2018 17:26:36 +0000 (17:26 +0000)]
[llvm-objcopy] Don't apply --localize flags to common symbols

Summary:
--localize-symbol and --localize-hidden will currently localize common symbols. GNU objcopy will not localize these symbols even when explicitly requested, which seems reasonable; common symbols should always be global so they can be merged during linking.

See PR39461

Reviewers: jakehehrlich, jhenderson, alexshap, MaskRay, espindola

Reviewed By: jakehehrlich, jhenderson, alexshap, MaskRay

Subscribers: emaste, arichardson, alexshap, MaskRay, llvm-commits

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

llvm-svn: 345856

5 years ago[llvm-objcopy] For multiclass Eq, associate help text with --name= , not with --name
Fangrui Song [Thu, 1 Nov 2018 17:20:40 +0000 (17:20 +0000)]
[llvm-objcopy] For multiclass Eq, associate help text with --name= , not with --name

Summary:
Before:
% llvm-objcopy -help
...
 --weaken-symbol=symbol  Mark <symbol> as weak
 --weaken-symbol symbol  Mark <symbol> as weak

After:
% llvm-objcopy -help
...
 --weaken-symbol=symbol  Mark <symbol> as weak

Reviewers: jhenderson, rupprecht, alexshap, jakehehrlich

Reviewed By: jhenderson

Subscribers: llvm-commits, kristina

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

llvm-svn: 345855

5 years ago[FileSystem] Remove Exists() from FileSpec
Jonas Devlieghere [Thu, 1 Nov 2018 17:09:25 +0000 (17:09 +0000)]
[FileSystem] Remove Exists() from FileSpec

This patch removes the Exists method from FileSpec and updates its uses
with calls to the FileSystem.

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

llvm-svn: 345854

5 years ago[FileSystem] Remove ResolveExecutableLocation() from FileSpec
Jonas Devlieghere [Thu, 1 Nov 2018 17:09:22 +0000 (17:09 +0000)]
[FileSystem] Remove ResolveExecutableLocation() from FileSpec

This patch removes the ResolveExecutableLocation method from FileSpec
and updates its uses with calls to the FileSystem.

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

llvm-svn: 345853

5 years ago[InstCombine] add test for ComputeNumSignBits on 2-input shuffle; NFC
Sanjay Patel [Thu, 1 Nov 2018 16:57:54 +0000 (16:57 +0000)]
[InstCombine] add test for ComputeNumSignBits on 2-input shuffle; NFC

llvm-svn: 345852

5 years agoFix whitespace in test/Assembler/fast-math-flags.ll
Cameron McInally [Thu, 1 Nov 2018 16:57:52 +0000 (16:57 +0000)]
Fix whitespace in test/Assembler/fast-math-flags.ll

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

llvm-svn: 345851

5 years ago[ARM] Attempt to fix ppc64be buildbot
Sam Parker [Thu, 1 Nov 2018 16:44:45 +0000 (16:44 +0000)]
[ARM] Attempt to fix ppc64be buildbot

llvm-svn: 345850

5 years ago[FileSystem] Improve assert and add Terminate in unit test.
Jonas Devlieghere [Thu, 1 Nov 2018 16:43:34 +0000 (16:43 +0000)]
[FileSystem] Improve assert and add Terminate in unit test.

Speculative fix for the Xcode bots where we were seeing the assertion
being triggered because we would re-initialize the FileSystem without
terminating it.

llvm-svn: 345849

5 years ago[NativePDB] Get LLDB types from PDB function types.
Zachary Turner [Thu, 1 Nov 2018 16:37:29 +0000 (16:37 +0000)]
[NativePDB] Get LLDB types from PDB function types.

This adds basic support for getting function signature types
into LLDB's type system, including into clang's AST.  There are
a few edge cases which are not correctly handled, mostly dealing
with nested classes, but this isn't specific to functions and
apply equally to variable types.  Note that no attempt has been
made yet to deal with member function types, which will happen
in subsequent patches.

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

llvm-svn: 345848

5 years ago[Diagnostics] Implement -Wsizeof-pointer-div
David Bolvansky [Thu, 1 Nov 2018 16:26:10 +0000 (16:26 +0000)]
[Diagnostics] Implement -Wsizeof-pointer-div

Summary:
void test(int *arr) {
    int arr_len = sizeof(arr) / sizeof(*arr);  // warn, incorrect way to compute number of array elements
}

Enabled under -Wall (same behaviour as GCC)

Reviewers: rsmith, MTC, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: MTC, thakis, jfb, cfe-commits

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

llvm-svn: 345847

5 years agoRevert "Logging: make os_log buffer size an integer constant expression.
Tim Northover [Thu, 1 Nov 2018 16:15:24 +0000 (16:15 +0000)]
Revert "Logging: make os_log buffer size an integer constant expression.

This also reverts a couple of follow-up commits trying to fix the
dependency issues. Latest revision added a cyclic dependency that can't
just be patched up in 5 minutes.

llvm-svn: 345846

5 years ago[llvm-objcopy] Use proper cases
Fangrui Song [Thu, 1 Nov 2018 16:02:12 +0000 (16:02 +0000)]
[llvm-objcopy] Use proper cases

Reviewers: jhenderson, alexshap, jakehehrlich, espindola, rupprecht

Reviewed By: jhenderson, rupprecht

Subscribers: emaste, arichardson, rupprecht, llvm-commits

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

llvm-svn: 345845

5 years ago[clang] Improve ctor initializer completions.
Kadir Cetinkaya [Thu, 1 Nov 2018 15:54:18 +0000 (15:54 +0000)]
[clang] Improve ctor initializer completions.

Summary:
Instead of providing generic "args" for member and base class
initializers, tries to fetch relevant constructors and show their signatures.

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: ZaMaZaN4iK, eraman, arphaman, cfe-commits

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

llvm-svn: 345844

5 years ago[FileSystem] Remove GetPermissions() and Readable() from FileSpec
Jonas Devlieghere [Thu, 1 Nov 2018 15:47:33 +0000 (15:47 +0000)]
[FileSystem] Remove GetPermissions() and Readable() from FileSpec

This patch removes the GetPermissions and GetReadable methods from
FileSpec and updates its uses with calls to the FileSystem.

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

llvm-svn: 345843

5 years ago[DAGCombiner] make sure we have a whole-number extract before trying to narrow a...
Sanjay Patel [Thu, 1 Nov 2018 15:41:12 +0000 (15:41 +0000)]
[DAGCombiner] make sure we have a whole-number extract before trying to narrow a vector op (PR39511)

The test causes a crash because we were trying to extract v4f32 to v3f32, and the
narrowing factor was then 4/3 = 1 producing a bogus narrow type.

This should fix:
https://bugs.llvm.org/show_bug.cgi?id=39511

llvm-svn: 345842

5 years ago[MC] Implement EmitRawText in MCNullStreamer
Daniel Sanders [Thu, 1 Nov 2018 15:41:11 +0000 (15:41 +0000)]
[MC] Implement EmitRawText in MCNullStreamer

Summary:
This adds dummy implementation of `EmitRawText` in `MCNullStreamer`.

This fixes the behavior of `AsmPrinter` with `MCNullStreamer` on targets
on which no integrated assembler is used. An attempt to emit inline asm
on such a target would previously lead to a crash, since `AsmPrinter` does not
check for `hasRawTextSupport` in `EmitInlineAsm` and calls `EmitRawText`
anyway if integrated assembler is disabled (the behavior has changed
in D2686).

Error message printed by MCStreamer:

> EmitRawText called on an MCStreamer that doesn't support it, something
> must not be fully mc'ized

Patch by Eugene Sharygin

Reviewers: dsanders, echristo

Reviewed By: dsanders

Subscribers: eraman, llvm-commits

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

llvm-svn: 345841

5 years ago[ARM][CGP] Negative constant operand handling
Sam Parker [Thu, 1 Nov 2018 15:23:42 +0000 (15:23 +0000)]
[ARM][CGP] Negative constant operand handling

While mutating instructions, we sign extended negative constant
operands for binary operators that can safely overflow. This was to
allow instructions, such as add nuw i8 %a, -2, to still be able to
perform a subtraction. However, the code to handle constants doesn't
take into consideration that instructions, such as sub nuw i8 -2, %a,
require the i8 -2 to be converted into i32 254.

This is a relatively simple fix, but I've taken the time to
reorganise the code a bit - mainly that instructions that can be
promoted are cached and splitting up the Mutate function.

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

llvm-svn: 345840

5 years agoMultiversioning- Ensure all MV functions are emitted.
Erich Keane [Thu, 1 Nov 2018 15:11:43 +0000 (15:11 +0000)]
Multiversioning- Ensure all MV functions are emitted.

Multiverson function versions are always used (by the resolver), so ensure that
they are always emitted.

Change-Id: I5d2e0841fddf0d18918b3fb92ae76814add7ee96
llvm-svn: 345839

5 years agoCPU-Dispatch- Fix type of a member function, prevent deferrals
Erich Keane [Thu, 1 Nov 2018 15:11:41 +0000 (15:11 +0000)]
CPU-Dispatch- Fix type of a member function, prevent deferrals

The member type creation for a cpu-dispatch function was not correctly
including the 'this' parameter, so ensure that the type is properly
determined. Also, disable defer in the cases of emitting the functoins,
as it can end up resulting in the wrong version being emitted.

Change-Id: I0b8fc5e0b0d1ae1a9d98fd54f35f27f6e5d5d083
llvm-svn: 345838

5 years ago[MS Demangler] Expose the Demangler AST publicly.
Zachary Turner [Thu, 1 Nov 2018 15:07:32 +0000 (15:07 +0000)]
[MS Demangler] Expose the Demangler AST publicly.

LLDB would like to use this in order to build a clang AST from
a mangled name.

This is NFC otherwise.

llvm-svn: 345837

5 years ago[X86][X86FixupLEA] Rename processInstructionForSLM to processInstructionForSlowLEA...
Simon Pilgrim [Thu, 1 Nov 2018 14:57:07 +0000 (14:57 +0000)]
[X86][X86FixupLEA] Rename processInstructionForSLM to processInstructionForSlowLEA (NFCI)

The function isn't SLM specific (its driven by the FeatureSlowLEA flag).

Minor tidyup prior to PR38225.

llvm-svn: 345836

5 years agoLogging: put link against libclangAnalysis rather than libLLVMAnalysis for os_log
Tim Northover [Thu, 1 Nov 2018 14:43:35 +0000 (14:43 +0000)]
Logging: put link against libclangAnalysis rather than libLLVMAnalysis for os_log

llvm-svn: 345835

5 years ago[libcxx] Fix usage of _C2, which is a "nasty macro" in some environments
Louis Dionne [Thu, 1 Nov 2018 14:41:37 +0000 (14:41 +0000)]
[libcxx] Fix usage of _C2, which is a "nasty macro" in some environments

The problem was pointed out in https://reviews.llvm.org/D48896#inline-475775.

llvm-svn: 345834

5 years agoLogging: add CMake dependency so libAST can use OSLog analysis.
Tim Northover [Thu, 1 Nov 2018 14:22:20 +0000 (14:22 +0000)]
Logging: add CMake dependency so libAST can use OSLog analysis.

Should fix bots on platforms with slightly different symbol resolution
semantics.

llvm-svn: 345833

5 years ago[InstSimplify] fold icmp based on range of abs/nabs (2nd try)
Sanjay Patel [Thu, 1 Nov 2018 14:07:39 +0000 (14:07 +0000)]
[InstSimplify] fold icmp based on range of abs/nabs (2nd try)

This is retrying the fold from rL345717
(reverted at rL347780)
...with a fix for the miscompile
demonstrated by PR39510:
https://bugs.llvm.org/show_bug.cgi?id=39510

Original commit message:

This is a fix for PR39475:
https://bugs.llvm.org/show_bug.cgi?id=39475

We managed to get some of these patterns using computeKnownBits in https://reviews.llvm.org/D47041, but that
can't be used for nabs(). Instead, put in some range-based logic, so we can fold
both abs/nabs with icmp with a constant value.

Alive proofs:
https://rise4fun.com/Alive/21r

Name: abs_nsw_is_positive

  %cmp = icmp slt i32 %x, 0
  %negx = sub nsw i32 0, %x
  %abs = select i1 %cmp, i32 %negx, i32 %x
  %r = icmp sgt i32 %abs, -1
    =>
  %r = i1 true

Name: abs_nsw_is_not_negative

  %cmp = icmp slt i32 %x, 0
  %negx = sub nsw i32 0, %x
  %abs = select i1 %cmp, i32 %negx, i32 %x
  %r = icmp slt i32 %abs, 0
    =>
  %r = i1 false

Name: nabs_is_negative_or_0

  %cmp = icmp slt i32 %x, 0
  %negx = sub i32 0, %x
  %nabs = select i1 %cmp, i32 %x, i32 %negx
  %r = icmp slt i32 %nabs, 1
    =>
  %r = i1 true

Name: nabs_is_not_over_0

  %cmp = icmp slt i32 %x, 0
  %negx = sub i32 0, %x
  %nabs = select i1 %cmp, i32 %x, i32 %negx
  %r = icmp sgt i32 %nabs, 0
    =>
  %r = i1 false

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

llvm-svn: 345832

5 years ago[InstSimplify] add tests for icmp fold bug (PR39510); NFC
Sanjay Patel [Thu, 1 Nov 2018 14:03:22 +0000 (14:03 +0000)]
[InstSimplify] add tests for icmp fold bug (PR39510); NFC

Verify that set intersection/subset are not confused.

llvm-svn: 345831

5 years ago[mips][micromips] Fix JmpLink to TargetExternalSymbol
Aleksandar Beserminji [Thu, 1 Nov 2018 13:57:54 +0000 (13:57 +0000)]
[mips][micromips] Fix JmpLink to TargetExternalSymbol

When matching MipsISD::JmpLink t9, TargetExternalSymbol:i32'...',
wrong JALR16_MM is selected. This patch adds missing pattern for
JmpLink, so that JAL instruction is selected.

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

llvm-svn: 345830

5 years ago[ADT] Clean up SparseBitVector copying and make it moveable
Benjamin Kramer [Thu, 1 Nov 2018 13:55:59 +0000 (13:55 +0000)]
[ADT] Clean up SparseBitVector copying and make it moveable

llvm-svn: 345829

5 years agoLogging: make os_log buffer size an integer constant expression.
Tim Northover [Thu, 1 Nov 2018 13:49:54 +0000 (13:49 +0000)]
Logging: make os_log buffer size an integer constant expression.

The size of an os_log buffer is known at any stage of compilation, so making it
a constant expression means that the common idiom of declaring a buffer for it
won't result in a VLA. That allows the compiler to skip saving and restoring
the stack pointer around such buffers.

llvm-svn: 345828

5 years ago[AArch64] Add support for ARMv8.4 in Saphira.
Chad Rosier [Thu, 1 Nov 2018 13:45:16 +0000 (13:45 +0000)]
[AArch64] Add support for ARMv8.4 in Saphira.

llvm-svn: 345827

5 years agoCPU-Dispatch-- Fix conflict between 'generic' and 'pentium'
Erich Keane [Thu, 1 Nov 2018 12:50:37 +0000 (12:50 +0000)]
CPU-Dispatch-- Fix conflict between 'generic' and 'pentium'

When a dispatch function was being emitted that had both a generic and a
pentium configuration listed, we would assert.  This is because neither
configuration has any 'features' associated with it so they were both
considered the 'default' version.  'pentium' lacks any features because
we implement it in terms of __builtin_cpu_supports (instead of Intel
proprietary checks), which is unable to decern between the two.

The fix for this is to omit the 'generic' version from the dispatcher if
both are present. This permits existing code to compile, and still will
choose the 'best' version available (since 'pentium' is technically
better than 'generic').

Change-Id: I4b69f3e0344e74cbdbb04497845d5895dd05fda0
llvm-svn: 345826

5 years agoAllow clk_event_t comparisons
Sven van Haastregt [Thu, 1 Nov 2018 12:43:00 +0000 (12:43 +0000)]
Allow clk_event_t comparisons

Also rename `invalid-clk-events-cl2.0.cl` to `clk_event_t.cl` and
repurpose it to include both positive and negative clk_event_t tests.

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

llvm-svn: 345825

5 years ago[X86][SSE] Move 2-input limit up from getFauxShuffleMask to resolveTargetShuffleInput...
Simon Pilgrim [Thu, 1 Nov 2018 11:52:09 +0000 (11:52 +0000)]
[X86][SSE] Move 2-input limit up from getFauxShuffleMask to resolveTargetShuffleInputs (reapplied)

Reapplying an updated version of rL345395 (reverted in rL345451), now the issues noticed in PR39483 have been fixed.

This patch allows resolveTargetShuffleInputs to remove UNDEF inputs from cases where we have more than 2 inputs.

llvm-svn: 345824

5 years agoUpdate to the 10-10 SARIF spec.
Aaron Ballman [Thu, 1 Nov 2018 11:52:07 +0000 (11:52 +0000)]
Update to the 10-10 SARIF spec.

This removes the Step property (which can be calculated by consumers trivially), and updates the schema and version numbers accordingly.

llvm-svn: 345823

5 years ago[NFC] Specialize public API of ICFLoopSafetyInfo for insertions and removals
Max Kazantsev [Thu, 1 Nov 2018 10:16:06 +0000 (10:16 +0000)]
[NFC] Specialize public API of ICFLoopSafetyInfo for insertions and removals

llvm-svn: 345822

5 years ago[Mips] Conditionally remove successor block
Stefan Maksimovic [Thu, 1 Nov 2018 10:10:42 +0000 (10:10 +0000)]
[Mips] Conditionally remove successor block

In MipsBranchExpansion::splitMBB, upon splitting
a block with two direct branches, remove the successor
of the newly created block (which inherits successors from
the original block) which is pointed to by the last
branch in the original block only if the targets of two
branches differ.

This is to fix the failing test when ran with
-verify-machineinstrs enabled.

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

llvm-svn: 345821

5 years ago[NFC] Reorganize code to prepare it for more transforms
Max Kazantsev [Thu, 1 Nov 2018 09:42:50 +0000 (09:42 +0000)]
[NFC] Reorganize code to prepare it for more transforms

llvm-svn: 345820

5 years ago[ELF] - Do not crash when -r output uses linker script with `/DISCARD/`
George Rimar [Thu, 1 Nov 2018 09:20:06 +0000 (09:20 +0000)]
[ELF] - Do not crash when -r output uses linker script with `/DISCARD/`

This is https://bugs.llvm.org/show_bug.cgi?id=39493.

We crashed previously because did not handle /DISCARD/ properly
when -r was used. I think it is uncommon to use scripts with -r, though I see
nothing wrong to handle the /DISCARD/ so that we will not crash at least.

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

llvm-svn: 345819

5 years ago[SystemZ::TTI] Recognize the higher cost of scalar i1 -> fp conversion
Jonas Paulsson [Thu, 1 Nov 2018 09:05:32 +0000 (09:05 +0000)]
[SystemZ::TTI]  Recognize the higher cost of scalar i1 -> fp conversion

Scalar i1 to fp conversions are done with a branch sequence, so it should
have a higher cost.

Review: Ulrich Weigand
https://reviews.llvm.org/D53924

llvm-svn: 345818

5 years ago[SystemZ::TTI] Accurate costs for i1->double vector conversions
Jonas Paulsson [Thu, 1 Nov 2018 09:01:51 +0000 (09:01 +0000)]
[SystemZ::TTI]  Accurate costs for i1->double vector conversions

This factors out a new method getBoolVecToIntConversionCost() containing the
code for vector sext/zext of i1, in order to reuse it for i1 to double vector
conversions.

Review: Ulrich Weigand
https://reviews.llvm.org/D53923

llvm-svn: 345817

5 years ago[clang][CodeGen] ImplicitIntegerSignChangeSanitizer: actually ignore NOP casts.
Roman Lebedev [Thu, 1 Nov 2018 08:56:51 +0000 (08:56 +0000)]
[clang][CodeGen] ImplicitIntegerSignChangeSanitizer: actually ignore NOP casts.

I fully expected for that to be handled by the canonical type check,
but it clearly wasn't. Sadly, somehow it hide until now.

Reported by Eli Friedman.

llvm-svn: 345816