Matt Arsenault [Fri, 20 Jun 2014 06:50:05 +0000 (06:50 +0000)]
R600: Trivial subtarget feature cleanups.
Remove an unused AMDIL leftover, correct extra periods
appearing in the help menu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211341
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Fri, 20 Jun 2014 04:36:29 +0000 (04:36 +0000)]
ArgList: use MakeArgList overloads in subclasses and clean up some calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211340
91177308-0d34-0410-b5e6-
96231b3b80d8
Karthik Bhat [Fri, 20 Jun 2014 04:32:48 +0000 (04:32 +0000)]
Add Support to Recognize and Vectorize NON SIMD instructions in SLPVectorizer.
This patch adds support to recognize patterns such as fadd,fsub,fadd,fsub.../add,sub,add,sub... and
vectorizes them as vector shuffles if they are profitable.
These patterns of vector shuffle can later be converted to instructions such as addsubpd etc on X86.
Thanks to Arnold and Hal for the reviews. http://reviews.llvm.org/D4015
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211339
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 02:31:07 +0000 (02:31 +0000)]
Support: Clean up getRounded() tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211337
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 02:31:03 +0000 (02:31 +0000)]
Support: Write ScaledNumbers::getAdjusted()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211336
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 Jun 2014 01:37:35 +0000 (01:37 +0000)]
Small clanups:
Use static instead of anonymous namespace.
Delete write only variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211335
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 20 Jun 2014 01:36:00 +0000 (01:36 +0000)]
Fix .cpp files claiming to be header files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211334
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 20 Jun 2014 01:30:43 +0000 (01:30 +0000)]
Support: Write ScaledNumbers::getRounded()
Start extracting helper functions out of -block-freq's `UnsignedFloat`
into `Support/ScaledNumber.h` with the eventual goal of moving and
renaming the class to `ScaledNumber`.
The bike shed about names is still being painted, but I'm going with
this for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211333
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 20 Jun 2014 01:05:28 +0000 (01:05 +0000)]
[x86] Make the x86 PACKSSWB, PACKSSDW, PACKUSWB, and PACKUSDW
instructions available as synthetic SDNodes PACKSS and PACKUS that will
select to the correct instruction variants based on the return type.
This allows us to use these rather important instructions when lowering
vector shuffles.
Also moves the relevant instruction definitions to be split out from
the fully generic multiclasses to allow them to match these new SDNodes
in the same way that the UNPCK instructions do.
No functionality should actually be changed here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211332
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 20 Jun 2014 00:38:12 +0000 (00:38 +0000)]
Don't build switch lookup tables for dllimport or TLS variables
We would previously put dllimport variables in switch lookup tables, which
doesn't work because the address cannot be used in a constant initializer.
This is basically the same problem that we have in PR19955.
Putting TLS variables in switch tables also desn't work, because the
address of such a variable is not constant.
Differential Revision: http://reviews.llvm.org/D4220
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211331
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 20 Jun 2014 00:23:03 +0000 (00:23 +0000)]
Revert "Add StringMap::insert(pair) consistent with the standard associative container concept."
This reverts commit r211309.
It looks like it broke some bots:
http://lab.llvm.org:8011/builders/clang-x86_64-ubuntu-gdb-75/builds/15563/steps/compile/logs/stdio
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211328
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 20 Jun 2014 00:04:16 +0000 (00:04 +0000)]
Added the -m option as an alias for -format=darwin to llvm-nm and llvm-size
which is what the darwin tools use for the Mach-O format output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211326
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 23:06:53 +0000 (23:06 +0000)]
The gold plugin doesn't need disassemblers.
Back in r128440 tools/LTO started exporting the disassembler interface. It
was never clear why, but whatever the reason I am pretty sure it doesn't hold
for tools/gold.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211325
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 22:54:47 +0000 (22:54 +0000)]
Set gold plugin options in a sane order.
This fixes the processing of --plugin-opt=-jump-table-type=arity.
Nice properties:
* We call InitTargetOptionsFromCodeGenFlags once.
* We call parseCodeGenDebugOptions once.
* It works :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211322
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 19 Jun 2014 22:49:21 +0000 (22:49 +0000)]
Fix the output of llvm-nm for Mach-O files to use the characters ‘d’ and ‘b’ for
data and bss symbols instead of the generic ’s’ for a symbol in a section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211321
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 22:33:23 +0000 (22:33 +0000)]
Simplify. No functionality change.
Thanks to Alp Toker for noticing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211320
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 22:27:46 +0000 (22:27 +0000)]
Use the assignment operator.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211319
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 22:20:07 +0000 (22:20 +0000)]
Reduce indentation. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211318
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 22:14:12 +0000 (22:14 +0000)]
Set missing options in LTOCodeGenerator::setTargetOptions.
Patch by Tom Roeder, I just added the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211317
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 19 Jun 2014 22:03:18 +0000 (22:03 +0000)]
Change the output of llvm-nm and llvm-size for Mach-O universal files (aka
fat files) to print “ (for architecture XYZ)” for fat files with more than
one architecture to be like what the darwin tools do for fat files.
Also clean up the Mach-O printing of archive membernames in llvm-nm to use
the darwin form of "libx.a(foo.o)".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211316
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 21:14:13 +0000 (21:14 +0000)]
Use lib/LTO directly in the gold plugin.
The tools/lto API is not the best choice for implementing a gold plugin. Among
other issues:
* It is an stable ABI. Old errors stay and we have to be really careful
before adding new features.
* It has to support two fairly different linkers: gold and ld64.
* We end up with a plugin that depends on a shared lib, something quiet
unusual in LLVM land.
* It hides LLVM. For some features in the gold plugin it would be really
nice to be able to just get a Module or a GlobalValue.
This change is intended to be a very direct translation from the C API. It
will just enable other fixes and cleanups.
Tested with a LTO bootstrap on linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211315
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 21:03:04 +0000 (21:03 +0000)]
Add a new subtarget hook for whether or not we'd like to enable
the atomic load linked expander pass to run for a particular
subtarget. This requires a check of the subtarget and so save
the TargetMachine rather than only TargetLoweringInfo and update
all callers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211314
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 19 Jun 2014 20:20:03 +0000 (20:20 +0000)]
Include Threading.h instead of forward declaring a function.
Previously this led to a circular header dependency, but a recent
change has since removed this dependency, so the correct fix is
to simply include the header rather than forward declare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211311
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 19 Jun 2014 20:08:56 +0000 (20:08 +0000)]
Add StringMap::insert(pair) consistent with the standard associative container concept.
Patch by Agustín Bergé.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211309
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 20:00:13 +0000 (20:00 +0000)]
Since we're using DW_AT_string rather than DW_AT_strp for debug_info
for assembly files we can't depend on the offset within the section
after a string since it could be different between producers etc.
Relax these tests accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211308
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 20:00:09 +0000 (20:00 +0000)]
Fix up a few formatting issues.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211307
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 19:45:25 +0000 (19:45 +0000)]
Remove an incorrect fixme.
dynamic-no-pic is just another output type. If gnu ld gets support for MachO,
it should also add something like LDPO_DYN_NO_PIC to the plugin interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211305
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Thu, 19 Jun 2014 19:41:26 +0000 (19:41 +0000)]
Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211304
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 19 Jun 2014 19:35:39 +0000 (19:35 +0000)]
Support: Add llvm::sys::fs::copy_file
A function to copy one file's contents to another.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211302
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Thu, 19 Jun 2014 19:31:11 +0000 (19:31 +0000)]
Remove bogus configure check
Configure creates makefiles, so it doesn't make sense to check for
them to see if we can configure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211301
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Thu, 19 Jun 2014 19:31:09 +0000 (19:31 +0000)]
Add option to keep flavor out of the install directory
Sometimes we want to install things in "standard" locations and the
flavor directories interfere with that. Add an option to keep them
out of the install path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211300
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Thu, 19 Jun 2014 19:31:05 +0000 (19:31 +0000)]
Turn of -Werror by default
Don't build with -Werror unless asked to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211299
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 19:26:42 +0000 (19:26 +0000)]
Fix this test a little harder - use llc_dwarf to make sure we don't
try to execute it on windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211298
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Thu, 19 Jun 2014 19:25:49 +0000 (19:25 +0000)]
Remove unused includes following r211294
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211297
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 19 Jun 2014 19:11:22 +0000 (19:11 +0000)]
Use the c++ APIs.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211294
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 18:36:15 +0000 (18:36 +0000)]
Relax this test a bit, we don't need the full contents of the
frame section to match, just the version for this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211293
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 19 Jun 2014 18:26:28 +0000 (18:26 +0000)]
Remove use of removed function, llvm_stop_multithreading
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211291
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 19 Jun 2014 18:26:26 +0000 (18:26 +0000)]
Remove circular header reference in Threading.h/Mutex.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211290
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 19 Jun 2014 18:25:06 +0000 (18:25 +0000)]
Fix build on non-Windows platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211288
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 19 Jun 2014 18:18:23 +0000 (18:18 +0000)]
Remove support for LLVM runtime multi-threading.
After a number of previous small iterations, the functions
llvm_start_multithreaded() and llvm_stop_multithreaded() have
been reduced essentially to no-ops. This change removes them
entirely.
Reviewed by: rnk, dblaikie
Differential Revision: http://reviews.llvm.org/D4216
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211287
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 19 Jun 2014 17:59:14 +0000 (17:59 +0000)]
DebugInfo: Fission: Ensure the address pool entries for location lists are emitted.
The address pool was being emitted before location lists. The latter
could add more entries to the pool which would be lost/never emitted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211284
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Thu, 19 Jun 2014 17:15:36 +0000 (17:15 +0000)]
MCNullStreamer: assign file IDs to resolve crashes and errors
Use the MCStreamer base implementations for file ID tracking instead of
overriding them as no-ops.
Avoids assertions when streaming Dwarf debug info, and fixes ASM parsing of loc
and file directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211282
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Thu, 19 Jun 2014 16:50:16 +0000 (16:50 +0000)]
[ValueTracking] Extend range metadata to call/invoke
Summary:
With this patch, range metadata can be added to call/invoke including
IntrinsicInst. Previously, it could only be added to load.
Rename computeKnownBitsLoad to computeKnownBitsFromRangeMetadata because
range metadata is not only used by load.
Update the language reference to reflect this change.
Test Plan:
Add several tests in range-2.ll to confirm the verifier is happy with
having range metadata on call/invoke.
Add two tests in AddOverFlow.ll to confirm annotating range metadata to
call/invoke can benefit InstCombine.
Reviewers: meheff, nlewycky, reames, hfinkel, eliben
Reviewed By: eliben
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D4187
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211281
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Thu, 19 Jun 2014 16:35:19 +0000 (16:35 +0000)]
Tests for r211273
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211279
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Thu, 19 Jun 2014 16:17:42 +0000 (16:17 +0000)]
Kill the LLVM global lock.
This patch removes the LLVM global lock, and updates all existing
users of the global lock to use their own mutex. None of the
existing users of the global lock were protecting code that was
mutually exclusive with any of the other users of the global
lock, so its purpose was not being met.
Reviewed by: rnk
Differential Revision: http://reviews.llvm.org/D4142
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211277
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Thu, 19 Jun 2014 15:52:37 +0000 (15:52 +0000)]
Emit DWARF info for all code section in an assembly file
Currently, when using llvm as an assembler, DWARF debug information is only
generated for the .text section. This patch modifies this so that DWARF info
is emitted for all executable sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211273
91177308-0d34-0410-b5e6-
96231b3b80d8
Oliver Stannard [Thu, 19 Jun 2014 15:39:33 +0000 (15:39 +0000)]
Emit DWARF3 call frame information when DWARF3+ debug info is requested
Currently, llvm always emits a DWARF CIE with a version of 1, even when emitting
DWARF 3 or 4, which both support CIE version 3. This patch makes it emit the
newer CIE version when we are emitting DWARF 3 or 4. This will not reduce
compatibility, as we already emit other DWARF3/4 features, and is worth doing as
the DWARF3 spec removed some ambiguities in the interpretation of call frame
information.
It also fixes a minor bug where the "return address" field of the CIE was
encoded as a ULEB128, which is only valid when the CIE version is 3. There are
no test changes for this, because (as far as I can tell) none of the platforms
that we test have a return address register with a DWARF register number >127.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211272
91177308-0d34-0410-b5e6-
96231b3b80d8
Matheus Almeida [Thu, 19 Jun 2014 15:08:04 +0000 (15:08 +0000)]
[mips] Implementation of dli.
Patch by David Chisnall
His work was sponsored by: DARPA, AFRL
Some small modifications to the original patch: we now error if
it's not possible to expand an instruction (mips-expansions-bad.s has some
examples). Added some comments to the expansions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211271
91177308-0d34-0410-b5e6-
96231b3b80d8
Matheus Almeida [Thu, 19 Jun 2014 14:39:14 +0000 (14:39 +0000)]
[mips] Small update to the logic behind the expansion of assembly pseudo instructions.
Summary:
The functions that do the expansion now return false on success and true otherwise. This is so
we can catch some errors during the expansion (e.g.: immediate too large). The next patch adds some test cases.
Reviewers: vmedic
Reviewed By: vmedic
Differential Revision: http://reviews.llvm.org/D4214
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211269
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinesh Dwivedi [Thu, 19 Jun 2014 14:11:53 +0000 (14:11 +0000)]
Updated comments as suggested by Rafael. Thanks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211268
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinesh Dwivedi [Thu, 19 Jun 2014 10:36:52 +0000 (10:36 +0000)]
Added instruction combine to transform few more negative values addition to subtraction (Part 1)
This patch enables transforms for following patterns.
(x + (~(y & c) + 1) --> x - (y & c)
(x + (~((y >> z) & c) + 1) --> x - ((y>>z) & c)
Differential Revision: http://reviews.llvm.org/D3733
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211266
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 19 Jun 2014 10:29:41 +0000 (10:29 +0000)]
[X86] Teach how to combine horizontal binop even in the presence of undefs.
Before this change, the backend was unable to fold a build_vector dag
node with UNDEF operands into a single horizontal add/sub.
This patch teaches how to combine a build_vector with UNDEF operands into a
horizontal add/sub when possible. The algorithm conservatively avoids to combine
a build_vector with only a single non-UNDEF operand.
Added test haddsub-undef.ll to verify that we correctly fold horizontal binop
even in the presence of UNDEFs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211265
91177308-0d34-0410-b5e6-
96231b3b80d8
Dinesh Dwivedi [Thu, 19 Jun 2014 08:29:18 +0000 (08:29 +0000)]
Refactored and updated SimplifyUsingDistributiveLaws() to
* Find factorization opportunities using identity values.
* Find factorization opportunities by treating shl(X, C) as mul (X, shl(C))
* Keep NSW flag while simplifying instruction using factorization.
This fixes PR19263.
Differential Revision: http://reviews.llvm.org/D3799
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211261
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Thu, 19 Jun 2014 07:25:25 +0000 (07:25 +0000)]
CommandLine: bail out when options get multiply registered
These errors are strictly unrecoverable and indicate serious issues such as
conflicting option names or an incorrectly linked LLVM distribution.
With this change, the errors actually get detected so tests don't pass
silently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211260
91177308-0d34-0410-b5e6-
96231b3b80d8
Alp Toker [Thu, 19 Jun 2014 07:25:18 +0000 (07:25 +0000)]
Remove OwningPtr.h and associated tests
llvm::OwningPtr is superseded by std::unique_ptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211259
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 19 Jun 2014 07:14:33 +0000 (07:14 +0000)]
InstCombine: Stop two transforms dueling
InstCombineMulDivRem has:
// Canonicalize (X+C1)*CI -> X*CI+C1*CI.
InstCombineAddSub has:
// W*X + Y*Z --> W * (X+Z) iff W == Y
These two transforms could fight with each other if C1*CI would not fold
away to something simpler than a ConstantExpr mul.
The InstCombineMulDivRem transform only acted on ConstantInts until
r199602 when it was changed to operate on all Constants in order to
let it fire on ConstantVectors.
To fix this, make this transform more careful by checking to see if we
actually folded away C1*CI.
This fixes PR20079.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211258
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 06:22:08 +0000 (06:22 +0000)]
Move -dwarf-version to an MC level command line option so it's
used by all of the MC level tools and codegen. Fix up all uses
in the compiler to use this and set it on the context accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211257
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 06:22:05 +0000 (06:22 +0000)]
Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211256
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 19 Jun 2014 06:22:01 +0000 (06:22 +0000)]
80-column fixups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211255
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 19 Jun 2014 06:10:58 +0000 (06:10 +0000)]
Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211254
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 19 Jun 2014 04:24:43 +0000 (04:24 +0000)]
R600: Add a few tests I forgot to add.
These belong with r210827
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211253
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 19 Jun 2014 03:51:46 +0000 (03:51 +0000)]
Move optimization of some cases of (A & C1)|(B & C2) from instcombine to instsimplify. Patch by Rahul Jain, plus some last minute changes by me -- you can blame me for any bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211252
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 19 Jun 2014 03:35:49 +0000 (03:35 +0000)]
Make instsimplify's analysis of icmp eq/ne use computeKnownBits to determine whether the icmp is always true or false. Patch by Suyog Sarda!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211251
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Thu, 19 Jun 2014 03:28:28 +0000 (03:28 +0000)]
Remove redundant code in InstCombineShift, no functionality change because instsimplify already does this and instcombine calls instsimplify a few lines above. Patch by Suyog Sarda!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211250
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 19 Jun 2014 01:25:43 +0000 (01:25 +0000)]
MS asm: Properly handle quoted symbol names
We would get confused by '@' characters in symbol names, we would
mistake the text following them for the variant kind.
When an identifier a string, the variant kind will never show up inside
of it. Instead, check to see if there is a variant following the
string.
This fixes PR19965.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211249
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 19 Jun 2014 01:19:19 +0000 (01:19 +0000)]
R600/SI: Add intrinsics for various math instructions.
These will be used for custom lowering and for library
implementations of various math functions, so it's useful
to expose these as builtins.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211247
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 19 Jun 2014 01:09:49 +0000 (01:09 +0000)]
Fix breakage from r211244 by using LLVM_EXPLICIT to avoid using explicit operators under MSVC where they're not supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211246
91177308-0d34-0410-b5e6-
96231b3b80d8
Nikola Smiljanic [Thu, 19 Jun 2014 00:26:49 +0000 (00:26 +0000)]
PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad OR-result.
Mark conversion operator explicit and const qualify comparison operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211244
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 18 Jun 2014 22:48:09 +0000 (22:48 +0000)]
Move ARMJITInfo off of the TargetMachine and down onto the subtarget.
This required untangling a mess of headers that included around.
This a recommit of r210953 with a fix for the removed accessor
for JITInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211233
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 18 Jun 2014 22:11:03 +0000 (22:11 +0000)]
Use stdint macros for specifying size of constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211231
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Wed, 18 Jun 2014 22:04:40 +0000 (22:04 +0000)]
Teach llvm-size to know about Mach-O universal files (aka fat files) and
fat files containing archives.
Also fix a bug in MachOUniversalBinary::ObjectForArch::ObjectForArch()
where it needed a >= when comparing the Index with the number of
objects in a fat file. As the index starts at 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211230
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 18 Jun 2014 22:03:45 +0000 (22:03 +0000)]
R600: Handle fnearbyint
The difference from rint isn't really relevant here,
so treat them as equivalent. OpenCL doesn't have nearbyint,
so this is sort of pointless other than for completeness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211229
91177308-0d34-0410-b5e6-
96231b3b80d8
Marek Olsak [Wed, 18 Jun 2014 22:00:29 +0000 (22:00 +0000)]
R600/SI: add gather4 and getlod intrinsics (v3)
This contains all the previous patches + getlod support on top of it.
It doesn't use SDNodes anymore, so it's quite small.
It also adds v16i8 to SReg_128, which is used for the sampler descriptor.
Reviewed-by: Tom Stellard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211228
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 18 Jun 2014 21:40:43 +0000 (21:40 +0000)]
Use LL suffix for literal that should be 64-bits.
This hopefully fixes Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211225
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 21:14:57 +0000 (21:14 +0000)]
Add a symbols() range and use a range loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211222
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 21:08:17 +0000 (21:08 +0000)]
Simplify code.
We can delete the objects earlier now that we are copying the names to a buffer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211221
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 18 Jun 2014 20:57:32 +0000 (20:57 +0000)]
MC: do not add comment string to the AsmToken in AsmLexer::LexLineComment
Fixes macros with varargs if the macro instantiation has a trailing comment.
Patch by Janne Grunau!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211219
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Wed, 18 Jun 2014 20:57:28 +0000 (20:57 +0000)]
MCAsmParser: full support for gas' '.if{cond} expression' directives
Patch by Janne Grunau!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211218
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Wed, 18 Jun 2014 20:17:35 +0000 (20:17 +0000)]
Replace Execution Engine's mutex with std::recursive_mutex.
This change has a bit of a trickle down effect due to the fact that
there are a number of derived implementations of ExecutionEngine,
and that the mutex is not tightly encapsulated so is used by other
classes directly.
Reviewed by: rnk
Differential Revision: http://reviews.llvm.org/D4196
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211214
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 20:07:35 +0000 (20:07 +0000)]
Revert a C API difference that I incorrectly introduced.
LLVMGetBitcodeModuleInContext should not take ownership on error. I will
try to localize this odd api requirement, but this should get the bots green.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211213
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 19:08:47 +0000 (19:08 +0000)]
Make getBaseObject static.
Thanks to David Majnemer for noticing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211208
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 19:05:24 +0000 (19:05 +0000)]
Change IRObjectFile to parse the bitcode lazily.
The main point of this class is to provide a cheap object interface to a bitcode
file, so it has to be as lazy as possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211207
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 18:55:41 +0000 (18:55 +0000)]
Remove BitcodeReader::setBufferOwned.
We do have use cases for the bitcode reader owning the buffer or not, but we
always know which one we have when we construct it.
It might be possible to simplify this further, but this is a step in the
right direction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211205
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Wed, 18 Jun 2014 18:46:58 +0000 (18:46 +0000)]
Simply test for available locations in optimization remarks.
When emitting optimization remarks, we test for the presence of
instruction locations by testing for a valid llvm.dbg.cu annotation.
This is slightly inefficient because we can simply ask whether the
debug location we have is known or not.
Additionally, if my current plan works, I will need to remove the
llvm.dbg.cu annotation from the IL (or prevent it from being generated)
when -Rpass is used without -g. In those cases, we'll want to generate
line tables but we will want to prevent code generation from emitting
DWARF code for them.
Tested on x86_64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211204
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 18 Jun 2014 18:33:36 +0000 (18:33 +0000)]
[PowerPC] Remove unnecessary load of r12 in indirect call
When looking at the 64-bit SVR4 indirect call sequence, I noticed
an unnecessary load of r12. And indeed the code says:
// R12 must contain the address of an indirect callee.
But this is not correct; in the 64-bit SVR4 (ELFv1) ABI, there is
no need to load r12 at this point. It seems this code and comment
is a remnant of code originally shared with the Darwin ABI ...
This patch simply removes the unnecessary load.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211203
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 18:30:15 +0000 (18:30 +0000)]
Update to the latest registered ELF e_machine names and values.
Patch by John Wolf!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211202
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 18:26:53 +0000 (18:26 +0000)]
Run clang-format in a small chunk of code I am about to change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211201
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Wed, 18 Jun 2014 18:20:44 +0000 (18:20 +0000)]
ProfileData: Fix copy-paste type in RawInstrProfReader
These deleted definitions had the wrong types.
Patch by Alex L!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211199
91177308-0d34-0410-b5e6-
96231b3b80d8
Weiming Zhao [Wed, 18 Jun 2014 18:17:25 +0000 (18:17 +0000)]
[ARM] [MC] Refactor the constant pool classes
ARMTargetStreamer implements ConstantPool and AssmeblerConstantPools
to keep track of assembler-generated constant pools that are used for
ldr-pseudo.
When implementing ldr-pseudo for AArch64, these two classes can be reused.
So this patch factors them out from ARM target to the general MC lib.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211198
91177308-0d34-0410-b5e6-
96231b3b80d8
Ed Maste [Wed, 18 Jun 2014 18:08:55 +0000 (18:08 +0000)]
ADT: correct typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211196
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Wed, 18 Jun 2014 17:57:29 +0000 (17:57 +0000)]
R600: Expand vector fceil
Move fp64 fceil tests to fceil64.ll
v2: rebase
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211194
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 18 Jun 2014 17:52:49 +0000 (17:52 +0000)]
[PowerPC] Simplify and improve loading into TOC register
During an indirect function call sequence on the 64-bit SVR4 ABI,
generate code must load and then restore the TOC register.
This does not use a regular LOAD instruction since the TOC
register r2 is marked as reserved. Instead, the are two
special instruction patterns:
let RST = 2, DS = 2 in
def LDinto_toc: DSForm_1a<58, 0, (outs), (ins g8rc:$reg),
"ld 2, 8($reg)", IIC_LdStLD,
[(PPCload_toc i64:$reg)]>, isPPC64;
let RST = 2, DS = 10, RA = 1 in
def LDtoc_restore : DSForm_1a<58, 0, (outs), (ins),
"ld 2, 40(1)", IIC_LdStLD,
[(PPCtoc_restore)]>, isPPC64;
Note that these not only restrict the destination of the
load to r2, but they also restrict the *source* of the
load to particular address combinations. The latter is
a problem when we want to support the ELFv2 ABI, since
there the TOC save slot is no longer at 40(1).
This patch replaces those two instructions with a single
instruction pattern that only hard-codes r2 as destination,
but supports generic addresses as source. This will allow
supporting the ELFv2 ABI, and also helps generate more
efficient code for calls to absolute addresses (allowing
simplification of the ppc64-calls.ll test case).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211193
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 18 Jun 2014 17:45:58 +0000 (17:45 +0000)]
Work around ridiculous warning.
Apparently C++ doesn't really have hex floating point constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211192
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 18 Jun 2014 17:28:56 +0000 (17:28 +0000)]
[PowerPC] Add back test case for absolute calls (removed in r211174)
As requested by Hal Finkel, this adds back a test for calls to
a known-constant function pointer value, and verifies that the
64-bit SVR4 indirect function call sequence is used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211190
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Wed, 18 Jun 2014 17:20:49 +0000 (17:20 +0000)]
Add a triple so that right syntax is choosen on mac osx systems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211188
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 18 Jun 2014 17:13:57 +0000 (17:13 +0000)]
R600/SI: Add intrinsics for brev instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211187
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 18 Jun 2014 17:13:51 +0000 (17:13 +0000)]
R600/SI: Prettier operand printing for 64-bit ops.
Copy what is done for 32-bit already so the order is about the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211186
91177308-0d34-0410-b5e6-
96231b3b80d8
Matheus Almeida [Wed, 18 Jun 2014 17:10:30 +0000 (17:10 +0000)]
[mips] SYNC $stype instruction was added in Mips32
but SYNC with an implied operand ($stype = 0) is valid since Mips2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211185
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 18 Jun 2014 17:07:15 +0000 (17:07 +0000)]
Fix a memory leak in the error path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211184
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Wed, 18 Jun 2014 17:05:30 +0000 (17:05 +0000)]
R600: Implement f64 ftrunc, ffloor and fceil.
CI has instructions for these, so this fixes them for older hardware.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211183
91177308-0d34-0410-b5e6-
96231b3b80d8