Toma Tabacu [Fri, 1 May 2015 12:19:27 +0000 (12:19 +0000)]
[mips] [IAS] Fix error messages for using LI with 64-bit immediates.
Summary:
LI should never accept immediates larger than 32 bits.
The additional Is32BitImm boolean also paves the way for unifying the functionality that LA and LI have in common.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9289
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236313
91177308-0d34-0410-b5e6-
96231b3b80d8
Niels Ole Salscheider [Fri, 1 May 2015 11:58:30 +0000 (11:58 +0000)]
[CMake] Also search for prefixed versions of ld.gold
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236312
91177308-0d34-0410-b5e6-
96231b3b80d8
Toma Tabacu [Fri, 1 May 2015 10:26:47 +0000 (10:26 +0000)]
[mips] [IAS] Slightly improve shift instruction generation in expandLoadImm.
Summary:
Generate one DSLL32 of 0 instead of two consecutive DSLL of 16.
In order to do this I had to change createLShiftOri's template argument from a bool to an unsigned.
This also gave me the opportunity to rewrite the mips64-expansions.s test, as it was testing the same cases multiple times and skipping over other cases.
It was also somewhat unreadable, as the CHECK lines were grouped in a huge block of text at the beginning of the file.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8974
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236311
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Fri, 1 May 2015 08:20:04 +0000 (08:20 +0000)]
[SelectionDAG] Unary vector constant folding integer legality fixes
This patch fixes issues with vector constant folding not correctly handling scalar input operands if they require implicit truncation - this was tested with llvm-stress as recommended by Patrik H Hagglund.
The patch ensures that integer input scalars from a build vector are correctly truncated before folding, and that constant integer scalar results are promoted to a legal type before inclusion in the new folded build vector.
I have added another crash test case and also a test for UINT_TO_FP / SINT_TO_FP using an non-truncated scalar input, which was failing before this patch.
Differential Revision: http://reviews.llvm.org/D9282
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236308
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 1 May 2015 03:44:09 +0000 (03:44 +0000)]
R600/SI: Add VCC as an implict def of SI_KILL
When SI_KILL has a register operand, its lowered form writes to vcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236307
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 1 May 2015 03:44:08 +0000 (03:44 +0000)]
R600/SI: Fix verifier errors from the SIAnnotateControlFlow pass
This pass was generating 'Instruction does not dominate all uses!'
errors for programs which had loops with a condition variable that
depended on the result of a phi instruction from outside of the loop.
The pass was inserting new phi nodes outside of the loop which used values
defined inside the loop.
http://bugs.freedesktop.org/show_bug.cgi?id=90056
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236306
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 1 May 2015 00:45:55 +0000 (00:45 +0000)]
[ARM][TEST] Strengthen test against smarter reg alloc.
Follow-up of r236247.
rdar://problem/
20770899
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236296
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 30 Apr 2015 23:57:47 +0000 (23:57 +0000)]
[ARM] optimizeSelect should clear kill flags.
If we move an instruction from one block down to a MOVC and predicate it,
then the original instruction could be moved in to a loop. In this case,
its invalid for any kill flags to remain on there.
Fails with -verfy-machineinstrs.
rdar://problem/
20752113
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236290
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 30 Apr 2015 23:49:23 +0000 (23:49 +0000)]
InstrProf: Instrumenter support for setting profile output from command line
This change is the second of 3 patches to add support for specifying
the profile output from the command line via -fprofile-instr-generate=<path>,
where the specified output path/file will be overridden by the
LLVM_PROFILE_FILE environment variable.
This patch adds the necessary support to the llvm instrumenter, specifically
a new member of GCOVOptions for clang to save the specified filename, and
support for calling the new compiler-rt interface from __llvm_profile_init.
Patch by Teresa Johnson. Thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236288
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 30 Apr 2015 23:20:56 +0000 (23:20 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236283
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 30 Apr 2015 23:14:14 +0000 (23:14 +0000)]
Commute the internal flag on MachineOperands.
When commuting a thumb instruction in the size reduction pass, thumb
instructions are represented as a bundle and so some operands may be marked
as internal. The internal flag has to move with the operand when commuting.
This test is sensitive to register allocation so can't specifically check that
this error was happening, but so long as it continues to pass with -verify then
hopefully its still ok.
rdar://problem/
20752113
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236282
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Thu, 30 Apr 2015 23:08:53 +0000 (23:08 +0000)]
[Object] Teach Object and llvm-objdump about ".hidden"
Differential Revision: http://reviews.llvm.org/D9416
Reviewed by: rafael
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236279
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Trieu [Thu, 30 Apr 2015 23:07:00 +0000 (23:07 +0000)]
Fix -Wpessimizing-move warnings by removing std::move calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236278
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 22:41:12 +0000 (22:41 +0000)]
Remove unnecessary break.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236275
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 30 Apr 2015 22:27:20 +0000 (22:27 +0000)]
[AArch64] Fix bad register class constraint in fast-isel for TST instruction.
rdar://problem/
20748715
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236273
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 30 Apr 2015 22:15:59 +0000 (22:15 +0000)]
Don't always apply kill flag in thumb2 ABS pseudo expansion.
The expansion for t2ABS was always setting the kill flag on the rsb instruction.
It should instead only be set on rsb if it was set on the original ABS instruction.
rdar://problem/
20752113
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236272
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 30 Apr 2015 22:11:59 +0000 (22:11 +0000)]
[X86] Use 4 byte preferred aggregate alignment on Win32
This helps reduce the frequency of stack realignment prologues in 32-bit
X86 Windows code. Before this change and the corresponding clang change,
we would take the max of the type preferred alignment and the explicit
alignment on the alloca.
If you don't override aggregate alignment in datalayout, you get a
default of 8. This dates back to 2007 / r34356, and changing it seems
prohibitively difficult at this point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236270
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 30 Apr 2015 22:05:30 +0000 (22:05 +0000)]
InstCombineSimplifyDemanded: Remove nsw/nuw flags when optimizing demanded bits
When optimizing demanded bits of the operands of an Add we have to
remove the nsw/nuw flags as we have no guarantee anymore that we don't
wrap. This is legal here because the top bit is not demanded. In fact
this operaion was already performed but missed in the case of an Add
with a constant on the right side. To fix this this patch refactors the
code to unify the code paths in SimplifyDemandedUseBits() handling of
Add/Sub:
- The transformation of Add->Or is removed from the simplify demand
code because the equivalent transformation exists in
InstCombiner::visitAdd()
- KnownOnes/KnownZero are not adjusted for Add x, C anymore as
computeKnownBits() already performs these computations.
- The simplification of the operands is unified. In this new version
constant on the right side of a Sub are shrunk now as I could not find
a reason why not to do so.
- The special case for clearing nsw/nuw in ShrinkDemandedConstant() is
not necessary anymore as the caller does that already.
Differential Revision: http://reviews.llvm.org/D9415
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236269
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 30 Apr 2015 22:04:26 +0000 (22:04 +0000)]
InstCombine: Move Sub->Xor rule from SimplifyDemanded to InstCombine
The rule that turns a sub to xor if the LHS is 2^n-1 and the remaining bits
are known zero, does not use the demanded bits at all: Move it to the
normal InstCombine code path.
Differential Revision: http://reviews.llvm.org/D9417
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236268
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 21:51:58 +0000 (21:51 +0000)]
Simplify the creation of compressed debug sections.
This is actually fairly simple in the current code layout: Check if we should
compress just before writing out and everything else just works.
This removes the last case in which the object writer was creating a
fragment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236267
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 30 Apr 2015 21:22:28 +0000 (21:22 +0000)]
Fix comment in test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236262
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 21:20:06 +0000 (21:20 +0000)]
Replace unreachable code with llvm_unreachable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236261
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 21:10:06 +0000 (21:10 +0000)]
Don't create a MCSectionData when we don't have to.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236260
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 30 Apr 2015 21:03:29 +0000 (21:03 +0000)]
Fix for PR23103. Correctly propagate the 'IsUndef' flag to the register operands of a commuted instruction.
Revision 220239 exposed a latent bug in method
'TargetInstrInfo::commuteInstruction'. When commuting the operands of a machine
instruction, method 'commuteInstruction' didn't correctly propagate the
'IsUndef' flag to the register operands of the new (commuted) instruction.
Before this patch, the following instruction:
%vreg4<def> = VADDSDrr %vreg14, %vreg5<undef>; FR64:%vreg4,%vreg14,%vreg5
was wrongly converted by method 'commuteInstruction' into:
%vreg4<def> = VADDSDrr %vreg5, %vreg14<undef>; FR64:%vreg4,%vreg5,%vreg14
The correct instruction should have been:
%vreg4<def> = VADDSDrr %vreg5<undef>, %vreg14; FR64:%vreg4,%vreg5,%vreg14
This patch fixes the problem in method 'TargetInstrInfo::commuteInstruction'.
When swapping the operands of a machine instruction, we now make sure that
'IsUndef' flags are correctly set.
Added test case 'pr23103.ll'.
Differential Revision: http://reviews.llvm.org/D9406
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236258
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 20:57:14 +0000 (20:57 +0000)]
Avoid an extra loop over the sections.
Add string to the section header string table as we add sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236257
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 20:53:27 +0000 (20:53 +0000)]
Make the section table a member of ELFObjectWriter.
This avoids passing it around and lets us build a small helper to add
a section to the table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236255
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 20:37:36 +0000 (20:37 +0000)]
Nothing inherits from this, drop the protected:
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236253
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Thu, 30 Apr 2015 20:30:42 +0000 (20:30 +0000)]
For llvm-objdump, with the -archive-headers and -macho options, use the -non-verbose
option to print the archive headers using raw numeric values. Also add the -archive-member-offsets
for use with these to also trigger printing of the offset of the archive member from the start
of the archive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236252
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Thu, 30 Apr 2015 20:08:44 +0000 (20:08 +0000)]
Exhaustively test all triples in TripleTest.
Iteration over all permutations didn't really work,
due to evolution of the underlying enums.
Differential Revision: http://reviews.llvm.org/D9057
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236251
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 30 Apr 2015 19:35:43 +0000 (19:35 +0000)]
Mips: Remove dead declaration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236250
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 30 Apr 2015 19:35:41 +0000 (19:35 +0000)]
MachineVerifier: Don't crash if MachineOperand has no parent
If you somehow added a MachineOperand to an instruction
that did not have the parent set, the verifier would
crash since it attempts to use the operand's parent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236249
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 30 Apr 2015 18:58:23 +0000 (18:58 +0000)]
Don't rewrite jumps to empty BBs to landing pads.
In the test case here, the 'unreachable' BB was removed by BranchFolding because its empty.
It then rewrote the jump from 'entry' to jump to its fallthrough, which was a landing pad.
This results in 'entry' jumping to 2 different landing pads, which fails the machine verifier.
rdar://problem/
20750162
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236248
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 30 Apr 2015 18:52:49 +0000 (18:52 +0000)]
[ARM] Do not generate invalid encoding for stack adjust, even if this is just
temporary.
Because of that:
1. The machine verifier was complaining on such code.
2. The generate code worked just because the thumb reduction size pass fixed the
opcode.
rdar://problem/
20749824
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236247
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 30 Apr 2015 18:28:58 +0000 (18:28 +0000)]
AArch64: add BFC alias for the BFI/BFM instructions.
Unlike 32-bit ARM, AArch64 can use wzr/xzr to implement this without the need
for a separate instruction.
rdar://
18679590
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236245
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 30 Apr 2015 18:17:12 +0000 (18:17 +0000)]
Add a note about permitting default member initializers
Use them in WinEHPrepare so that we can spot any toolchain bugs that
come up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236244
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Thu, 30 Apr 2015 17:15:56 +0000 (17:15 +0000)]
Reinstate revisions r234755, r234759, r234760
changes:
Don't apply on hexagon and NVPTX since they no longer claim to support UADDO/USUBO
Add location to getConstant
Drop comment about the ops being turned into expand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236240
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Thu, 30 Apr 2015 16:15:07 +0000 (16:15 +0000)]
Move equality function for AliasAnalysis::Location from DenseMapInfo to Location struct so it can be used in other types of maps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236237
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 14:21:49 +0000 (14:21 +0000)]
Write sections mostly in one pass.
During ELF writing, there is no need to further relax the sections, so we
should not be creating fragments. This patch avoids doing so in all cases
but debug section compression (that is next).
Also, the ELF format is fairly simple to write. We can do a single pass over
the sections to write them out and compute the section header table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236235
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 30 Apr 2015 14:03:12 +0000 (14:03 +0000)]
Silencing an "enumeral and non-enumeral type in conditional expression" warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236234
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 13:57:06 +0000 (13:57 +0000)]
Don't check for offsets in tests where it is not relevant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236233
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Thu, 30 Apr 2015 13:22:48 +0000 (13:22 +0000)]
Fix private constructor for ScaledNumber.
Summary:
The private constructor for ScaledNumber was using uint64_t instead of
DigitsT. This was preventing instantiations of ScaledNumber with
anything other than uint64_t types.
In implementing the tests, I ran into another issue. Operators >>= and
<<= did not have variants for accepting other ScaledNumber as the shift
argument. This is expected by the SCALED_NUMBER_BOP.
It makes no sense to allow shifting a ScaledNumber by another
ScaledNumber, so the patch includes two new templates for shifting
ScaledNumbers.
Reviewers: dexonsmith
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9350
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236232
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 13:08:09 +0000 (13:08 +0000)]
Check the entire content of the comdat group.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236230
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Thu, 30 Apr 2015 12:27:51 +0000 (12:27 +0000)]
Fix typo in comment. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236227
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 30 Apr 2015 10:52:42 +0000 (10:52 +0000)]
[mips] Sorted instructions in mips64r6 disassembly tests. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236223
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 30 Apr 2015 10:23:48 +0000 (10:23 +0000)]
[mips][mips64r6] Sorted instructions in test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236221
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 30 Apr 2015 09:57:37 +0000 (09:57 +0000)]
[mips][msa] Rename main check prefix to 'ALL' in basic operations tests. NFC
Summary:
The majority of the checks are subtarget independent. The few that aren't
will be corrected shortly.
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9340
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236220
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 30 Apr 2015 09:56:30 +0000 (09:56 +0000)]
[mips][msa] Use CHECK-LABEL where missing, and remove checks matching the .size directive. NFC.
Summary:
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9339
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236219
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Thu, 30 Apr 2015 09:24:09 +0000 (09:24 +0000)]
[mips] Add missing signext attributes to MSA basic operations tests. NFC.
Summary:
This doesn't make much difference to MIPS32, but it will simplify a
MIPS64r6 bugfix which will follow shortly by removing unnecessary
sign-extension of parameters.
Reviewers: vkalintiris
Reviewed By: vkalintiris
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9338
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236216
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Thu, 30 Apr 2015 09:01:22 +0000 (09:01 +0000)]
Add convenient overloads for CreateInsertElement and CreateExtractElement methods in IRBuilder
Summary:
This pathc add convenient overloads for CreateInsertElement and CreateExtractElement methods in IRBuilder
where vector index can be uint64_t instead of Value*.
Test Plan: Unit test included.
Reviewers: majnemer
Reviewed By: majnemer
Subscribers: majnemer, llvm-commits
Differential Revision: http://reviews.llvm.org/D9347
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236214
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 30 Apr 2015 09:01:21 +0000 (09:01 +0000)]
Silence unused warning in non-assert builds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236213
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Jasper [Thu, 30 Apr 2015 08:51:13 +0000 (08:51 +0000)]
Inline local variable to silence unused warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236212
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Thu, 30 Apr 2015 08:38:48 +0000 (08:38 +0000)]
Masked gather and scatter - added DAGCombine visitors
and AVX-512 instruction selection patterns.
All other patches, including tests will follow.
http://reviews.llvm.org/D7665
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236211
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Thu, 30 Apr 2015 08:23:16 +0000 (08:23 +0000)]
[SSE] Fix for MUL v16i8 on pre-SSE41 targets (PR23369).
Sign extension of i8 to i16 was placing the unpacked bytes in the lower byte instead of the upper byte.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236209
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 30 Apr 2015 05:54:22 +0000 (05:54 +0000)]
[TableGen] Cleanup formatting by moving operators from beginning of line to end of previous line. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236206
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 30 Apr 2015 05:54:20 +0000 (05:54 +0000)]
[TableGen] Used range-based for loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236205
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 30 Apr 2015 05:12:52 +0000 (05:12 +0000)]
[TableGen] Merge a variable assignment and a return to drop curly braces. Fold an assignment into an if. Use auto on the result of a couple dyn_casts. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236204
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 30 Apr 2015 04:56:04 +0000 (04:56 +0000)]
[InstCombine] Add new rule for MIN(MAX(~A, ~B), ~C) et. al.
Summary:
Optimizing these well are especially interesting for IRCE since it
"clamps" values by generating this sort of pattern through SCEV
expressions.
Depends on D9352.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9353
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236203
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 30 Apr 2015 04:56:00 +0000 (04:56 +0000)]
[InstCombine] Add a new formula for SMIN.
Summary:
After this change `MatchSelectPattern` recognizes the following form
of SMIN:
Y >s C ? ~Y : ~C == ~Y <s ~C ? ~Y : ~C = SMIN(~Y, ~C)
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9352
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236202
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Thu, 30 Apr 2015 04:09:41 +0000 (04:09 +0000)]
Don't overflow GCTable
Summary: Bug found with AFL fuzz.
Reviewers: rafael, dexonsmith
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9361
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236200
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Thu, 30 Apr 2015 04:06:32 +0000 (04:06 +0000)]
Semantically revert r236031, which is not a good idea for in-order targets.
At the least it should be guarded by some kind of target hook.
It also introduced catastrophic compile time and code quality
regressions on some out of tree targets (test case still being
reduced/sanitized).
Sanjay agreed with reverting this patch until these issues can be
resolved.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236199
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 30 Apr 2015 01:59:04 +0000 (01:59 +0000)]
XFAIL test/CodeGen/Generic/MachineBranchProb.ll on Hexagon (PR23377)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236196
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Thu, 30 Apr 2015 01:13:31 +0000 (01:13 +0000)]
Make sure Op->getType() is a PointerType before we cast<> it.
Bug found with AFL fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236193
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Thu, 30 Apr 2015 00:57:37 +0000 (00:57 +0000)]
Switch lowering: use profile info to build weight-balanced binary search trees
This will cause hot nodes to appear closer to the root.
The literature says building the tree like this makes it a near-optimal (in
terms of search time given key frequencies) binary search tree. In LLVM's case,
we can do up to 3 comparisons in each leaf node, so it might be better to opt
for lower tree height in some cases; that's something to look into in the
future.
Differential Revision: http://reviews.llvm.org/D9318
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236192
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Thu, 30 Apr 2015 00:52:42 +0000 (00:52 +0000)]
Make sure we don't resize(0) when we get a fwdref with Idx == UINT_MAX
Make it an error instead.
Bug found with AFL fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236190
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 00:45:46 +0000 (00:45 +0000)]
Store relocations in a map from MCSectionELF.
Saves finding the MCSectionData just to do a map lookup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236189
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 30 Apr 2015 00:30:40 +0000 (00:30 +0000)]
Write relocations directly to the output stream. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236187
91177308-0d34-0410-b5e6-
96231b3b80d8
Ahmed Bougacha [Thu, 30 Apr 2015 00:07:34 +0000 (00:07 +0000)]
Flip r236172 testcase RUN option ordering for BSD sed(1). NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236186
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Wed, 29 Apr 2015 23:51:33 +0000 (23:51 +0000)]
Change x86 CMOVE_F to read it source, not write it.
This was breaking sqlite with the machine verifier because operand 0 was a def according to tablegen, but didn't have the 'isDef' flag set.
Looking at the ISA, its clear that this operand is a source as writing to st(0) is implicit. So move the operand to the correct place in the td file.
rdar://problem/
20751584
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236183
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Wed, 29 Apr 2015 23:33:32 +0000 (23:33 +0000)]
Fix doxygen comment typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236180
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 29 Apr 2015 23:00:35 +0000 (23:00 +0000)]
[opaque pointer type] Store the value type of an alloca
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236175
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 29 Apr 2015 22:49:54 +0000 (22:49 +0000)]
[WinEH] Start EH preparation for 32-bit x86, it uses no arguments
32-bit x86 MSVC-style exceptions are functionaly similar to 64-bit, but
they take no arguments. Instead, they implicitly use the value of EBP
passed in by the caller as a pointer to the parent's frame. In LLVM, we
can represent this as llvm.frameaddress(1), and feed that into all of
our calls to llvm.framerecover.
The next steps are:
- Add an alloca to the fs:00 linked list of handlers
- Add something like llvm.sjlj.lsda or generalize it to store in the
alloca
- Move state number calculation to WinEHPrepare, arrange for
FunctionLoweringInfo to call it
- Use the state numbers to insert explicit loads and stores in the IR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236172
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 29 Apr 2015 22:30:02 +0000 (22:30 +0000)]
generalize binop reassociation; NFC
Move the fold introduced in r236031:
http://reviews.llvm.org/rL236031
to its own helper function, so we can use it for other binops.
This is a preliminary step before partially solving:
https://llvm.org/bugs/show_bug.cgi?id=21768
https://llvm.org/bugs/show_bug.cgi?id=23116
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236171
91177308-0d34-0410-b5e6-
96231b3b80d8
Pat Gavlin [Wed, 29 Apr 2015 21:52:45 +0000 (21:52 +0000)]
Run StatepointLowering.{cpp,h} through clang-format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236166
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 29 Apr 2015 21:45:24 +0000 (21:45 +0000)]
[NFC] Updating FileCheck to reduce the std::vector interface used via cl::list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236164
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Wed, 29 Apr 2015 21:45:22 +0000 (21:45 +0000)]
[NFC] Converting to range-based for.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236163
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 29 Apr 2015 21:22:39 +0000 (21:22 +0000)]
[opaque pointer type] Pass GlobalAlias the actual pointer type rather than decomposing it into pointee type + address space
Many of the callers already have the pointer type anyway, and for the
couple of callers that don't it's pretty easy to call PointerType::get
on the pointee type and address space.
This avoids LLParser from using PointerType::getElementType when parsing
GlobalAliases from IR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236160
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 29 Apr 2015 21:13:30 +0000 (21:13 +0000)]
Inline FragmentWriter into the only user.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236158
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 29 Apr 2015 21:09:32 +0000 (21:09 +0000)]
Write the symbol table directly to the output file.
There is no need to first accumulate it in fragments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236157
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 29 Apr 2015 21:01:41 +0000 (21:01 +0000)]
tidy up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236156
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 29 Apr 2015 20:39:37 +0000 (20:39 +0000)]
Use pwrite to write the number of sections.
This avoids having to compute the number upfront, which will be used in the
next patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236153
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 29 Apr 2015 20:38:02 +0000 (20:38 +0000)]
too much space again; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236150
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 29 Apr 2015 20:34:31 +0000 (20:34 +0000)]
Write the string table directly to the output file.
There is no need to accumulate it in fragments first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236148
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Wed, 29 Apr 2015 20:32:57 +0000 (20:32 +0000)]
too much space; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236147
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Wed, 29 Apr 2015 20:30:57 +0000 (20:30 +0000)]
[Sparc] Really add sparcel architecture support.
Mostly copy-and-paste from Sparc v8 architecture.
Differential Revision: http://reviews.llvm.org/D8741
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236146
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 29 Apr 2015 20:25:24 +0000 (20:25 +0000)]
Write the section header string table directly to the output stream.
Instead of accumulating the content in a fragment first, just write it
to the output stream.
Also put it first in the section table, so that we never have to worry
about its index being >= SHN_LORESERVE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236145
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Wed, 29 Apr 2015 20:06:41 +0000 (20:06 +0000)]
Clean up docs references to './configure' in preparation for deprecating in-source builds
http://reviews.llvm.org/D8787
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236144
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Wed, 29 Apr 2015 20:03:38 +0000 (20:03 +0000)]
[AArch64] Refactor out codes that depend on specific CS save sequence.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236143
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Wed, 29 Apr 2015 19:20:10 +0000 (19:20 +0000)]
Avoid a few const_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236141
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 29 Apr 2015 19:16:38 +0000 (19:16 +0000)]
ARM: mark branch-like instructions with correct flags.
There's probably no way to test BXJ, but if the compiler ever did emit it
during CodeGen it would have to be a block terminator so "isBranch" is
appropriate.
BLX is more tricky. Clearly a call, but it affects surprisingly little.
rdar://
18719544
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236140
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Wed, 29 Apr 2015 19:15:08 +0000 (19:15 +0000)]
New architecture name - 'sparcel' for Sparc little-endian.
Differential Revision: http://reviews.llvm.org/D9263
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236139
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Wed, 29 Apr 2015 18:48:29 +0000 (18:48 +0000)]
Make Sparc assembler accept parenthesized constant expressions.
Differential Revision: http://reviews.llvm.org/D9087
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236137
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 29 Apr 2015 17:23:22 +0000 (17:23 +0000)]
[mips][microMIPSr6] Implement MUL, MUH, MULU and MUHU instructions
Differential Revision: http://reviews.llvm.org/D8894
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236131
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 29 Apr 2015 17:21:26 +0000 (17:21 +0000)]
[WinEH] Fix minor bug in begincatch block splitting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236129
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 29 Apr 2015 16:54:11 +0000 (16:54 +0000)]
Disable failing TestDevNull test on Windows
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236126
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Wed, 29 Apr 2015 16:52:17 +0000 (16:52 +0000)]
Temporarily relax a check in the debug info verifier.
The clang frontend helps out GDB by emitting the members of local anonymous
unions as artificial local variables with shared storage. When SROA splits
the storage for artificial local variables that are smaller than the entire
union, the overhang piece will be outside of the allotted space for the
variable and this check fails.
rdar://problem/
20730771
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236124
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 29 Apr 2015 16:46:01 +0000 (16:46 +0000)]
[X86] Avoid mangling frameescape labels
x86 Windows uses the '_' prefix for all global symbols, and this was
mistakenly being applied to frameescape labels, which are not externally
visible global symbols. They use the private global prefix 'L'.
The *right* way to fix this is probably to stop masquerading this label
as an ExternalSymbol and create a new SDNode type. These labels are not
"external", and we know they will be resolved by assembly time. Having a
custom SDNode type would allow us to do better X86 address mode
matching, so it's probably worth doing eventually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236123
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 29 Apr 2015 16:38:44 +0000 (16:38 +0000)]
IR: Give 'DI' prefix to debug info metadata
Finish off PR23080 by renaming the debug info IR constructs from `MD*`
to `DI*`. The last of the `DIDescriptor` classes were deleted in
r235356, and the last of the related typedefs removed in r235413, so
this has all baked for about a week.
Note: If you have out-of-tree code (like a frontend), I recommend that
you get everything compiling and tests passing with the *previous*
commit before updating to this one. It'll be easier to keep track of
what code is using the `DIDescriptor` hierarchy and what you've already
updated, and I think you're extremely unlikely to insert bugs. YMMV of
course.
Back to *this* commit: I did this using the rename-md-di-nodes.sh
upgrade script I've attached to PR23080 (both code and testcases) and
filtered through clang-format-diff.py. I edited the tests for
test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns
were off-by-three. It should work on your out-of-tree testcases (and
code, if you've followed the advice in the previous paragraph).
Some of the tests are in badly named files now (e.g.,
test/Assembler/invalid-mdcompositetype-missing-tag.ll should be
'dicompositetype'); I'll come back and move the files in a follow-up
commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236120
91177308-0d34-0410-b5e6-
96231b3b80d8
Jan Vesely [Wed, 29 Apr 2015 16:30:46 +0000 (16:30 +0000)]
CodeGen: Default overflow operations to expand so we don't have to assume targets are lying
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: ab
Differential Revision: http://reviews.llvm.org/D9265
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236119
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 29 Apr 2015 16:22:46 +0000 (16:22 +0000)]
[mips][microMIPSr6] Implement SUB and SUBU instructions
Differential Revision: http://reviews.llvm.org/D8764
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236118
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Wed, 29 Apr 2015 15:11:07 +0000 (15:11 +0000)]
[mips][microMIPSr6] Implement ADD, ADDU and ADDIU instructions
Differential Revision: http://reviews.llvm.org/D8704
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236111
91177308-0d34-0410-b5e6-
96231b3b80d8