Commit Graph

129751 Commits

Author SHA1 Message Date
Sanjay Patel
cd3afd524c add tests to show missing optimization from D18230
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265431 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 18:09:36 +00:00
Sanjay Patel
d8f98f3e4e add example usage and workflow to --help output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 18:00:47 +00:00
David Blaikie
037ba978f5 llvm-dwp: Simplify hashing code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 17:51:40 +00:00
Sanjay Patel
503ff5bcee [InstCombine] regenerate checks
utils/update_test_checks.py was improved with:
http://reviews.llvm.org/rL265414
to CHECK-NEXT the first line of the IR function. This ensures that nothing bad
has happened before that.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265417 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 17:24:54 +00:00
Sanjay Patel
f87ded946e [x86] regenerate checks
utils/update_test_checks.py was improved with:
http://reviews.llvm.org/rL265414
to include the first line of the function (expected to be
a comment line). This ensures that nothing bad has happened
before the first actual line of checked asm. It also matches
the existing behavior of the old script.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 17:12:19 +00:00
JF Bastien
01d8b6a2ac WebAssembly: fix cfg-stackify test
It was broken by reshuffling induced by r265397 'Don't delete empty preheaders in CodeGenPrepare if it would create a critical edge'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 17:01:52 +00:00
Sanjay Patel
4d9b8c9ce1 check or check-next the first line of the function too
We could make this an option if people don't like it. 
But since part of the reason for using a script to generate
checks is to prevent lazy checking that lets bugs crawl 
through, let's have the script check the first line too. 

For asm tests, it ensures that nothing unexpected has 
happened before the first line of asm. This matches the
existing behavior of update_llc_test_checks.py. 

More discussion in PR22897:
https://llvm.org/bugs/show_bug.cgi?id=22897



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 16:49:07 +00:00
Valery Pykhtin
89372a56d6 [TableGen] AsmMatcherEmitter.cpp: replace a sequence of "if" to "switch" in emitValidateOperandClass.
Differential Revision: http://reviews.llvm.org/D18394

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 16:18:16 +00:00
Jacques Pienaar
148a26a80b [lanai] LanaiSetflagAluCombiner more conservative
Summary: LanaiSetflagAluCombiner could previously combine instructions across basic building blocks even when not legal. Make the LanaiSetflagAluCombiner more conservative to avoid this.

Reviewers: eliben

Subscribers: joker.eph, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 16:18:13 +00:00
Sam Parker
e0d1a47716 [ARM] Cleanup of smul and smla instruction descriptions
Removed the SDNode argument passed to the AI_smul and AI_smla multiclass
definitions as they are always mul.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 16:01:25 +00:00
Konstantin Zhuravlyov
e1d66f4ce3 [AMDGPU] Emit linkonce and linkonce_odr symbols
Differential Revision: http://reviews.llvm.org/D18726


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 16:00:58 +00:00
Haicheng Wu
7b0de34979 [BlockPlacement] Remove an unnecessary continue
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 15:37:08 +00:00
Rafael Espindola
00d9a04525 Use ArrayRef for contiguous areas in ELF. NFC.
This just simplifies the code a bit. More so in lld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 14:47:22 +00:00
Chuang-Yu Cheng
8d7c100e12 Add missing test for the "Don't delete empty preheaders" added in r265397
Author: Tom Jablin (tjablin)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265402 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 14:21:32 +00:00
Rafael Espindola
c5c3d28dda Centralize the definition of a few types. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 14:10:18 +00:00
Chuang-Yu Cheng
afa4f41e9c Don't delete empty preheaders in CodeGenPrepare if it would create a critical edge
Presently, CodeGenPrepare deletes all nearly empty (only phi and branch)
basic blocks. This pass can delete loop preheaders which frequently creates
critical edges. A preheader can be a convenient place to spill registers to
the stack. If the entrance to a loop body is a critical edge, then spills
may occur in the loop body rather than immediately before it. This patch
protects loop preheaders from deletion in CodeGenPrepare even if they are
nearly empty.

Since the patch alters the CFG, it affects a large number of test cases.
In most cases, the changes are merely cosmetic (basic blocks have different
names or instruction orders change slightly). I am somewhat concerned about
the test/CodeGen/Mips/brdelayslot.ll test case. If the loop preheader is not
deleted, then the MIPS backend does not take advantage of a branch delay
slot. Consequently, I would like some close review by a MIPS expert.

The patch also partially subsumes D16893 from George Burgess IV. George
correctly notes that CodeGenPrepare does not actually preserve the dominator
tree. I think the dominator tree was usually not valid when CodeGenPrepare
ran, but I am using LoopInfo to mark preheaders, so the dominator tree is
now always valid before CodeGenPrepare.

Author: Tom Jablin (tjablin)
Reviewers: hfinkel george.burgess.iv vkalintiris dsanders kbarton cycheng

http://reviews.llvm.org/D16984

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265397 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 14:06:20 +00:00
Peter Zotov
2b8aed70d6 [llvm-c] Expose LLVM{Get,Set}ModuleIdentifier
Patch by Nicole Mazzuca <npmazzuca@gmail.com>.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265394 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 13:56:59 +00:00
Simon Dardis
521f98ca01 [mips] MIPSR6 Compact jump support
This patch adds support for compact jumps similiar to the previous compact
branch support for MIPSR6. Unlike compact branches, compact jumps do not
have a forbidden slot.

As MipsInstrInfo::getEquivalentCompactForm can determine the correct
expansion for jumps and branches for both microMIPS and MIPSR6, remove the
unnecessary distinction in the delay slot filler.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 12:50:29 +00:00
Justin Holewinski
515b87030b [NVPTX] Handle ldg created from sign-/zero-extended load
Reviewers: jingyue

Subscribers: jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 12:38:01 +00:00
David L Kreitzer
51dcabbf7c Adds the ability to use an epilog remainder loop during loop unrolling and makes
this the default behavior.

Patch by Evgeny Stupachenko (evstupac@gmail.com).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 12:19:35 +00:00
Tamas Berghammer
2b45afffa0 Set the thumb flag for thumb symbols coming from an ELF file
Without setting the flag there is no way to determine if a symbol
points to an arm or to a thumb function as the LSB of the address
masked out in all getter function.

Note: Currently the thumb flag is only used for MachO files so
adding a test to this change is not possible. It will be used
by the upcoming fix for llvm-objdump for disassembling thumb
functions what is easily testable.

Differential revision: http://reviews.llvm.org/D17956

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 12:11:40 +00:00
Haojian Wu
f0a7cfdba2 Add parentheses around && within || to avoid compiler warning message.
Summary: The assert code is introduced by r265370.

Reviewers: bkramer

Subscribers: tejohnson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 09:07:47 +00:00
Dmitry Polukhin
51a06a2c66 [IFUNC] Use GlobalIndirectSymbol when aliases and ifuncs have something similar
Second part extracted from http://reviews.llvm.org/D15525

Use GlobalIndirectSymbol in all cases when aliases and ifuncs have
something in common.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 08:47:51 +00:00
Etienne Bergeron
bf3b2ca04c [Support] Fix an invalid character escaping in string literal (unittest).
Summary:
A character within a string literal is not escaped correctly.
In this case, there is no semantic change because the invalid character turn out to be NUL anyway.

note: "\0x12" is equivalent to {0, 'x', '1', '2'} and not { 12 }.

This issue was found by clang-tidy.

Reviewers: rnk

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 01:46:26 +00:00
Teresa Johnson
3890d33905 [ThinLTO] Refactor some common code into getGlobalValueInfo method (NFC)
Refactor common code that queries the ModuleSummaryIndex for a value's
GlobalValueInfo struct into getGlobalValueInfo helper methods, which
will also be used by D18763.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 00:40:16 +00:00
JF Bastien
f90bc5f1a3 Docs: dampen story time for atomics
Story time was nice a few years ago, but by now it's nice to state how things are, rather than explain the diff from ye olden atomic history. These were dark times.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 00:31:25 +00:00
JF Bastien
3f3bbdbcf9 Lanai: fix -Wsign-compare warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 00:20:27 +00:00
Teresa Johnson
218731256d Don't fold double constant to an integer if dest type not integral
Summary:
I encountered this issue when constant folding during inlining tried to
fold away a bitcast of a double to an x86_mmx, which is not an integral
type. The test case exposes the same issue with a smaller code snippet
during early CSE.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 23:50:46 +00:00
JF Bastien
e4b6431bdd Lanai: fix -Wpedantic warnings
Extra semicolon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 23:47:30 +00:00
Reid Kleckner
3918651b89 Fix non-determinism in order of LLVM attributes
We were using array_pod_sort on an array of type 'Attribute', which
wraps a pointer to AttributeImpl. For the most part this didn't matter
because the printing code prints enum attributes in a defined order, but
integer attributes such as 'align' and 'dereferenceable' were not
ordered.

Furthermore, AttributeImpl::operator< was broken for integer attributes.
An integer attribute is a kind and an integer value, and both pieces
need to be compared.

By fixing the comparison operator, we can go back to std::sort, and
things look good now.  This should fix clang arm-swiftcall.c test
failures on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265361 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 23:06:05 +00:00
Sanjay Patel
287028499f use range loop; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 23:05:06 +00:00
Sanjay Patel
952fa5f82c fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 22:45:56 +00:00
Amaury Sechet
45cace0d9a Style update in Core.h/Core.cpp . NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 22:00:25 +00:00
Justin Bogner
52bd5a737e Revert "CodeGen: Remove dead code in TailDuplicate"
It seems this is reachable after all. It hit on 7zip-benchmark in lnt
on ppc64:

  http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/2317

This reverts r265347.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265352 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 21:41:54 +00:00
Matthias Braun
bc7742294b MachineScheduler: Ignore COPYs with undef/dead op in CopyConstrain mutation.
There is no problem with the code today, but the fix will avoid a crash
in test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll once the
DetectDeadLanes pass is added.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265351 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 21:23:46 +00:00
Matthias Braun
7b7e7134b0 test: Always treat .mir files as tests even outside of CodeGen/MIR
We missed a handful of .mir tests that existed outside the
test/CodeGen/MIR directory.

Also fix the three powerpc .mir tests that nobody noticed were broken.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 21:23:44 +00:00
Teresa Johnson
ee68481a50 Clean up calls to WriteBitcodeToFile (NFC)
Remove a default parameter value being passed unnecessarily, which
also reduces the changes required when this parameter is changed in
D18763.

Document the remaining non-default bool value passed for another
parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 21:19:31 +00:00
Justin Bogner
e393968900 CodeGen: Remove dead code in TailDuplicate
I noticed that this isn't covered by our existing tests and spent some
time trying to come up with an example it actually hits. I tried hand
rolling something based on the explanation in the comment, but couldn't
get anything that didn't abort tail duplication earlier for one reason
or another.

Then, I tried cranking tail-dup-size cranked up so this would fire
more and ran a bootstrap of clang and the nightly test suite - those
don't hit this either.

This reverts r132816 and replaces it with an assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265347 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 21:11:40 +00:00
Teresa Johnson
566a35a121 clang-format llvm-as.cpp (NFC)
This reduces unrelated changes in other patches (such as D18763) when
changes to this file are clang formatted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 21:06:17 +00:00
Hans Wennborg
5ef7ab8d71 Re-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)"
The original commit miscompiled things on 32-bit Windows, e.g. a Clang
boostrap. It turns out that mergeSPUpdates() was a bit too generous in
what it interpreted as a stack adjustment, causing the following code:

        addl    $12, %esp
        leal    -4(%ebp), %esp

To be "optimized" into simply:

        addl    $8, %esp

This commit tightens up mergeSPUpdates() and includes a new test
(test14 in movtopush.ll) for this situation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 21:02:46 +00:00
Zia Ansari
06022d8db1 Enable unroll for constant bound loops when TripCount is not modulo of unroll factor, reducing it to maximum power-of-2 that satisfies threshold limit.
Commit for Evgeny Stupachenko (evstupac@gmail.com)

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265337 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 19:24:46 +00:00
Teresa Johnson
7e69f9988e Fix bot errors from r265327, exact GUID which depends on path
E.g. http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/21919

The source file path name will affect exact GUID, don't try to match
exact value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 19:11:00 +00:00
Sean Silva
1f756b137e Beef up some dllexport tests.
Adds some dllexport tests to verify that:
  - Variables in bss are exported appropriately
  - Non-dllexport symbols aliased to dllexport symbols are not exported
  - Symbols declared as dllexport but are not defined are not exported

We plan to enable dllimport/dllexport support for the PS4, and these
additional tests are for points we noticed in our internal testing.

Patch by Warren Ristow!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 19:10:55 +00:00
Chandler Carruth
f0a58295f3 Revert r263460: [SpillPlacement] Fix a quadratic behavior in spill placement.
That commit looks wonderful and awesome. Sadly, it greatly exacerbates
PR17409 and effectively regresses build time for a lot of (very large)
code when compiled with ASan or MSan.

We thought this could be fixed forward by landing D15302 which at last
fixes that PR, but some issues were discovered and it looks like that
got reverted, so reverting this as well temporarily. As soon as the fix
for PR17409 lands and sticks, we should re-land this patch as it won't
trigger more significant test cases hitting that bug.

Many thanks to Quentin and Wei here as they're doing all the awesome
hard work!!!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 18:57:50 +00:00
Betul Buyukkurt
d16375833a [PGO] Avoid instrumenting direct callee's at value sites.
Direct callees' that are cast to other function prototypes,
show up in the Call/Invoke instructions as ConstantExpr's.
Currently llvm::CallSite's getCalledFunction() fails
to return the callees in such expressions as direct calls.
Value profiling should avoid instrumenting such cases. Mostly NFC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 18:56:36 +00:00
Matthias Braun
bac1dd9d54 ARM, AArch64, X86: Check preserved registers for tail calls.
We can only perform a tail call to a callee that preserves all the
registers that the caller needs to preserve.

This situation happens with calling conventions like preserver_mostcc or
cxx_fast_tls. It was explicitely handled for fast_tls and failing for
preserve_most. This patch generalizes the check to any calling
convention.

Related to rdar://24207743

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 18:56:13 +00:00
Teresa Johnson
0a41a31987 [ThinLTO] Add option to dump value name to GUID mapping
Summary:
Useful for debugging since we lose this correlation after the permodule
summary/VST is read and until we later materialize source modules in the
function importer.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 18:52:58 +00:00
Teresa Johnson
39af64d791 [ThinLTO] Augment FunctionImport dump with value name to GUID map
Summary:
To aid in debugging, dump out the correlation between value names and
GUID for each source module when it is materialized. This will make it
easier to comprehend the earlier summary-based function importing debug
trace which only has access to and prints the GUIDs.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 18:52:23 +00:00
Sanjay Patel
3555f1fd3b fix documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 18:25:06 +00:00
Brendon Cahoon
3188534401 [DependenceAnalysis] Check if result of getConstantPart is null
A seg-fault occurs due to a reference of a null pointer, which is
the value returned by getConstantPart. This function returns
null if the constant part is not found. The code that calls this
function needs to check for the null return value.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-04 18:13:18 +00:00