149909 Commits

Author SHA1 Message Date
Alexander Timofeev
dfdb788875 AMDGPUAnnotateUniformValue should always treat volatile loads as divergent
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304554 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 15:25:52 +00:00
Geoff Berry
7df090cb2b [AArch64][Falkor] Model immediate forwarding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304552 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 14:27:41 +00:00
Mark Searles
48e0515b4f [AMDGPU] Turn on the new waitcnt insertion pass. Adjust tests.
-enable-si-insert-waitcnts=1 becomes the default
-enable-si-insert-waitcnts=0 to use old pass

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304551 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 14:19:25 +00:00
Zoran Jovanovic
9c2941a24c [mips][microMIPS] Extending size reduction pass with LBU16, LHU16, SB16 and SH16
Author: milena.vujosevic.janicic
Reviewers: sdardis
The patch extends size reduction pass for MicroMIPS.
The following instructions are examined and transformed, if possible:
LBU instruction is transformed into 16-bit instruction LBU16
LHU instruction is transformed into 16-bit instruction LHU16
SB instruction is transformed into 16-bit instruction SB16
SH instruction is transformed into 16-bit instruction SH16
Differential Revision: https://reviews.llvm.org/D33091


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304550 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 14:14:21 +00:00
Krzysztof Parzyszek
c4071bcc5b [Hexagon] Return 0 from getDotNewPredOp when .new opcode does not exist
This allows using this function to test if an instruction can be converted
to a .new form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304549 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 14:07:06 +00:00
Amaury Sechet
f4b4c0031c Regenerate sse3.ll test results. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304548 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 14:02:49 +00:00
Amaury Sechet
38e075d56e Regenerate and-sink.ll test results. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 14:02:46 +00:00
Amaury Sechet
397f7b2eea Regenerate shrink-compare.ll test results. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304546 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 14:02:43 +00:00
Benjamin Kramer
2118193ddf [OrderedBasicBlock] Return false for comesBefore(A, A)
So far it would return true for the first uncached query, then cached
queries return false.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 13:10:31 +00:00
Alex Lorenz
c9c72aa1f6 [lit][macOS] Add a utility function to find the platform SDK version
on macOS

This function will be used to tie Clang's Integeration tests to a particular
SDK version. See https://reviews.llvm.org/D32178 for more context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304541 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 11:21:37 +00:00
Benjamin Kramer
f4cc8004bc [X86] Don't fold into memory operands into insertps in the generated folding tables.
insertps behaves differently, the register form selects from an input
register based on the immediate operand while the memory form just loads
the given address. We have custom code to change the immediate in cases
where that's legal, so completely remove insertps from the generated
tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304540 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 10:50:22 +00:00
John Brawn
0f1cadd920 [GlobalMerge] Don't merge globals that may be preempted
When a global may be preempted it needs to be accessed directly, instead of
indirectly through a MergedGlobals symbol, for the preemption to work.

This fixes PR33136.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304537 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 10:24:14 +00:00
Diana Picus
899f9e9ab6 [ARM] GlobalISel: Support struct params/returns
Very very similar to the support for arrays. As with arrays, we don't
support returning large structs that wouldn't fit in R0-R3. Most
front-ends would likely use sret arguments for that anyway.

The only significant difference is that when splitting a struct, we need
to make sure we set the correct original alignment on each member,
otherwise it may get split incorrectly between stack and registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304536 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 10:16:48 +00:00
Amaury Sechet
4253871909 nits in TargetLowering.cpp . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 09:18:18 +00:00
Javed Absar
8f528aa2a7 [ARM] Cortex-A57 scheduling model for ARM backend (AArch32)
This patch implements the Cortex-A57 scheduling model.
The main code is in ARMScheduleA57.td, ARMScheduleA57WriteRes.td.
Small changes in cpp,.h files to support required scheduling predicates.

Scheduling model implemented according to:
 http://infocenter.arm.com/help/topic/com.arm.doc.uan0015b/Cortex_A57_Software_Optimization_Guide_external.pdf.

Patch by : Andrew Zhogin (submitted on his behalf, as requested).
Rewiewed by: Renato Golin, Diana Picus, Javed Absar, Kristof Beyls.
Differential Revision: https://reviews.llvm.org/D28152




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304530 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 08:53:19 +00:00
Amaury Sechet
e1e1269083 Specify triple for xor-icmp.ll .
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304526 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 07:45:22 +00:00
Amaury Sechet
53e648c83f Regenerate expectations for xor-icmp.ll . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 07:25:02 +00:00
Max Kazantsev
2797af342d [SelectionDAG] Get rid of recursion in findNonImmUse
The recursive implementation of findNonImmUse may overflow stack
on extremely long use chains. This patch replaces it with an equivalent
iterative implementation.

Reviewed By: bogner

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304522 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 07:11:00 +00:00
Craig Topper
d8a59f8c32 [TableGen] Remove a couple unused methods from Record that take a StringRef argument. NFC
We also have a version that takes an Init* that are used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304521 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 05:56:47 +00:00
Gor Nishanov
1b0c4ab66c [coroutines] PR33271: Remove stray coro.save intrinsics during CoroSplit
Summary:
Optimization passes may remove llvm.coro.suspend intrinsic while leaving matching llvm.coro.save intrinsic orphaned.
Make sure we clean up orphaned coro.saves.  The bug manifested with a crash similar to this:

```
    llvm_unreachable("Unknown type!");
    llvm::MVT::getVT (Ty=0x489518, HandleUnknown=false)
    llvm::EVT::getEVT
    llvm::TargetLoweringBase::getValueType
    llvm::ComputeValueVTs
    llvm::SelectionDAGBuilder::visitTargetIntrinsic
```

Reviewers: GorNishanov

Subscribers: EricWF, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304518 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 02:18:36 +00:00
Xinliang David Li
79a680d764 [Profile] Enhance expect lowering to handle correlated branches
builtin_expect applied on && or || expressions were not
handled properly before. With this patch, the problem is fixed.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 02:09:31 +00:00
Teresa Johnson
f345d54a63 [ThinLTO] Efficiency improvement when writing module path string table
Summary:
When writing the combined index, we are walking the entire module
path StringMap in the full index, and checking whether each one should be
included in the index being written. For distributed backends, where we
write an individual combined index for each file, each with only a few
module paths, this is incredibly inefficient. Add a method that takes
a callback and hides the details of whether we are writing the full
combined index, or just a slice, and in the latter case it walks the set
of modules to include instead of the entire index.

For a huge application with around 23K files (i.e. where we were iterating
through the 23K-entry modulePath StringMap 23K times), this change improved
the thin link time by a whopping 48%.

Reviewers: pcc

Subscribers: Prazek, inglorion, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 01:56:02 +00:00
Philip Reames
0e3735a927 [RS4GC] Comment clarification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 01:52:06 +00:00
Jacob Gravelle
fd4a49bbfc Revert r304117 - WebAssembly object format isn't ready to be the default
Summary: Wasm object format has some functionality regressions from the ELF format, and doesn't play nicely with the rest of the toolchain. It should eventually be the default, but not yet.

Reviewers: sunfish, sbc100

Subscribers: jfb, dschuff, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304512 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 01:26:17 +00:00
Sam Clegg
f83cb57aef [WebAssembly] MC: Fix references to undefined externals in data section
Undefined externals don't need to have a size or an offset.
This was broken by r303915.  Added a test for this case.

This fixes the "Compile LLVM Torture (o)" step on the wasm
waterfall.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304505 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-02 01:05:24 +00:00
Mandeep Singh Grang
4fc1ca19cd [PredicateInfo] Enable -reverse-iterate tests only for +Asserts builds
Summary: The flag -reverse-iterate is present only on +Asserts builds.

Reviewers: dberlin, davide, RKSimon, efriedma, chapuni

Reviewed By: efriedma, chapuni

Subscribers: chapuni, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:52:59 +00:00
Davide Italiano
e625a205ec [PM] GVNSink is off by default, fix an obvious typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304497 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:47:53 +00:00
Eugene Zelenko
ff49b831bd [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:25:02 +00:00
Zachary Turner
ce3608ab25 Fix 2 more -Wreorder warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:24:50 +00:00
Tim Shen
a950eb976c [ThinLTO] Move -lto-use-new-pm to llvm-lto2, and change it to -use-new-pm.
Summary:
As we teach Clang to use ThinkLTO + new PM, it's good for the users to
inject through Config, instead of setting a flag in the LTOBackend
library. Move the flag to llvm-lto2.

As it moves to llvm-lto2, a new name -use-new-pm seems simpler and as
clear.

Reviewers: davide, tejohnson

Subscribers: mehdi_amini, Prazek, inglorion, eraman, chandlerc, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:13:44 +00:00
Davide Italiano
9cd1e1f867 Move GVNHoist to the right position in the new pass manager pipeline.
GVNHoist was moved as part of simplification passes for the current
pass manager (but not for the new), so they're out-of-sync.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:08:14 +00:00
Xinliang David Li
850e50d6ba Fix compiler_rt buildbot failure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304489 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:05:11 +00:00
Keno Fischer
6437c35ae0 Reapply "[Cloning] Take another pass at properly cloning debug info"
This was rL304226, reverted in 304228 due to a clang assertion failure
on the build bots. That problem should have been addressed by clang
commit rL304470.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304488 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 23:02:12 +00:00
Zachary Turner
cb20a4fea9 Fix -Wreorder warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 22:03:17 +00:00
Zachary Turner
6a330c6d5d [CodeView] Properly align symbol records on read/write.
Object files have symbol records not aligned to any particular
boundary (e.g. 1-byte aligned), while PDB files have symbol
records padded to 4-byte aligned boundaries.  Since they share
the same reading / writing code, we have to provide an option to
specify the alignment and propagate it up to the producer or
consumer who knows what the alignment is supposed to be for the
given container type.

Added a test for this by modifying the existing PDB -> YAML -> PDB
round-tripping code to round trip symbol records as well as types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304484 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:52:41 +00:00
Yaxun Liu
2bb8e7e8cc [AMDGPU] Fix kernel arg segment size for amdgizcl
Differential Revision: https://reviews.llvm.org/D33307


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304482 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:31:53 +00:00
Eli Friedman
dca42389f7 Add opt-bisect support for region passes.
This is necessary to get opt-bisect working with polly.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:22:26 +00:00
Craig Topper
bec6218b28 [InstSimplify][ConstantFolding] Add test demonstrating failure to simplify (icmp eq null, inttoptr x) when the null is on the left hand side. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304474 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:20:07 +00:00
Adrian Prantl
ffd22cf2fa DbgValueHistoryCalculator: Ignore call instructions that claim to clobber SP.
The AArch64 backend marks calls that involve aggregate function
arguments as having an implicit def of SP. We already have the same
workaround in LiveDebugValues and in DbgValueHistoryCalculator for SP
clobbers in register masks. This adds register defs to the list.

Fixes rdar://problem/30361929 and Swift SR-3851.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:14:58 +00:00
Teresa Johnson
66150646ec [PGO] Adjust indirect call promotion threshold
Summary:
Reduce min percent required for indirect call promotion from 33% to 30%,
which matches gcc's threshold and catches the same hot opportunities.

Reviewers: davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304469 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 21:10:10 +00:00
Keno Fischer
d840ad077e [llvm-config] Don't use PATH_MAX
It doesn't exist on Windows. The number we use here doesn't really matter,
the storage will expand automatically but 256 seems like a reasonable default.
Should fix windows buildbots that complained about rL304458.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304468 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 20:51:55 +00:00
Keno Fischer
cb70331097 [DIBuilder] Add a more fine-grained finalization method
Summary:
Clang wants to clone a function before it is done building the entire
compilation unit. As of now, there is no good way to do that, because
CloneFunction doesn't like dealing with temporary metadata. However,
as long as clang doesn't want to add any variables to this SP, it
should be fine to just prematurely finalize it. Add an API to allow this.

This is done in preparation of a clang commit to fix the assertion that
necessitated the revert of D33655.

Reviewers: aprantl, dblaikie

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 20:42:44 +00:00
Evgeniy Stepanov
ccb80b9c0f (NFC) Track global summary liveness in GVFlags.
Replace GVFlags::LiveRoot with GVFlags::Live and use that instead of
all the DeadSymbols sets. This is refactoring in order to make
liveness information available in the RegularLTO pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304466 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 20:30:06 +00:00
Nirav Dave
cbf8bcc206 [SDAG] Fix CombineTo ordering in visitZERO_EXTEND and visitSIGN_EXTEND
Reorder CombineTo Calls to prevent references to stale/deleted SDNodes which caused undue assertions.

Reviewers: dbabokin

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304460 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 19:33:50 +00:00
Keno Fischer
be2a63a5a4 [llvm-config] Report --bindir based on LLVM_TOOLS_INSTALL_DIR
Summary:
`LLVM_TOOLS_INSTALL_DIR` was introduced in r272200 in order to override the directory
name into which to install LLVM's executable. However, `llvm-config --bindir` still reported
`$PREFIX/bin` independent of what LLVM_TOOLS_INSTALL_DIR was set to.

This fixes the out-of-tree clang standalone build for me.

Reviewers: beanz, tstellar

Reviewed By: tstellar

Subscribers: chapuni, tstellar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 19:20:33 +00:00
David Blaikie
4fadb11eb6 Prefer static namespace-scoped variables over anon namespacing per style guide
Also for consistency with the immediately preceeding variable
definition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 19:20:26 +00:00
Haicheng Wu
0b6e684a2e [InlineCost] Add a test case for GEP cost
The added test case is to check whether the simplified value is passed to
getGEPCost().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304454 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 19:06:07 +00:00
Xinliang David Li
4edf255f46 [Profile] Fix builtin_expect lowering bug
The lowerer wrongly assumes the ICMP instruction 
 1) always has a constant operand;
 2) the operand has value 0.

It also assumes the expected value can only be one, thus
other values other than one will be considered 'zero'.

This leads to wrong profile annotation when other integer values
are used other than 0, 1 in the comparison or in the expect intrinsic.

Also missing is handling of equal predicate.

This patch fixes all the above problems.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304453 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 19:05:55 +00:00
Xinliang David Li
0fcbca5576 [PartialInlining] Emit branch info and profile data as remarks
This allows us to collect profile statistics to tune static 
branch prediction.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304452 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 18:58:50 +00:00
Mandeep Singh Grang
9cc122269f [PredicateInfo] Fix non-determinism in codegen uncovered by reverse iterating SmallPtrSet
Summary:
Sort OpsToRename before iterating to make iteration order deterministic.

Thanks to Daniel Berlin for the sorting logic.

Reviewers: dberlin, RKSimon, efriedma, davide

Reviewed By: dberlin, davide

Subscribers: sanjoy, davide, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-01 18:36:24 +00:00