OSDN Git Service

android-x86/external-llvm.git
6 years ago[ThinLTO] Add GraphTraits for FunctionSummaries
Charles Saternos [Sat, 17 Feb 2018 21:39:24 +0000 (21:39 +0000)]
[ThinLTO] Add GraphTraits for FunctionSummaries

Add GraphTraits definitions to the FunctionSummary and ModuleSummaryIndex classes. These GraphTraits will be used to construct find SCC's in ThinLTO analysis passes.

Second attempt, since last patch caused stage2 build to fail (now using function_ref rather than std::function).

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

6 years ago[MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation
Simon Pilgrim [Sat, 17 Feb 2018 21:29:45 +0000 (21:29 +0000)]
[MIPS][MSA] Convert vector integer min/max opcodes to use generic implementation

Found while investigating D43338

Simon^3 - the LLVM project needs more Simons.

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

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

6 years ago[ARM] Add LLVM tests for the vcvtr builtins
Sjoerd Meijer [Sat, 17 Feb 2018 19:59:29 +0000 (19:59 +0000)]
[ARM] Add LLVM tests for the vcvtr builtins

Follow up of Clang commit r325351; this adds the LLVM tests, which
were also missing.

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

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

6 years ago[RISCV] Revert r324172 now r323991 was reverted
Alex Bradbury [Sat, 17 Feb 2018 18:17:47 +0000 (18:17 +0000)]
[RISCV] Revert r324172 now r323991 was reverted

This fixes the build, now that r325421 was commited to revert r323991.

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

6 years agoMade test dbg_value_fastisel.ll specific to AArch64 fast-isel.
Sander de Smalen [Sat, 17 Feb 2018 17:43:24 +0000 (17:43 +0000)]
Made test dbg_value_fastisel.ll specific to AArch64 fast-isel.

Some buildbots failed on this test (rL325438) because they don't
build all targets. I set the triple to aarch64 and moved the test
to test/CodeGen/AArch64/fast-isel-dbg-value.ll.

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

6 years ago[X86] Add 'sahf' to getHostCPUFeatures so -march=native will pick it up correctly.
Craig Topper [Sat, 17 Feb 2018 16:52:49 +0000 (16:52 +0000)]
[X86] Add 'sahf' to getHostCPUFeatures so -march=native will pick it up correctly.

Summary: We probably mostly get this right due to family/model/stepping mapping to CPU names. But we should detect it explicitly.

Reviewers: RKSimon, echristo, dim, spatel

Reviewed By: dim

Subscribers: llvm-commits

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

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

6 years ago[DebugInfo][FastISel] Fix dropping dbg.value()
Sander de Smalen [Sat, 17 Feb 2018 16:42:54 +0000 (16:42 +0000)]
[DebugInfo][FastISel] Fix dropping dbg.value()

Summary:
https://llvm.org/PR36263 shows that when compiling at -O0 a dbg.value()
instruction (that remains from an original dbg.declare()) is dropped
by FastISel. Since FastISel selects instructions by iterating a basic
block backwards, it drops the dbg.value if one of its operands is not
yet instantiated by a previously selected instruction.

Instead of calling 'lookUpRegForValue()' we can call 'getRegForValue()'
instead that will insert a placeholder for the operand to be filled in
when continuing the instruction selection.

Reviewers: aprantl, dblaikie, probinson

Reviewed By: aprantl

Subscribers: llvm-commits, dstenb, JDevlieghere

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

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

6 years ago[PatternMatch] enhance m_One() to ignore undef elements in vectors
Sanjay Patel [Sat, 17 Feb 2018 16:00:42 +0000 (16:00 +0000)]
[PatternMatch] enhance m_One() to ignore undef elements in vectors

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

6 years ago[InstSimplify, InstCombine] add tests with vector undef elts; NFC
Sanjay Patel [Sat, 17 Feb 2018 15:55:40 +0000 (15:55 +0000)]
[InstSimplify, InstCombine] add tests with vector undef elts; NFC

These would fold if the m_One pattern matcher accounted for undef elts.

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

6 years ago[X86][3DNow!] Add PFRCP reg-reg disassembler test case (PR21168)
Simon Pilgrim [Sat, 17 Feb 2018 14:58:16 +0000 (14:58 +0000)]
[X86][3DNow!] Add PFRCP reg-reg disassembler test case (PR21168)

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

6 years ago[InstSimplify] move select undef cond fold with other constant cond folds; NFCI
Sanjay Patel [Sat, 17 Feb 2018 14:50:13 +0000 (14:50 +0000)]
[InstSimplify] move select undef cond fold with other constant cond folds; NFCI

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

6 years ago[AArch64] Implement dynamic stack probing for windows
Martin Storsjo [Sat, 17 Feb 2018 14:26:32 +0000 (14:26 +0000)]
[AArch64] Implement dynamic stack probing for windows

This makes sure that alloca() function calls properly probe the
stack as needed.

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

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

6 years agoFix unused variable warning. NFCI.
Simon Pilgrim [Sat, 17 Feb 2018 13:48:23 +0000 (13:48 +0000)]
Fix unused variable warning. NFCI.

We were casting to AArch64InstrInfo but only using it for static methods which some compilers complain about.

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

6 years ago[dwarfdump] Fix spurious verification errors for DW_AT_location attributes
Jonas Devlieghere [Sat, 17 Feb 2018 13:06:37 +0000 (13:06 +0000)]
[dwarfdump] Fix spurious verification errors for DW_AT_location attributes

Verifying any DWARF file that is optimized and contains at least one tag
with a DW_AT_location with a location list offset as a
DW_AT_form_dataXXX results in dwarfdump spuriously claiming that the
location list is invalid.

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

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

6 years ago[DAGCombiner] Remove simplifyShuffleMask - now handled more generally by SimplifyDema...
Simon Pilgrim [Sat, 17 Feb 2018 12:36:56 +0000 (12:36 +0000)]
[DAGCombiner] Remove simplifyShuffleMask - now handled more generally by SimplifyDemandedVectorElts.

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

6 years agoFix signed/unsigned comparison warning in AsmGenMatcher generated code. NFCI.
Simon Pilgrim [Sat, 17 Feb 2018 12:29:47 +0000 (12:29 +0000)]
Fix signed/unsigned comparison warning in AsmGenMatcher generated code. NFCI.

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

6 years ago[DebugInfo] Removed assert on missing CountVarDIE
Sander de Smalen [Sat, 17 Feb 2018 11:06:53 +0000 (11:06 +0000)]
[DebugInfo] Removed assert on missing CountVarDIE

Summary:
The assert for a DISubrange's CountVarDIE to be available fails
when the dbg.value() has been optimized away for any reason.
Having the assert for that is a little heavy, so instead removing
it now in favor of not generating the 'count' expression.

Addresses http://llvm.org/PR36263 .

Reviewers: aprantl, dblaikie, probinson

Reviewed By: aprantl

Subscribers: JDevlieghere, llvm-commits, dstenb

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

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

6 years agoReport fatal error in the case of out of memory
Serge Pavlov [Sat, 17 Feb 2018 10:21:33 +0000 (10:21 +0000)]
Report fatal error in the case of out of memory

This is partial recommit of r325224, reverted in 325227. The relevant
part of original comment is below.

Analysis of fails in the case of out of memory errors can be tricky on
Windows. Such error emerges at the point where memory allocation function
fails, but manifests itself when null pointer is used. These two points
may be distant from each other. Besides, next runs may not exhibit
allocation error.

Usual programming practice does not require checking result of 'operator
new' because it throws 'std::bad_alloc' in the case of allocation error.
However, LLVM is usually built with exceptions turned off, so 'new' can
return null pointer. This change installs custom new handler, which causes
fatal error in the case of out of memory. The handler is installed
automatically prior to call to 'main' during construction of a static
object defined in 'lib/Support/ErrorHandling.cpp'. If the application does
not use this file, the handler may be installed manually by a call to
'llvm::install_out_of_memory_new_handler', declared in
'include/llvm/Support/ErrorHandling.h".

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

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

6 years ago[AMDGPU] Return true in enableMultipleCopyHints().
Jonas Paulsson [Sat, 17 Feb 2018 10:00:28 +0000 (10:00 +0000)]
[AMDGPU]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: Stanislav Mekhanoshin, Tom Stellard.

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

6 years agoRevert "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
Quentin Colombet [Sat, 17 Feb 2018 03:05:33 +0000 (03:05 +0000)]
Revert "[MachineCopyPropagation] Extend pass to do COPY source forwarding"

This reverts commit r323991.

This commit breaks target that don't model all the register constraints
in TableGen. So far the workaround was to set the
hasExtraXXXRegAllocReq, but it proves that it doesn't cover all the
cases.
For instance, when mutating an instruction (like in the lowering of
COPYs) the isRenamable flag is not properly updated. The same problem
will happen when attaching machine operand from one instruction to
another.

Geoff Berry is working on a fix in https://reviews.llvm.org/D43042.

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

6 years ago[DAG, X86] Revert r324797, r324491, and r324359.
Chandler Carruth [Sat, 17 Feb 2018 02:26:25 +0000 (02:26 +0000)]
[DAG, X86] Revert r324797, r324491, and r324359.

Sadly, r324359 caused at least PR36312. There is a patch out for review
but it seems to be taking a bit and we've already had these crashers in
tree for too long. We're hitting this PR in real code now and are
blocked on shipping new compilers as a consequence so I'm reverting us
back to green.

Sorry for the churn due to the stacked changes that I had to revert. =/

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

6 years ago[InstSimplify] add vector select tests with undef elts in condition; NFC
Sanjay Patel [Sat, 17 Feb 2018 01:18:53 +0000 (01:18 +0000)]
[InstSimplify] add vector select tests with undef elts in condition; NFC

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

6 years ago[X86] Turn selects with constant condition into vector shuffles during DAG combine
Craig Topper [Sat, 17 Feb 2018 00:30:30 +0000 (00:30 +0000)]
[X86] Turn selects with constant condition into vector shuffles during DAG combine

Summary:
Currently we convert to shuffles during lowering. This moves it to DAG combine so hopefully we can get it done before type legalization has to extend the condition.

I believe in some cases we're creating SHRUNKBLENDs that end up with constant conditions because we see the extended on the condition and think its a dynamic selelect before DAG combine gets a chance to constant fold the extend. We could add combines to turn SHRUNKBLENDs with constant condition back to vselect. But it seemed like it might be better to just send them to shuffles as early as possible so they never get a chance to become SHRUNKBLENDs. This the reason some tests went from blends controlled by a constant pool load to just move.

Some of the constant pool entries changed because the sign_extend introduced by type legalization turned undef elements in select condition into 0s. While the select->shuffle used -1 in the shuffle mask. So now the shuffle lowering can do what it wants with them.

I'll remove the lowering code as a follow up. We might be able to simplify some of the pre-checks for SHRUNKBLEND as the FIXME there says.

Reviewers: spatel, RKSimon, efriedma, zvi, andreadb

Reviewed By: spatel

Subscribers: llvm-commits

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

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

6 years agoRemove "--full-shutdown" and instead use an environment variable LLD_IN_TEST.
Rui Ueyama [Fri, 16 Feb 2018 23:41:48 +0000 (23:41 +0000)]
Remove "--full-shutdown" and instead use an environment variable LLD_IN_TEST.

We are running lld tests with "--full-shutdown" option because we don't
want to call _exit() in lld if it is running tests. Regular shutdown
is needed for leak sanitizer.

This patch changes the way how we tell lld that it is running tests.
Now "--full-shutdown" is removed, and LLD_IN_TEST environment variable
is used instead.

This patch enables full shutdown on all ports, e.g. ELF, COFF and wasm.
Previously, we enabled it only for ELF.

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

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

6 years ago[ThinLTO] Allow indexing to request backend to ignore the module
Vitaly Buka [Fri, 16 Feb 2018 23:38:22 +0000 (23:38 +0000)]
[ThinLTO] Allow indexing to request backend to ignore the module

Summary:
Gold plugin does not add pass to ThinLTO modules without useful symbols.
In this case ThinLTO can't create corresponding index file and some features, like CFI,
cannot be processes by backed correctly without index.
Given that we don't need the backed output we can request it to avoid
processing the module. This is implemented by this patch using new
"SkipModuleByDistributedBackend" flag.

Reviewers: pcc, tejohnson

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

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

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

6 years agoAMDGPU: Remove unused private member of AMDGPUTargetELFStreamer
Konstantin Zhuravlyov [Fri, 16 Feb 2018 23:04:11 +0000 (23:04 +0000)]
AMDGPU: Remove unused private member of AMDGPUTargetELFStreamer

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

6 years agoRun these tests, the errors were old and not valid anymore.
Eric Christopher [Fri, 16 Feb 2018 23:02:28 +0000 (23:02 +0000)]
Run these tests, the errors were old and not valid anymore.

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

6 years agoRemove an unused function.
Eric Christopher [Fri, 16 Feb 2018 22:46:47 +0000 (22:46 +0000)]
Remove an unused function.

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

6 years agoSilence an unsigned vs signed compare warning.
Eric Christopher [Fri, 16 Feb 2018 22:46:45 +0000 (22:46 +0000)]
Silence an unsigned vs signed compare warning.

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

6 years ago[GISel]: Make GlobalISelEmitter rule prioritization compatible with selectionDAG
Aditya Nandakumar [Fri, 16 Feb 2018 22:37:15 +0000 (22:37 +0000)]
[GISel]: Make GlobalISelEmitter rule prioritization compatible with selectionDAG

This patch changes GlobalISelEmitter to rank patterns similar to how the
DAG does it (ie it computes a score for a pattern and adds the added
complexity to it).
This is so that the decision tree for GISelSelector remains compatible
with that of SelectionDAG.

https://reviews.llvm.org/D43270

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

6 years agoAMDGPU: Bring elf flags in sync with the spec
Konstantin Zhuravlyov [Fri, 16 Feb 2018 22:33:59 +0000 (22:33 +0000)]
AMDGPU: Bring elf flags in sync with the spec

- Add MACH flags
- Add XNACK flag
- Add reserved flags
- Minor cleanups in docs

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

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

6 years ago[Constant] add floating-point helpers for normal/finite-nz; NFC
Sanjay Patel [Fri, 16 Feb 2018 22:32:54 +0000 (22:32 +0000)]
[Constant] add floating-point helpers for normal/finite-nz; NFC

...and delete the equivalent local functiona from InstCombine.

These might be useful to other InstCombine files or other passes
and makes FP queries more similar to integer constant queries.

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

6 years agoMake sure we invoke ld64.lld and ld-wasm in the build directory.
Rui Ueyama [Fri, 16 Feb 2018 22:19:38 +0000 (22:19 +0000)]
Make sure we invoke ld64.lld and ld-wasm in the build directory.

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

6 years ago[X86] In lowerVSELECTtoVectorShuffle, don't map undef select condition to undef in...
Craig Topper [Fri, 16 Feb 2018 21:36:29 +0000 (21:36 +0000)]
[X86] In lowerVSELECTtoVectorShuffle, don't map undef select condition to undef in shuffle mask.

Undef in select condition means we should pick the element from one side or the other. An undef in a shuffle mask means pick any element from either source or worse.

I suspect by the time we get here most of the undefs in a constant vector have been removed by other things, but doing this for safety.

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

6 years agoAMDGPU: Bring processors and features in sync with the spec
Konstantin Zhuravlyov [Fri, 16 Feb 2018 21:26:25 +0000 (21:26 +0000)]
AMDGPU: Bring processors and features in sync with the spec

- Remove gfx800
- Make iceland gfx802
- Add xnack to gfx902

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

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

6 years agoTry again to fix the build.
Zachary Turner [Fri, 16 Feb 2018 21:10:34 +0000 (21:10 +0000)]
Try again to fix the build.

This doesn't repro with clang or MSVC so I'm just blindly
guessing.

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

6 years agoTry to fix broken build with some compilers.
Zachary Turner [Fri, 16 Feb 2018 20:58:25 +0000 (20:58 +0000)]
Try to fix broken build with some compilers.

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

6 years agoFix emission of PDB string table.
Zachary Turner [Fri, 16 Feb 2018 20:46:04 +0000 (20:46 +0000)]
Fix emission of PDB string table.

This was originally reported as a bug with the symptom being "cvdump
crashes when printing an LLD-linked PDB that has an S_FILESTATIC record
in it". After some additional investigation, I determined that this was
a symptom of a larger problem, and in fact the real problem was in the
way we emitted the global PDB string table. As evidence of this, you can
take any lld-generated PDB, run cvdump -stringtable on it, and it would
return no results.

My hypothesis was that cvdump could not *find* the string table to begin
with. Normally it would do this by looking in the "named stream map",
finding the string /names, and using its value as the stream index. If
this lookup fails, then cvdump would fail to load the string table.

To test this hypothesis, I looked at the name stream map generated by a
link.exe PDB, and I emitted exactly those bytes into an LLD-generated
PDB. Suddenly, cvdump could read our string table!

This code has always been hacky and we knew there was something we
didn't understand. After all, there were some comments to the effect of
"we have to emit strings in a specific order, otherwise things don't
work". The key to fixing this was finally understanding this.

The way it works is that it makes use of a generic serializable hash map
that maps integers to other integers. In this case, the "key" is the
offset into a buffer, and the value is the stream number. If you index
into the buffer at the offset specified by a given key, you find the
name. The underlying cause of all these problems is that we were using
the identity function for the hash. i.e. if a string's offset in the
buffer was 12, the hash value was 12. Instead, we need to hash the
string *at that offset*. There is an additional catch, in that we have
to compute the hash as a uint32 and then truncate it to uint16.

Making this work is a little bit annoying, because we use the same hash
table in other places as well, and normally just using the identity
function for the hash function is actually what's desired. I'm not
totally happy with the template goo I came up with, but it works in any
case.

The reason we never found this bug through our own testing is because we
were building a /parallel/ hash table (in the form of an
llvm::StringMap<>) and doing all of our lookups and "real" hash table
work against that. I deleted all of that code and now everything goes
through the real hash table. Then, to test it, I added a unit test which
adds 7 strings and queries the associated values. I test every possible
insertion order permutation of these 7 strings, to verify that it really
does work as expected.

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

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

6 years agoRemove useless comment - seems to be a copy+paste typo. NFCI
Simon Pilgrim [Fri, 16 Feb 2018 20:41:06 +0000 (20:41 +0000)]
Remove useless comment - seems to be a copy+paste typo. NFCI

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

6 years ago[AArch64] Fix BITCAST lowering crash
Evandro Menezes [Fri, 16 Feb 2018 20:00:57 +0000 (20:00 +0000)]
[AArch64] Fix BITCAST lowering crash

The data type is assumed to be a vector, but sometimes it is not, leading
to an assertion.

Add simple test-case to verify this.

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

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

6 years agoAMDGPU/SI: Extend promoting alloca to vector to arrays of up to 16 elements
Changpeng Fang [Fri, 16 Feb 2018 19:14:17 +0000 (19:14 +0000)]
AMDGPU/SI: Extend promoting alloca to vector to arrays of up to 16 elements

Summary:
  This patch extends the promotion of alloca to vector to the arrays of up to 16 elements. Also we introduce
an option, -disable-promote-alloca-to-vector, to switch promotion to vector off, if needed.

Reviewers:
  arsenm

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

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

6 years ago[X86] Only reorder srl/and on last DAG combiner run
Craig Topper [Fri, 16 Feb 2018 18:51:09 +0000 (18:51 +0000)]
[X86] Only reorder srl/and on last DAG combiner run

This seems to interfere with a target independent brcond combine that looks for the (srl (and X, C1), C2) pattern to enable TEST instructions. Once we flip, that combine doesn't fire and we end up exposing it to the X86 specific BT combine which causes us to emit a BT instruction. BT has lower throughput than TEST.

We could try to make the brcond combine aware of the alternate pattern, but since the flip was just a code size reduction and not likely to enable other combines, it seemed easier to just delay it until after lowering.

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

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

6 years ago[X86] Remove call to ShrinkDemandedCosntant from the SHRUNKBLEND creation code.
Craig Topper [Fri, 16 Feb 2018 18:34:46 +0000 (18:34 +0000)]
[X86] Remove call to ShrinkDemandedCosntant from the SHRUNKBLEND creation code.

We only run this code if know the condition isn't a constant vector. ShrinkDemandedConstant isn't going to find any different.

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

6 years ago[WebAssembly] MC: Make explicit our current lack of support for relocations against...
Sam Clegg [Fri, 16 Feb 2018 18:06:05 +0000 (18:06 +0000)]
[WebAssembly] MC: Make explicit our current lack of support for relocations against unnamed temporary symbols.

Add an explicit check before looking up symbol in SymbolIndices.
This was previously silently succeeding and returning zero for such
unnamed temporaries.

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

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

6 years ago[InstCombine] clean up fdiv-with-fdiv folds; NFCI
Sanjay Patel [Fri, 16 Feb 2018 17:52:32 +0000 (17:52 +0000)]
[InstCombine] clean up fdiv-with-fdiv folds; NFCI

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

6 years ago[InstCombine] add FMF to better show current fdiv fold behavior; NFC
Sanjay Patel [Fri, 16 Feb 2018 17:46:50 +0000 (17:46 +0000)]
[InstCombine] add FMF to better show current fdiv fold behavior; NFC

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

6 years agoFix signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Fri, 16 Feb 2018 17:26:59 +0000 (17:26 +0000)]
Fix signed/unsigned comparison warning. NFCI.

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

6 years ago[ThinLTO] Fix data race in test #2
Eugene Leviant [Fri, 16 Feb 2018 17:25:03 +0000 (17:25 +0000)]
[ThinLTO] Fix data race in test #2

Switched to the right option (-thinlto-threads)

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

6 years ago[ThinLTO] Fix data race in test
Eugene Leviant [Fri, 16 Feb 2018 16:56:33 +0000 (16:56 +0000)]
[ThinLTO] Fix data race in test

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

6 years agoFix signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Fri, 16 Feb 2018 16:52:50 +0000 (16:52 +0000)]
Fix signed/unsigned comparison warning. NFCI.

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

6 years ago[InstCombine] remove redundant debug info setting; NFC
Sanjay Patel [Fri, 16 Feb 2018 16:42:04 +0000 (16:42 +0000)]
[InstCombine] remove redundant debug info setting; NFC

The IRBuilder sets debuginfo in Insert(), so this was duplicating what already happened.

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

6 years ago[JumpThreading] PR36133 enable/disable DominatorTree for LVI analysis
Brian M. Rzycki [Fri, 16 Feb 2018 16:35:17 +0000 (16:35 +0000)]
[JumpThreading] PR36133 enable/disable DominatorTree for LVI analysis

Summary:
The LazyValueInfo pass caches a copy of the DominatorTree when available.
Whenever there are pending DominatorTree updates within JumpThreading's
DeferredDominance object we cannot use the cached DT for LVI analysis.
This commit adds the new methods enableDT() and disableDT() to LVI.
JumpThreading also sets the appropriate usage model before calling LVI
analysis methods.

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

Reviewers: sebpop, dberlin, kuhar

Reviewed by: sebpop, kuhar

Subscribers: uabelho, llvm-commits, aprantl, hiraditya, a.elovikov

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

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

6 years agoAMDGPU/SI: Turn off GPR Indexing Mode immediately after the interested instruction.
Changpeng Fang [Fri, 16 Feb 2018 16:31:30 +0000 (16:31 +0000)]
AMDGPU/SI: Turn off GPR Indexing Mode immediately after the interested instruction.

Summary:
  In the current implementation of GPR Indexing Mode when the index is of non-uniform, the s_set_gpr_idx_off instruction
is incorrectly inserted after the loop. This will lead the instructions with vgpr operands (v_readfirstlane for example) to read incorrect
vgpr.
 In this patch, we fix the issue by inserting s_set_gpr_idx_on/off immediately around the interested instruction.

Reviewers:
  rampitec

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

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

6 years ago[SelectionDAG] Enable SimplifyDemandedVectorElts support for simplifying shuffle...
Simon Pilgrim [Fri, 16 Feb 2018 16:22:14 +0000 (16:22 +0000)]
[SelectionDAG] Enable SimplifyDemandedVectorElts support for simplifying shuffle masks

Based off the DemandedElts mask the and UNDEF elements returned from the SimplifyDemandedVectorElts calls to the shuffle operands, we can attempt to simplify the shuffle mask.

I had to be very conservative here as accepting post-legalized shuffle masks could cause problems for targets that legalize UNDEF mask elements back to inrange values (PowerPC), similarly combining to identity shuffle masks could cause too much UNDEF information to disappear for later combines.

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

6 years ago[InstCombine] reduce code duplication; NFC
Sanjay Patel [Fri, 16 Feb 2018 16:13:20 +0000 (16:13 +0000)]
[InstCombine] reduce code duplication; NFC

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

6 years ago[X86][SSE] Allow float domain crossing if we are merging 2 or more shuffles and the...
Simon Pilgrim [Fri, 16 Feb 2018 14:57:25 +0000 (14:57 +0000)]
[X86][SSE] Allow float domain crossing if we are merging 2 or more shuffles and the root started as a float domain shuffle

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

6 years ago[PowerPC] Fix transform in table gen file causing UB
Nemanja Ivanovic [Fri, 16 Feb 2018 14:49:01 +0000 (14:49 +0000)]
[PowerPC] Fix transform in table gen file causing UB

Running a bootstrap build with UBSan produces a number of instances where
we have signed integer overflow due to this transform. Change the type to
long to prevent this UB on 64-bit build machines.

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

6 years ago[mips] Remove codegen support from some 16 bit instructions
Simon Dardis [Fri, 16 Feb 2018 13:34:23 +0000 (13:34 +0000)]
[mips] Remove codegen support from some 16 bit instructions

These instructions conflict with their full length variants
for the purposes of FastISel as they cannot be distingushed
based on the number and type of operands and predicates.

Reviewers: atanasyan

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

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

6 years ago[SelectionDAG] Add initial SimplifyDemandedVectorElts support for simplifying VSELECT...
Simon Pilgrim [Fri, 16 Feb 2018 12:21:08 +0000 (12:21 +0000)]
[SelectionDAG] Add initial SimplifyDemandedVectorElts support for simplifying VSELECT operands

This just adds a basic pass through - we can add constant selection mask handling in a future patch to fully match InstCombine.

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

6 years ago[Transforms] Propagate TBAA info in SROA
Ivan A. Kosarev [Fri, 16 Feb 2018 10:10:29 +0000 (10:10 +0000)]
[Transforms] Propagate TBAA info in SROA

Now that we have the new TBAA metadata format that is capable of
representing accesses to aggregates, we can propagate TBAA access
tags from memory setting and transferring intrinsics to load and
store instructions and vice versa.

Since SROA produces lots of new loads and stores on optimized
builds, this change significantly decreases the share of
undecorated memory accesses on such builds.

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

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

6 years ago[ARM] Return true in enableMultipleCopyHints().
Jonas Paulsson [Fri, 16 Feb 2018 09:51:01 +0000 (09:51 +0000)]
[ARM]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: Eli Friedman

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

6 years ago[LegalizeDAG] Fix legalization of SETCC
Mikhail Maltsev [Fri, 16 Feb 2018 09:35:16 +0000 (09:35 +0000)]
[LegalizeDAG] Fix legalization of SETCC

Summary:
Currently when expanding a SETCC node into a SELECT_CC, LLVM uses
an incorrect type for determining BooleanContent of the result. This
patch fixes the issue.

Fixes PR36079.

Reviewers: rogfer01, javed.absar, efriedma

Reviewed By: efriedma

Subscribers: llvm-commits

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

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

6 years ago[ARM] Materialise some boolean values to avoid a branch
Roger Ferrer Ibanez [Fri, 16 Feb 2018 09:23:59 +0000 (09:23 +0000)]
[ARM] Materialise some boolean values to avoid a branch

This patch combines some cases of ARMISD::CMOV for integers that arise in comparisons of the form

  a != b ? x : 0
  a == b ? 0 : x

and that currently (e.g. in Thumb1) are emitted as branches.

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

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

6 years ago[ThinLTO] Import global variables
Eugene Leviant [Fri, 16 Feb 2018 08:11:04 +0000 (08:11 +0000)]
[ThinLTO] Import global variables

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

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

6 years ago[X86] Allow CMOVs of constants to be sign extended from i32.
Craig Topper [Fri, 16 Feb 2018 07:16:15 +0000 (07:16 +0000)]
[X86] Allow CMOVs of constants to be sign extended from i32.

Sign extending i32 constants only requires a REX prefix as does widening the CMOV. This is cheaper than the explicit sign extend op.

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

6 years ago[X86] Don't zero_extend cmov up to i64, stop at i32.
Craig Topper [Fri, 16 Feb 2018 06:52:43 +0000 (06:52 +0000)]
[X86] Don't zero_extend cmov up to i64, stop at i32.

Zero extend from i32 to i64 is free. So extend from i16 to i32, and then use a free zero extend to finish.

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

6 years ago[APInt] Fix extractBits to correctly handle Result.isSingleWord() case.
Tim Shen [Fri, 16 Feb 2018 01:44:36 +0000 (01:44 +0000)]
[APInt] Fix extractBits to correctly handle Result.isSingleWord() case.

Summary: extractBits assumes that `!this->isSingleWord() implies !Result.isSingleWord()`, which may not necessarily be true. Handle both cases.

Reviewers: RKSimon

Subscribers: sanjoy, llvm-commits, hiraditya

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

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

6 years agoRemove brittle check lines from a test, NFC
Vedant Kumar [Fri, 16 Feb 2018 01:21:01 +0000 (01:21 +0000)]
Remove brittle check lines from a test, NFC

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

6 years ago[GVN] Partially revert debug info salvage change (r325063)
Vedant Kumar [Fri, 16 Feb 2018 01:15:20 +0000 (01:15 +0000)]
[GVN] Partially revert debug info salvage change (r325063)

In r325063, we salvaged debug values from dying instructions in
GVN::processBlock() and GVN::performScalarPRE().

The change in performScalarPRE(), while correct, is unhelpful. It
introduced a call to salvageDebugInfo() which was immediately followed
by a RAUW, meaning it prevented the RAUW from efficiently updating
dbg.value intrinsics.  This commit reverts the mistake and tightens up
the affected test case.

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

6 years ago[X86] Add the test cases that were supposed to go with r325287.
Craig Topper [Fri, 16 Feb 2018 00:39:05 +0000 (00:39 +0000)]
[X86] Add the test cases that were supposed to go with r325287.

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

6 years agoAllow 0 to be a valid value pruning interval in C LTO API. Value 0 will cause garbage...
Ekaterina Romanova [Thu, 15 Feb 2018 23:29:21 +0000 (23:29 +0000)]
Allow 0 to be a valid value pruning interval in C LTO API. Value 0 will cause garbage collector to run. This matches the behavior in C++ LTO API.

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

6 years ago[DCE] Salvage debug info from dead insts
Vedant Kumar [Thu, 15 Feb 2018 22:26:18 +0000 (22:26 +0000)]
[DCE] Salvage debug info from dead insts

This results in small increases in the size of the .debug_loc section
and the number of unique source variables in a stage2 build of opt.

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

6 years ago[AMDGPU] Combine adjacent waitcounts in a single strongest wait
Stanislav Mekhanoshin [Thu, 15 Feb 2018 22:03:55 +0000 (22:03 +0000)]
[AMDGPU] Combine adjacent waitcounts in a single strongest wait

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

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

6 years ago[Debugify] Don't check functions which were skipped
Vedant Kumar [Thu, 15 Feb 2018 21:28:38 +0000 (21:28 +0000)]
[Debugify] Don't check functions which were skipped

If no debug info was applied to a function, its debug info shouldn't be
checked (it doesn't have any :).

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

6 years agoDon't make PDBs by default in Release mode
Reid Kleckner [Thu, 15 Feb 2018 21:25:23 +0000 (21:25 +0000)]
Don't make PDBs by default in Release mode

Introduce the LLVM_ENABLE_PDB option so that users can request them
explicitly instead.

Add /OPT:REF and /OPT:ICF back, which /DEBUG disables by default.

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

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

6 years ago[X86][3DNOW] Teach decoder about AMD 3DNow! instrs
Rafael Auler [Thu, 15 Feb 2018 21:20:31 +0000 (21:20 +0000)]
[X86][3DNOW] Teach decoder about AMD 3DNow! instrs

Summary:
This patch makes the decoder understand old AMD 3DNow!
instructions that have never been properly supported in the X86
disassembler, despite being supported in other subsystems. Hopefully
this should make the X86 decoder more complete with respect to binaries
containing legacy code.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: llvm-commits, maksfb, bruno

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

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

6 years ago[opt] Port the debugify passes to the new pass manager
Vedant Kumar [Thu, 15 Feb 2018 21:14:36 +0000 (21:14 +0000)]
[opt] Port the debugify passes to the new pass manager

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

6 years ago[X86] Enable BT to be used in place of TEST for single bit checks under optsize
Craig Topper [Thu, 15 Feb 2018 20:27:30 +0000 (20:27 +0000)]
[X86] Enable BT to be used in place of TEST for single bit checks under optsize

We already do this for 64-bit when it won't fit into a 64-bit AND/TEST's immediate field. This adds an additional qualifier to do it for any single bit constant larger than 8-bits under optsize

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

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

6 years ago[DAGCombiner] Call ExtendUsesToFormExtLoad in (zext (and (load)))->(and (zextload...
Craig Topper [Thu, 15 Feb 2018 20:20:32 +0000 (20:20 +0000)]
[DAGCombiner] Call ExtendUsesToFormExtLoad in (zext (and (load)))->(and (zextload)) even when the and does not have multiple uses

Same for the sign extend case.

Currently we check for multiple uses on the binop. Then we call ExtendUsesToFormExtLoad to capture SetCCs that use the load. So we only end up finding any setccs when the and has additional uses and the load is used by a setcc. I don't think the and having multiple uses is relevant here. I think we should only be checking for the load having multiple uses.

This changes an NVPTX test because we now find that the load has a second use by a truncate, but ExtendUsesToFormExtLoad only looks at setccs it can extend. All other operations just check isTruncateFree. Maybe we should allow widening of an existing truncate even if its not free?

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

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

6 years ago[X86] Use btc/btr/bts to implement xor/and/or that affects a single bit in the upper...
Craig Topper [Thu, 15 Feb 2018 19:57:35 +0000 (19:57 +0000)]
[X86] Use btc/btr/bts to implement xor/and/or that affects a single bit in the upper 32-bits of a 64-bit operation.

We can't fold a large immediate into a 64-bit operation. But if we know we're only operating on a single bit we can use the bit instructions.

For now only do this for optsize.

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

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

6 years ago[Coroutines] Don't move stores for allocator args
Brian Gesiak [Thu, 15 Feb 2018 19:31:45 +0000 (19:31 +0000)]
[Coroutines] Don't move stores for allocator args

Summary:
The behavior described in Coroutines TS `[dcl.fct.def.coroutine]/7`
allows coroutine parameters to be passed into allocator functions.
The instructions to store values into the alloca'd parameters must not
be moved past the frame allocation, otherwise uninitialized values are
passed to the allocator.

Test Plan: `check-llvm`

Reviewers: rsmith, GorNishanov, eric_niebler

Reviewed By: GorNishanov

Subscribers: compnerd, EricWF, llvm-commits

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

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

6 years ago[ARM] Fix redirect in inline assembly test
Pablo Barrio [Thu, 15 Feb 2018 19:17:55 +0000 (19:17 +0000)]
[ARM] Fix redirect in inline assembly test

Summary: Fix silly mistake in a test

Reviewers: gkistanova, apilipenko

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

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

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

6 years ago[SCCP] Test that constant propagation updates debug info, NFC
Vedant Kumar [Thu, 15 Feb 2018 19:13:04 +0000 (19:13 +0000)]
[SCCP] Test that constant propagation updates debug info, NFC

This extends an existing test to check that SCCP updates the operands of
relevant dbg.value instructions as it does its work.

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

6 years ago[Utils] salvageDI: Add a comment and move a call earlier, NFC
Vedant Kumar [Thu, 15 Feb 2018 19:13:03 +0000 (19:13 +0000)]
[Utils] salvageDI: Add a comment and move a call earlier, NFC

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

6 years ago[X86] Add test cases for opportunities for using BT instead of TEST under optsize.
Craig Topper [Thu, 15 Feb 2018 19:00:11 +0000 (19:00 +0000)]
[X86] Add test cases for opportunities for using BT instead of TEST under optsize.

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

6 years agoSilence warning about unused private variable.
Zachary Turner [Thu, 15 Feb 2018 18:46:59 +0000 (18:46 +0000)]
Silence warning about unused private variable.

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

6 years agoCall FlushFileBuffers on output files.
Zachary Turner [Thu, 15 Feb 2018 18:36:10 +0000 (18:36 +0000)]
Call FlushFileBuffers on output files.

There is a latent Windows kernel bug, the exact trigger
conditions are not well understood, which can cause a file
to be correctly written, but unable to be correctly read.

The workaround appears to be simply calling FlushFileBuffers.

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

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

6 years ago[WebAssembly] Restore "*-wasm" tests.
Dan Gohman [Thu, 15 Feb 2018 18:05:16 +0000 (18:05 +0000)]
[WebAssembly] Restore "*-wasm" tests.

Even though "...-wasm" is now the default for wasm, it's still
desirable to test this form.

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

6 years ago[X86][SSE] Add saturated truncation tests for storing illegal v8i8 types
Simon Pilgrim [Thu, 15 Feb 2018 17:48:34 +0000 (17:48 +0000)]
[X86][SSE] Add saturated truncation tests for storing illegal v8i8 types

Tests showing missing opportunities to use PACK instructions in cases where we need to truncate to illegal types for stores

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

6 years agoRecommit [Hexagon] Make the vararg handling a bit more robust
Krzysztof Parzyszek [Thu, 15 Feb 2018 17:20:07 +0000 (17:20 +0000)]
Recommit [Hexagon] Make the vararg handling a bit more robust

Use the FunctionType of the callee when it's available. It may not be
available for synthetic calls to functions specified by external symbols.

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

6 years ago[SLP] Fix the test for the reversed stores, NFC.
Alexey Bataev [Thu, 15 Feb 2018 17:11:50 +0000 (17:11 +0000)]
[SLP] Fix the test for the reversed stores, NFC.

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

6 years agobpf: fix a bug in dag2dag optimization for loads from readonly section
Yonghong Song [Thu, 15 Feb 2018 17:06:45 +0000 (17:06 +0000)]
bpf: fix a bug in dag2dag optimization for loads from readonly section

The reference '&' is missing in the function parameter. If there are
back-to-back optimizations in terms of dag node list like below:
  t29: i64,ch = load<LD4[bitcast (%struct.test_t* @test.t to i8*)+12](dereferenceable), zext from i32> t3, t43, undef:i64
  t34: i64,ch = load<LD4[bitcast (%struct.test_t* @test.t to i8*)](dereferenceable), zext from i32> t3, t41, undef:i64
The bug will trigger a segfault for the added test case remove_truncate_5.ll:
  LLVMSymbolizer: error reading file: No such file or directory
  #0 0x000000000241c4d9 (llc+0x241c4d9)
  #1 0x000000000241c56a (llc+0x241c56a)
  #2 0x000000000241aa50 (llc+0x241aa50)
  ...
  #22 0x0000000000fd5edf (llc+0xfd5edf)
  #23 0x00007f0fe03bec05 __libc_start_main (/lib64/libc.so.6+0x21c05)
  #24 0x0000000000fd3e69 (llc+0xfd3e69)
  ...
  Segmentation fault

Signed-off-by: Yonghong Song <yhs@fb.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325267 91177308-0d34-0410-b5e6-96231b3b80d8

6 years agoRevert "[Hexagon] Make the vararg handling a bit more robust"
Krzysztof Parzyszek [Thu, 15 Feb 2018 16:57:44 +0000 (16:57 +0000)]
Revert "[Hexagon] Make the vararg handling a bit more robust"

This is breaking lit tests.

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

6 years ago[SLP] Added test for reversed stores, NFC.
Alexey Bataev [Thu, 15 Feb 2018 16:56:49 +0000 (16:56 +0000)]
[SLP] Added test for reversed stores, NFC.

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

6 years ago[InstCombine] use m_OneUse to reduce code; NFC
Sanjay Patel [Thu, 15 Feb 2018 16:30:10 +0000 (16:30 +0000)]
[InstCombine] use m_OneUse to reduce code; NFC

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

6 years ago[InstCombine] test fdiv folds better; NFC
Sanjay Patel [Thu, 15 Feb 2018 16:28:15 +0000 (16:28 +0000)]
[InstCombine] test fdiv folds better; NFC

We had redundant tests, but no tests for extra uses or vectors.
'fast' is an overly conservative requirement for these folds.

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

6 years ago[Hexagon] Make the vararg handling a bit more robust
Krzysztof Parzyszek [Thu, 15 Feb 2018 16:24:30 +0000 (16:24 +0000)]
[Hexagon] Make the vararg handling a bit more robust

The FunctionType of the callee is always available, even if the Function
of the callee is not. Use that to get the number of fixed parameters.

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

6 years ago[CodeGen] Separate MBB metadata from instructions in -debug printing
Francis Visoiu Mistrih [Thu, 15 Feb 2018 16:23:59 +0000 (16:23 +0000)]
[CodeGen] Separate MBB metadata from instructions in -debug printing

Add an empty line after 'liveins:', 'successors:', or '; predecessors:',
the one that ends up to be the last one.

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

6 years ago[Hexagon] Fix lowering of formal arguments after r324737
Krzysztof Parzyszek [Thu, 15 Feb 2018 15:47:53 +0000 (15:47 +0000)]
[Hexagon] Fix lowering of formal arguments after r324737

Lowering of formal arguments needs to be aware of vararg functions.

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

6 years ago[SelectionDAG] Pull out repeated Op.getOpcode(). NFCI.
Simon Pilgrim [Thu, 15 Feb 2018 15:31:00 +0000 (15:31 +0000)]
[SelectionDAG] Pull out repeated Op.getOpcode(). NFCI.

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