Commit Graph

129463 Commits

Author SHA1 Message Date
Sanjay Patel
7735b5a030 [InstCombine] use FileCheck for better checking
(testing script for autogeneration of check lines)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264432 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 18:01:37 +00:00
Sanjay Patel
07119337d8 [InstCombine] use FileCheck for better checking
(testing script for autogeneration of check lines)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264431 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 18:01:23 +00:00
Sanjay Patel
4afa29cc27 [InstCombine] use FileCheck for better checking
(testing script for autogeneration of check lines)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 18:01:04 +00:00
Reid Kleckner
b951e5006e Consider regmasks when computing register-based DBG_VALUE live ranges
Now register parameters that aren't saved to the stack or CSRs are
considered dead after the first call. Previously the debugger would show
whatever was in the register.

Fixes PR26589

Reviewers: aprantl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:54:46 +00:00
Lang Hames
215b61f08e [Kaleidoscope] Rename Error -> LogError in Chapters 2-5.
This keeps the naming consistent with Chapters 6-8, where Error was renamed to
LogError in r264426 to avoid clashes with the new Error class in libSupport.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:41:26 +00:00
Lang Hames
d7b240afb9 [Kaleidoscope] Fix 'Error' name clashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:33:32 +00:00
Lang Hames
3e22297684 [Object] Start threading Error through MachOObjectFile construction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:25:34 +00:00
Sanjay Patel
2ff352963d [InstCombine] consolidate regression tests of the ancients (2002)
Testing out the check-generator-script that's now in the utils folder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:16:32 +00:00
Sanjay Patel
1ffcfe8d01 fix IR function name regex to allow hyphens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:00:12 +00:00
Adrian Prantl
426cfc1b15 Document the purpose of this testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264421 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 16:49:57 +00:00
Jun Bum Lim
16303e867d Revert "[SetVector] Add erase() method"
This reverts commit r264414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264420 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 16:49:16 +00:00
Hemant Kulkarni
f89f7a25a7 Fix Narrowing conversion warning introduced by r264415
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 16:37:03 +00:00
Mehdi Amini
ff9b2316f1 Improve StringMap unittests: reintroduce move count, but shield against std::pair internals
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 16:36:00 +00:00
Mehdi Amini
df98afd142 Ensure that the StringMap does not grow during the test for pre-allocation/reserve
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264416 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 16:09:34 +00:00
Hemant Kulkarni
7a9b28aa44 [llvm-readobj] Impl GNU style program headers print
readelf -lW

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264415 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 16:04:48 +00:00
Jun Bum Lim
c9a0644f8a [SetVector] Add erase() method
Summary:
Add erase() which returns an iterator pointing to the next element after the
erased one. This makes it possible to erase selected elements while iterating
over the SetVector :
  while (I != E)
    if (test(*I))
      I = SetVector.erase(I);
    else
      ++I;

Reviewers: qcolombet, mcrosier, MatzeB, dblaikie

Subscribers: dberlin, dblaikie, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 16:04:43 +00:00
Mehdi Amini
4f6a396142 Disable counting the number of move in the unittest, it seems to rely on move-construction elision
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 15:46:14 +00:00
Jonas Paulsson
808bd66d10 [SystemZ] Remove isBranch and isTerminator flags on BRCT and BRCTG.
The BranchUnaryRI instruction class already sets these flags.

Reviewed by Ulrich Weigand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264411 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 15:42:30 +00:00
Duncan P. N. Exon Smith
d49b92d802 Revert "Bitcode: Collect all MDString records into a single blob"
This reverts commit r264409 since it failed to bootstrap:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/8302/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264410 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 15:22:27 +00:00
Duncan P. N. Exon Smith
d7084fcebd Bitcode: Collect all MDString records into a single blob
Optimize output of MDStrings in bitcode.  This emits them in big blocks
(currently 1024) in a pair of records:
  - BULK_STRING_SIZES: the sizes of the strings in the block, and
  - BULK_STRING_DATA: a single blob, which is the concatenation of all
    the strings.

Inspired by Mehdi's similar patch, http://reviews.llvm.org/D18342, this
should (a) slightly reduce bitcode size, since there is less record
overhead, and (b) greatly improve reading speed, since blobs are super
cheap to deserialize.

I needed to add support for blobs to streaming input to get the test
suite passing.
  - StreamingMemoryObject::getPointer reads ahead and returns the
    address of the blob.
  - To avoid a possible reallocation of StreamingMemoryObject::Bytes,
    BitstreamCursor::readRecord needs to move the call to JumpToEnd
    forward so that getPointer is the last bitstream operation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264409 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 14:40:18 +00:00
Chad Rosier
696350790f [AArch64] Fix typo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264408 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 14:37:43 +00:00
David L Kreitzer
88ef819968 Enable non-power-of-2 #pragma unroll counts.
Patch by Evgeny Stupachenko.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264407 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 14:24:52 +00:00
Simon Pilgrim
af50900764 [X86][SSE] Don't duplicate Lower256IntArith functionality in LowerShift. NFC.
LowerShift was using the same code as Lower256IntArith to split 256-bit vectors into 2 x 128-bit vectors, so now we just call Lower256IntArith.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264403 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 14:17:54 +00:00
Elena Demikhovsky
375da745c2 fixed typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264395 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 10:08:36 +00:00
Mehdi Amini
14a12ee56f Fix windows build for sys::fs:file_status Access Time added in r264392
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264393 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 07:40:52 +00:00
Mehdi Amini
782eed710d Add lastAccessedTime to file_status
Differential Revision: http://reviews.llvm.org/D18456

This is a re-commit of r264387 and r264388 after fixing a typo.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 07:30:21 +00:00
Mehdi Amini
9faa82c93c Fix perfect forwarding for StringMap
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 07:11:31 +00:00
Mehdi Amini
389a4db948 Revert "Add lastAccessedTime to file_status"
This reverts commit r264387.
Bots are broken in various ways, I need to take one commit at a time...

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 06:51:43 +00:00
Mehdi Amini
f8b3df25f2 Revert "Fix windows build for sys::fs:file_status Access Time added in r264387"
This reverts commit r264388.
Bots are broken in various ways, I need to take one commit at a time...

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 06:43:22 +00:00
Mehdi Amini
b47cf88ea5 Fix windows build for sys::fs:file_status Access Time added in r264387
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 06:06:44 +00:00
Mehdi Amini
b474b03196 Add lastAccessedTime to file_status
Reviewers: silvas

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264387 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:58:11 +00:00
Mehdi Amini
256567583d Query the StringMap only once when creating MDString (NFC)
Summary:
Loading IR with debug info improves MDString::get() from 19ms to 10ms.
This is a rework of D16597 with adding an "emplace" method on the StringMap
to avoid requiring the MDString move ctor to be public.

Reviewers: dexonsmith

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:58:04 +00:00
Mehdi Amini
bf941ea066 Adjust initial size in StringMap constructor to guarantee no grow()
Summary:
StringMap ctor accepts an initialize size, but expect it to be
rounded to the next power of 2. The ctor can handle that directly
instead of expecting clients to round it. Also, since the map will
resize itself when 75% full, take this into account an initialize
a larger initial size to avoid any growth.

Reviewers: dblaikie

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264385 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:57 +00:00
Mehdi Amini
9ed5a8271e Fix DenseMap::reserve(): the formula was wrong
Summary:
Just running the loop in the unittests for a few more iterations
(till 48) exhibit that the condition on the limit was not handled
properly in r263522.
Rewrite the test to use a class to count move/copies that happens
when inserting into the map.
Also take the opportunity to refactor the logic to compute the
number of buckets required for a given number of entries in the map.
Use this when constructing a DenseMap with a desired size given to
the constructor (and add a tests for this).

Reviewers: dblaikie

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:52 +00:00
Mehdi Amini
c165b13f7b StringMap: reserve appropriate size when initializing from an initializer list
From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:47 +00:00
Mehdi Amini
facd1245e4 Add GUID/getGlobalIdentifier() non-static API to global value
Summary:
These are just helpers calling their static counter part to
simplify client code.

Reviewers: tejohnson

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264382 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 05:57:41 +00:00
Duncan P. N. Exon Smith
93e5944cd8 Bitcode: Use std::stable_partition for reproducible builds
Caught by inspection while working on partitioning metadata.  It's nice
to produce the same bitcode if you run the compiler twice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264381 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 02:20:28 +00:00
Duncan P. N. Exon Smith
f206a2c034 Bitcode: Stop using MODULE_CODE_METADATA_VALUES
The motivation for MODULE_CODE_METADATA_VALUES was to enable an
-flto=thin scheme where:

 1. First, one function is cherry-picked from a bitcode file.
 2. Later, another function is cherry-picked.
 3. Later, ...
 4. Finally, the metadata needed by all the previous functions is
    loaded.

This was abandoned in favour of:

 1. Calculate the superset of functions needed from a Module.
 2. Link all functions at once.

Delayed metadata reading no longer serves a purpose.  It also adds
a few complication, since we can't count on metadata being properly
parsed when exiting the BitcodeReader.  After discussing with Teresa, we
agreed to remove it.

The code that depended on this was removed/updated in r264326.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264378 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:29:50 +00:00
Matt Arsenault
bb366db643 AMDGPU: Cost model for basic integer operations
This resolves bug 21148 by preventing promotion to
i64 induction variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:16:40 +00:00
Hans Wennborg
6a62eecdb6 X86: Use push-pop for materializing 8-bit immediates for minsize (take 2)
This is the same as r255936, with added logic for avoiding clobbering of the
red zone (PR26023).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264375 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:10:56 +00:00
Matt Arsenault
359a7d918e AMDGPU: Partially implement getArithmeticInstrCost for FP ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 01:00:32 +00:00
Duncan P. N. Exon Smith
7ad5ddeb72 IR: Stop upgrading !llvm.loop attachments via MDString
Remove logic to upgrade !llvm.loop by changing the MDString tag
directly.  This old logic would check (and change) arbitrary strings
that had nothing to do with loop metadata.  Instead, check !llvm.loop
attachments directly, and change which strings get attached.

Rather than updating the assembly-based upgrade, drop it entirely.  It
has been quite a while since we supported upgrading textual IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:56:13 +00:00
Duncan P. N. Exon Smith
1adb3816e9 IR: Reserve an MDKind for !llvm.loop; NFC
This reserves an MDKind for !llvm.loop, which allows callers to avoid a
string-based lookup.  I'm not sure why it was missing.

There should be no functionality change here, just a small compile-time
speedup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:35:38 +00:00
Saleem Abdulrasool
c737b6fc30 ARM: fix optimised division on WoA
We did not have an explicit branch to the continuation BB.  When the check was
hoisted, this could permit control follow to fall through into the division
trap.  Add the explicit branch to the continuation basic block to ensure that
code execution is correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264370 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:34:11 +00:00
Matt Arsenault
e4e369ab90 TTI: Report 0 cost for free addrspacecasts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:26:29 +00:00
Matt Arsenault
93e0b28a0e TTI: Use 0 for cost of fabs if free
Ideally this would also happen for fneg, but that
isn't a distinct operation in the IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264368 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:26:22 +00:00
Matt Arsenault
42792ff39d AMDGPU: TTI: Make insertelement free.
We don't want to have a cost to scalarizing operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 00:14:11 +00:00
Reid Kleckner
c68f3d4c8d Try to fix ODR violation of ErrorInfo::ID
This implements my suggestion to Lang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264360 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 23:49:34 +00:00
Manman Ren
7121713797 CXX TLS: collect return blocks after SelectAllBasicBlocks.
It is incorrect to get the corresponding MBB for a ReturnInst before
SelectAllBasicBlocks since SelectAllBasicBlocks can change the
correspondence between a ReturnInst and the MBB it is in.

PR27062


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264358 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 23:21:29 +00:00
Sanjay Patel
79b059889d Add utility script to generate checks for opt or llc regression tests
This is an enhancement of the existing update_llc_test_checks.py script.
It adds some of the functionality from the script used in D17999 to make
the IR checking more flexible.

The bad news: 
This actually is 'My First Python Program'. Thus, it's likely that I have
violated all best practices of Python programming if I've made a functional
change from the original program. If you see anything that's obviously 
wrong, please let me know or feel free to fix it. I didn't even read any
documentation...

The good news: 
I tested this on ~10 existing opt/llc regression tests, and it does what 
I hoped for. It produces exact checking for IR regression tests and doesn't
signficantly change the existing llc-with-x86-target asm checking. The opt
tests that were modified in r263667, r263668, r263674, and r263679 are
examples of the expected results, except that this version of the script 
puts the check lines ahead of the IR to follow the existing llc/asm 
behavior.

If there are no complaints/fallout, we should be able to remove the 
original script. Extending this script to be used for non-x86 and clang
regression tests would be the expected follow-up steps.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 23:19:26 +00:00