oota-llvm.git
9 years agoInstCombine: Clean up foldLogOpOfMaskedICmps
David Majnemer [Tue, 18 Nov 2014 09:31:36 +0000 (09:31 +0000)]
InstCombine: Clean up foldLogOpOfMaskedICmps

No functional change intended.

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

9 years agodocs: Modernize some examples in WritingAnLLVMPass
Justin Bogner [Tue, 18 Nov 2014 05:22:39 +0000 (05:22 +0000)]
docs: Modernize some examples in WritingAnLLVMPass

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

9 years agodocs: Fix a couple of typo-ish errors in WritingAnLLVMPass
Justin Bogner [Tue, 18 Nov 2014 05:00:52 +0000 (05:00 +0000)]
docs: Fix a couple of typo-ish errors in WritingAnLLVMPass

- Make CallGraphSCCPass's paragraph about doFinalization refer to
  runOnSCC instead of runOnFunction, since that's what it's about.
- Fix a reference in the FunctionPass paragraph.

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

9 years agoAllow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable...
Frederic Riss [Tue, 18 Nov 2014 02:46:11 +0000 (02:46 +0000)]
Allow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable DIE.

Usually global variables are in a retain list and instanciated before
any call to constructImportedEntityDIE is made. This isn't true for
forward declarations though.
The testcase for this change is generated by a clang patched to emit
such forward declarations (patch at http://reviews.llvm.org/D6173
which will land soon). The updated testcase tests more than just
global variables, it now tests every type of 'using' clause we
support.

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

9 years agollvm-readobj: Don't print the Characteristics field as the Subsystem
David Majnemer [Tue, 18 Nov 2014 02:45:28 +0000 (02:45 +0000)]
llvm-readobj: Don't print the Characteristics field as the Subsystem

We claimed that we were printing the Subystem field when we were
actually printing the Characteristics field.

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

9 years agoSimplifyCFG: Range'ify some for-loops. No functional change.
Hans Wennborg [Tue, 18 Nov 2014 02:37:11 +0000 (02:37 +0000)]
SimplifyCFG: Range'ify some for-loops. No functional change.

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

9 years agoIndVarSimplify: Allow LFTR to fire more often
David Majnemer [Tue, 18 Nov 2014 02:20:58 +0000 (02:20 +0000)]
IndVarSimplify: Allow LFTR to fire more often

I added a pessimization in r217102 to prevent miscompiles when the
incremented induction variable was used in a comparison; it would be
poison.

Try to use the incremented induction variable more often when we can be
sure that the increment won't end in poison.

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

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

9 years agoIR: Sink MDNode::Hash down to GenericMDNode::Hash
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 02:20:29 +0000 (02:20 +0000)]
IR: Sink MDNode::Hash down to GenericMDNode::Hash

Part of PR21532.

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

9 years agoIR: Move MDNode operands from the back to the front
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 01:56:14 +0000 (01:56 +0000)]
IR: Move MDNode operands from the back to the front

Having the operands at the back prevents subclasses from safely adding
fields.  Move them to the front.

Instead of replicating the custom `malloc()`, `free()` and `DestroyFlag`
logic that was there before, overload `new` and `delete`.

I added calls to a new `GenericMDNode::dropAllReferences()` in
`LLVMContextImpl::~LLVMContextImpl()`.  There's a maze of callbacks
happening during teardown, and this resolves them before we enter
the destructors.

Part of PR21532.

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

9 years agoUpdate testing case that was accidently duplicated.
Manman Ren [Tue, 18 Nov 2014 01:49:06 +0000 (01:49 +0000)]
Update testing case that was accidently duplicated.

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

9 years agoFix covered switch warning
Michael J. Spencer [Tue, 18 Nov 2014 01:26:46 +0000 (01:26 +0000)]
Fix covered switch warning

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

9 years agoSupport ELF files of unknown type.
Michael J. Spencer [Tue, 18 Nov 2014 01:14:25 +0000 (01:14 +0000)]
Support ELF files of unknown type.

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

9 years agoIR: Split MDNode into GenericMDNode and MDNodeFwdDecl
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 00:37:17 +0000 (00:37 +0000)]
IR: Split MDNode into GenericMDNode and MDNodeFwdDecl

Split `MDNode` into two classes:

  - `GenericMDNode`, which is uniquable (and for now, always starts
    uniqued).  Once `Metadata` is split from the `Value` hierarchy, this
    class will lose the ability to RAUW itself.

  - `MDNodeFwdDecl`, which is used for the "temporary" interface, is
    never uniqued, and isn't managed by `LLVMContext` at all.

I've left most of the guts in `MDNode` for now, but I'll incrementally
move things to the right places (or delete the functionality, as
appropriate).

Part of PR21532.

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

9 years agoRevert r222040 because of bot failure.
Manman Ren [Tue, 18 Nov 2014 00:33:22 +0000 (00:33 +0000)]
Revert r222040 because of bot failure.

http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green.

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

9 years agoDebug Info: In DIBuilder, the context field of a global variable is updated to
Manman Ren [Tue, 18 Nov 2014 00:29:08 +0000 (00:29 +0000)]
Debug Info: In DIBuilder, the context field of a global variable is updated to
use DIScopeRef.

A paired commit at clang will follow to show cases where we will use an
identifer for the context of a global variable.

rdar://18958417

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

9 years agoIR: Simplify uniquing for MDNode
Duncan P. N. Exon Smith [Mon, 17 Nov 2014 23:28:21 +0000 (23:28 +0000)]
IR: Simplify uniquing for MDNode

Change uniquing from a `FoldingSet` to a `DenseSet` with custom
`DenseMapInfo`.  Unfortunately, this doesn't save any memory, since
`DenseSet<T>` is a simple wrapper for `DenseMap<T, char>`, but I'll come
back to fix that later.

I used the name `GenericDenseMapInfo` to the custom `DenseMapInfo` since
I'll be splitting `MDNode` into two classes soon: `MDNodeFwdDecl` for
temporaries, and `GenericMDNode` for everything else.

I also added a non-debug-info reduced version of a type-uniquing test
that started failing on an earlier draft of this patch.

Part of PR21532.

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

9 years agoRevert "ADT: correctly report isMSVCEnvironment for windows itanium"
Reid Kleckner [Mon, 17 Nov 2014 22:55:59 +0000 (22:55 +0000)]
Revert "ADT: correctly report isMSVCEnvironment for windows itanium"

This reverts commit r222180.

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

9 years agoRevert "Improve memory ownership/management in TableGen by unique_ptrifying TreePatte...
David Blaikie [Mon, 17 Nov 2014 22:55:41 +0000 (22:55 +0000)]
Revert "Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member."

This reverts commit r222183.

Broke on the MSVC buildbots due to MSVC not producing default move
operations - I'd fix it immediately but just broke my build system a
bit, so backing out until I have a chance to get everything going again.

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

9 years agoImprove memory ownership/management in TableGen by unique_ptrifying TreePattern's...
David Blaikie [Mon, 17 Nov 2014 22:16:55 +0000 (22:16 +0000)]
Improve memory ownership/management in TableGen by unique_ptrifying TreePattern's Tree member.

The next step is to actually use unique_ptr in TreePatternNode's
Children vector. That will be more intrusive, and may not work,
depending on exactly how these things are handled (I have a bad
suspicion things are shared more than they should be, making this more
DAG than tree - but if it's really a tree, unique_ptr should suffice)

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

9 years agoCMake: Use the new USES_TERMINAL option for test suite targets when available.
Peter Collingbourne [Mon, 17 Nov 2014 22:16:15 +0000 (22:16 +0000)]
CMake: Use the new USES_TERMINAL option for test suite targets when available.

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

9 years agoADT: correctly report isMSVCEnvironment for windows itanium
Saleem Abdulrasool [Mon, 17 Nov 2014 22:13:26 +0000 (22:13 +0000)]
ADT: correctly report isMSVCEnvironment for windows itanium

The itanium environment on Windows uses MSVC and is a MSVC environment.  Report
this correctly.

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

9 years agoR600/SI: Don't copy flags when extracting subreg
Matt Arsenault [Mon, 17 Nov 2014 21:11:37 +0000 (21:11 +0000)]
R600/SI: Don't copy flags when extracting subreg

This was resulting in use of a register after a kill.
For some reason this showed up as a problem in many tests
when moving the SIFixSGPRCopies pass closer to instruction
selection.

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

9 years agoR600/SI: Assume SIFixSGPRCopies makes changes
Matt Arsenault [Mon, 17 Nov 2014 21:11:34 +0000 (21:11 +0000)]
R600/SI: Assume SIFixSGPRCopies makes changes

I'm not sure if this was breaking anything.

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

9 years agoFix the autoconf build.
Rafael Espindola [Mon, 17 Nov 2014 21:06:38 +0000 (21:06 +0000)]
Fix the autoconf build.

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

9 years agoFactor common code it Linker::init.
Rafael Espindola [Mon, 17 Nov 2014 20:51:01 +0000 (20:51 +0000)]
Factor common code it Linker::init.

The TypeFinder was not being used in one of the constructors.

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

9 years agoPass a reference to ValueEnumerator.
Rafael Espindola [Mon, 17 Nov 2014 20:06:27 +0000 (20:06 +0000)]
Pass a reference to ValueEnumerator.

NFC. This will just make it easier to use std::unique_ptr in a caller.

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

9 years ago[SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.
Juergen Ributzka [Mon, 17 Nov 2014 19:39:56 +0000 (19:39 +0000)]
[SimplifyCFG] Make the value type of the hole check bitmask a power-of-2.

When converting a switch to a lookup table we might have to generate a bitmaks
to encode and check for holes in the original switch statement.

The type of this mask depends on the number of switch statements, which can
result in illegal types for pretty much all architectures.

To avoid unnecessary type legalization and help FastISel this commit increases
the size of the bitmask to next power-of-2 value when necessary.

This fixes rdar://problem/18984639.

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

9 years agoRevert commits r222146 and r222137.
Rafael Espindola [Mon, 17 Nov 2014 19:26:40 +0000 (19:26 +0000)]
Revert commits r222146 and r222137.

They were producing the wrong result if NumBits == BitsInWord. The old mask
produced -1, the new mask 0.

This should fix the 32 bit bots.

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

9 years agoFix GraphTraits for "const CallGraphNode *" and "const CallGraph *"
Rafael Espindola [Mon, 17 Nov 2014 17:51:45 +0000 (17:51 +0000)]
Fix GraphTraits for "const CallGraphNode *" and "const CallGraph *"

The specializations were broken. For example,

void foo(const CallGraph *G) {
  auto I = GraphTraits<const CallGraph *>::nodes_begin(G);
  auto K = I++;

  ...
}

or

void bar(const CallGraphNode *N) {
  auto I = GraphTraits<const CallGraphNode *>::nodes_begin(G);
  auto K = I++;

  ....
}

would not compile.

Patch by Speziale Ettore!

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

9 years agoAvoid undefined behavior by masking the shift amount.
Rafael Espindola [Mon, 17 Nov 2014 17:43:27 +0000 (17:43 +0000)]
Avoid undefined behavior by masking the shift amount.

Should hopefully fix the mips bots.

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

9 years ago[Reassociate] As the expression tree is rewritten make sure the operands are
Chad Rosier [Mon, 17 Nov 2014 16:33:50 +0000 (16:33 +0000)]
[Reassociate] As the expression tree is rewritten make sure the operands are
emitted in canonical form.

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

9 years ago[X86] Use ADD/SUB instead of INC/DEC for Haswell and Broadwell CPUs
Alexey Volkov [Mon, 17 Nov 2014 16:17:51 +0000 (16:17 +0000)]
[X86] Use ADD/SUB instead of INC/DEC for Haswell and Broadwell CPUs

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

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

9 years ago[Reassociate] Canonicalize constants to RHS operand.
Chad Rosier [Mon, 17 Nov 2014 15:52:51 +0000 (15:52 +0000)]
[Reassociate] Canonicalize constants to RHS operand.

Fix a thinko where the RHS was already a constant.

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

9 years agoUse a more canonical way of computing a mask with N trailing 1s. NFC.
Rafael Espindola [Mon, 17 Nov 2014 15:46:21 +0000 (15:46 +0000)]
Use a more canonical way of computing a mask with N trailing 1s. NFC.

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

9 years agoFix ARM triple parsing
Renato Golin [Mon, 17 Nov 2014 14:08:57 +0000 (14:08 +0000)]
Fix ARM triple parsing

The triple parser should only accept existing architecture names
when the triple starts with armv, armebv, thumbv or thumbebv.

Patch by Gabor Ballabas.

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

9 years agoScalarEvolution: Construct SCEVDivision's Derived type instead of itself
David Majnemer [Mon, 17 Nov 2014 11:27:45 +0000 (11:27 +0000)]
ScalarEvolution: Construct SCEVDivision's Derived type instead of itself

SCEVDivision::divide constructed an object of SCEVDivision<Derived>
instead of Derived.  divide would call visit which would cast the
SCEVDivision<Derived> to type Derived.  As it happens,
SCEVDivision<Derived> and Derived currently have the same layout but
this is fragile and grounds for UB.

Instead, just construct Derived.  No functional change intended.

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

9 years ago[Thumb1] Re-write emitThumbRegPlusImmediate
Oliver Stannard [Mon, 17 Nov 2014 11:18:10 +0000 (11:18 +0000)]
[Thumb1] Re-write emitThumbRegPlusImmediate

This was motivated by a bug which caused code like this to be
miscompiled:
  declare void @take_ptr(i8*)
  define void @test() {
    %addr1.32 = alloca i8
    %addr2.32 = alloca i32, i32 1028
    call void @take_ptr(i8* %addr1)
    ret void
  }

This was emitting the following assembly to get the value of %addr1:
  add r0, sp, #1020
  add r0, r0, #8
However, "add r0, r0, #8" is not a valid Thumb1 instruction, and this
could not be assembled. The generated object file contained this,
resulting in r0 holding SP+8 rather tha SP+1028:
  add r0, sp, #1020
  add r0, sp, #8

This function looked like it could have caused miscompilations for
other combinations of registers and offsets (though I don't think it is
currently called with these), and the heuristic it used did not match
the emitted code in all cases.

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

9 years agoObject, COFF: Tighten the object file parser
David Majnemer [Mon, 17 Nov 2014 11:17:17 +0000 (11:17 +0000)]
Object, COFF: Tighten the object file parser

We were a little lax in a few areas:
- We pretended that import libraries were like any old COFF file, they
  are not.  In fact, they aren't really COFF files at all, we should
  probably grow some specialized functionality to handle them smarter.
- Our symbol iterators were more than happy to attempt to go past the
  end of the symbol table if you had a symbol with a bad list of
  auxiliary symbols.

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

9 years agoFix optimisations of SELECT_CC which assumed result is boolean
Oliver Stannard [Mon, 17 Nov 2014 10:49:31 +0000 (10:49 +0000)]
Fix optimisations of SELECT_CC which assumed result is boolean

Some optimisations in DAGCombiner cause miscompilations for targets that use
TargetLowering::UndefinedBooleanContent, because they assume that the results
of a SELECT_CC node are boolean values, and can be safely ANDed, ORed and
XORed. These optimisations are only valid for targets that use
ZeroOrOneBooleanContent or ZeroOrNegativeOneBooleanContent.

This is a follow-up to D6210/r221693.

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

9 years agosilence gcc 4.9.1 warning in /llvm/lib/Support/Windows/Path.inc:564:39:
Yaron Keren [Mon, 17 Nov 2014 09:29:33 +0000 (09:29 +0000)]
silence gcc 4.9.1 warning in /llvm/lib/Support/Windows/Path.inc:564:39:
warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if (ec = widenPath(path, path_utf16))

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

9 years agoOptimize switch lookup tables with linear mapping.
Erik Eckstein [Mon, 17 Nov 2014 09:13:57 +0000 (09:13 +0000)]
Optimize switch lookup tables with linear mapping.

This is a simple optimization for switch table lookup:
It computes the output value directly with an (optional) mul and add if there is a linear mapping between index and output.
Example:

int f1(int x) {
  switch (x) {
    case 0: return 10;
    case 1: return 11;
    case 2: return 12;
    case 3: return 13;
  }
  return 0;
}

generates:

define i32 @f1(i32 %x) #0 {
entry:
  %0 = icmp ult i32 %x, 4
  br i1 %0, label %switch.lookup, label %return

switch.lookup:
  %switch.offset = add i32 %x, 10
  ret i32 %switch.offset

return:
  ret i32 0
}

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

9 years agoFix CR/LF line endings in test case.
Bob Wilson [Mon, 17 Nov 2014 08:00:45 +0000 (08:00 +0000)]
Fix CR/LF line endings in test case.

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

9 years agoAdd missing semicolon from r222118.
Craig Topper [Mon, 17 Nov 2014 05:58:26 +0000 (05:58 +0000)]
Add missing semicolon from r222118.

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

9 years agoMove register class name strings to a single array in MCRegisterInfo to reduce static...
Craig Topper [Mon, 17 Nov 2014 05:50:14 +0000 (05:50 +0000)]
Move register class name strings to a single array in MCRegisterInfo to reduce static table size and number of relocation entries.

Indices into the table are stored in each MCRegisterClass instead of a pointer. A new method, getRegClassName, is added to MCRegisterInfo and TargetRegisterInfo to lookup the string in the table.

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

9 years agoAdd back r222061 with a fix.
Rafael Espindola [Mon, 17 Nov 2014 02:28:27 +0000 (02:28 +0000)]
Add back r222061 with a fix.

This adds back r222061, but now calls initializePAEvalPass from the correct
library to avoid link problems.

Original message:

Don't make assumptions about the name of private global variables.

Private variables are can be renamed, so it is not reliable to make
decisions on the name.

The name is also dropped by the assembler before getting to the
linker, so using the name causes a disconnect between how llvm makes a
decision (var name) and how the linker makes a decision (section it is
in).

This patch changes one case where we were looking at the variable name to use
the section instead.

Test tuning by Michael Gottesman.

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

9 years agoImplement MachODumper::printFileHeaders
Frederic Riss [Mon, 17 Nov 2014 01:34:15 +0000 (01:34 +0000)]
Implement MachODumper::printFileHeaders

Patch by Chilledheart.

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

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

9 years agoReplace a couple asserts with static_asserts.
Craig Topper [Mon, 17 Nov 2014 00:26:50 +0000 (00:26 +0000)]
Replace a couple asserts with static_asserts.

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

9 years agoFix typo
Tobias Grosser [Sun, 16 Nov 2014 21:19:35 +0000 (21:19 +0000)]
Fix typo

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

9 years agoConvert some EVTs to MVTs where only a SimpleValueType is needed.
Craig Topper [Sun, 16 Nov 2014 21:17:18 +0000 (21:17 +0000)]
Convert some EVTs to MVTs where only a SimpleValueType is needed.

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

9 years agoScalarEvolution: Introduce SCEVSDivision and SCEVUDivision
David Majnemer [Sun, 16 Nov 2014 20:35:19 +0000 (20:35 +0000)]
ScalarEvolution: Introduce SCEVSDivision and SCEVUDivision

It turns out that not all users of SCEVDivision want the same
signedness.  Let the users determine which operation they'd like by
explicitly choosing SCEVUDivision or SCEVSDivision.

findArrayDimensions and computeAccessFunctions will use SCEVSDivision
while HowFarToZero will use SCEVUDivision.

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

9 years ago[DependenceAnalysis] Allow subscripts of different types
Jingyue Wu [Sun, 16 Nov 2014 16:52:44 +0000 (16:52 +0000)]
[DependenceAnalysis] Allow subscripts of different types

Summary:
Several places in DependenceAnalysis assumes both SCEVs in a subscript pair
share the same integer type. For instance, isKnownPredicate calls
SE->getMinusSCEV(X, Y) which asserts X and Y share the same type. However,
DependenceAnalysis fails to ensure this assumption when producing a subscript
pair, causing tests such as NonCanonicalizedSubscript to crash. With this
patch, DependenceAnalysis runs unifySubscriptType before producing any
subscript pair, ensuring the assumption.

Test Plan:
Added NonCanonicalizedSubscript.ll on which DependenceAnalysis before the fix
crashed because subscripts have different types.

Reviewers: spop, sebpop, jingyue

Reviewed By: jingyue

Subscribers: eliben, meheff, llvm-commits

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

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

9 years ago[x86] Remove two redundant isel patterns. They equivalent already exists in the instr...
Craig Topper [Sun, 16 Nov 2014 09:24:16 +0000 (09:24 +0000)]
[x86] Remove two redundant isel patterns. They equivalent already exists in the instruction pattern.

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

9 years agoScalarEvolution: HowFarToZero was wrongly using signed division
David Majnemer [Sun, 16 Nov 2014 07:30:35 +0000 (07:30 +0000)]
ScalarEvolution: HowFarToZero was wrongly using signed division

HowFarToZero was supposed to use unsigned division in order to calculate
the backedge taken count.  However, SCEVDivision::divide performs signed
division.  Unless I am mistaken, no users of SCEVDivision actually want
signed arithmetic: switch to udiv and urem.

This fixes PR21578.

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

9 years agoInstSimplify: Optimize ICmpInst xform that uses computeKnownBits
David Majnemer [Sun, 16 Nov 2014 02:20:08 +0000 (02:20 +0000)]
InstSimplify: Optimize ICmpInst xform that uses computeKnownBits

A few things:
- computeKnownBits is relatively expensive, let's delay its use as long
  as we can.
- Don't create two APInt values just to run computeKnownBits on a
  ConstantInt, we already know the exact value!
- Avoid creating a temporary APInt value in order to calculate unary
  negation.

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

9 years ago[DAG] Improved target independent vector shuffle folding logic.
Andrea Di Biagio [Sat, 15 Nov 2014 22:56:25 +0000 (22:56 +0000)]
[DAG] Improved target independent vector shuffle folding logic.

This patch teaches the DAGCombiner how to combine shuffles according to rules:
   shuffle(shuffle(A, Undef, M0), B, M1) -> shuffle(B, A, M2)
   shuffle(shuffle(A, B, M0), B, M1) -> shuffle(B, A, M2)
   shuffle(shuffle(A, B, M0), A, M1) -> shuffle(B, A, M2)

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

9 years ago[X86][SSE] Improve legal SHUFP and PSHUFD shuffle matching
Simon Pilgrim [Sat, 15 Nov 2014 21:13:05 +0000 (21:13 +0000)]
[X86][SSE] Improve legal SHUFP and PSHUFD shuffle matching

Updated X86TargetLowering::isShuffleMaskLegal to match SHUFP masks with commuted inputs and PSHUFD masks that reference the second input.

As part of this I've refactored isPSHUFDMask to work in a more general manner and allow it to match against either the first or second input vector.

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

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

9 years agoDispose disassembler after use in unit test.
Benjamin Kramer [Sat, 15 Nov 2014 10:53:12 +0000 (10:53 +0000)]
Dispose disassembler after use in unit test.

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

9 years agoProvide missing definition of uppercase_CMAKE_BUILD_TYPE in HandleLLVMOptions module
Eric Fiselier [Sat, 15 Nov 2014 07:45:31 +0000 (07:45 +0000)]
Provide missing definition of uppercase_CMAKE_BUILD_TYPE in HandleLLVMOptions module

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

9 years agoR600: Permute operands when selecting legacy min/max
Matt Arsenault [Sat, 15 Nov 2014 05:02:57 +0000 (05:02 +0000)]
R600: Permute operands when selecting legacy min/max

This gets the correct NaN behavior based on the compare type
the hardware uses. This now passes the new piglit test I have
for this on SI.

Add stricter tests for the operand order.

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

9 years agoyaml2obj, COFF: Consider the DOS stub when laying out section headers
David Majnemer [Sat, 15 Nov 2014 02:03:59 +0000 (02:03 +0000)]
yaml2obj, COFF: Consider the DOS stub when laying out section headers

While this program worked correctly with small example programs, larger
ones tickled this bug.  I'm working on a reduction because my program is
quite large.

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

9 years agoRevert "Don't make assumptions about the name of private global variables."
Reid Kleckner [Sat, 15 Nov 2014 02:03:53 +0000 (02:03 +0000)]
Revert "Don't make assumptions about the name of private global variables."

This reverts commit r222061.

It's causing linker errors.

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

9 years agoR600: Fix 64-bit integer division
Tom Stellard [Sat, 15 Nov 2014 01:07:57 +0000 (01:07 +0000)]
R600: Fix 64-bit integer division

This fixes a failure in one of the oclconform tests.

Patch by: Jan Vesely

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

9 years agoR600: Factor i64 UDIVREM lowering into its own fuction
Tom Stellard [Sat, 15 Nov 2014 01:07:53 +0000 (01:07 +0000)]
R600: Factor i64 UDIVREM lowering into its own fuction

This is so it could potentially be used by SI.  However, the current
implementation does not always produce correct results, so the
IntegerDivisionPass is being used instead.

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

9 years agoDIBuilder: Use Constant instead of Value
Duncan P. N. Exon Smith [Sat, 15 Nov 2014 00:23:49 +0000 (00:23 +0000)]
DIBuilder: Use Constant instead of Value

Make explicit the requirement that most IR values in `DIBuilder` are
`Constant`.  This requires a follow-up change in clang.

Part of PR21532.

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

9 years agoDIBuilder: Change private helper function to static, NFC
Duncan P. N. Exon Smith [Sat, 15 Nov 2014 00:05:04 +0000 (00:05 +0000)]
DIBuilder: Change private helper function to static, NFC

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

9 years agoIR: Remove MDString logic for Value::hasName()
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 23:58:20 +0000 (23:58 +0000)]
IR: Remove MDString logic for Value::hasName()

This isn't necessary after r221960.

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

9 years agoDIBuilder: Cleanup access control style, NFC
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 23:55:52 +0000 (23:55 +0000)]
DIBuilder: Cleanup access control style, NFC

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

9 years agoDI: Use Metadata for DITypeRef and DIScopeRef
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 23:55:03 +0000 (23:55 +0000)]
DI: Use Metadata for DITypeRef and DIScopeRef

Now that `MDString` and `MDNode` have a common base class, use it.  Note
that it's not useful to assume subclasses of `Metadata` must be one or
the other since we'll be adding more subclasses soon enough.

Part of PR21532.

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

9 years agoRename EH related stuff to be more precise
Reid Kleckner [Fri, 14 Nov 2014 23:31:07 +0000 (23:31 +0000)]
Rename EH related stuff to be more precise

Summary:
The current "WinEH" exception handling type is more about Itanium-style
LSDA tables layered on top of the Windows native unwind info format
instead of .eh_frame tables or EHABI unwind info. Use the name
"ItaniumWinEH" to better reflect the hybrid nature of the design.

Also rename isExceptionHandlingDWARF to usesItaniumLSDAForExceptions,
since the LSDA is part of the Itanium C++ ABI document, and not the
DWARF standard.

Reviewers: echristo

Subscribers: llvm-commits, compnerd

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

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

9 years agoDon't make assumptions about the name of private global variables.
Rafael Espindola [Fri, 14 Nov 2014 23:17:47 +0000 (23:17 +0000)]
Don't make assumptions about the name of private global variables.

Private variables are can be renamed, so it is not reliable to make
decisions on the name.

The name is also dropped by the assembler before getting to the
linker, so using the name causes a disconnect between how llvm makes a
decision (var name) and how the linker makes a decision (section it is
in).

This patch changes one case where we were looking at the variable name to use
the section instead.

Test tuning by Michael Gottesman.

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

9 years agoARM: refactor .cfi_def_cfa_offset emission.
Tim Northover [Fri, 14 Nov 2014 22:45:33 +0000 (22:45 +0000)]
ARM: refactor .cfi_def_cfa_offset emission.

We use to track quite a few "adjusted" offsets through the FrameLowering code
to account for changes in the prologue instructions as we went and allow the
emission of correct CFA annotations. However, we were missing a couple of cases
and the code was almost impenetrable.

It's easier to just add any stack-adjusting instruction to a list and emit them
together.

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

9 years agoARM: correctly calculate the offset of FP in its push.
Tim Northover [Fri, 14 Nov 2014 22:45:31 +0000 (22:45 +0000)]
ARM: correctly calculate the offset of FP in its push.

When we folded the DPR alignment gap into a push, we weren't noting the extra
distance from the beginning of the push to the FP, and so FP ended up pointing
at an incorrect offset.

The .cfi_def_cfa_offset directives are still wrong in this case, but I think
that can be improved by refactoring.

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

9 years agoARM: simplify test.
Tim Northover [Fri, 14 Nov 2014 22:45:23 +0000 (22:45 +0000)]
ARM: simplify test.

The test's DWARF stubs were there just to trigger the emission of .cfi
directives. Fortunately, the NetBSD ABI already demands proper DWARF unwind
info, so it's easier to just use that triple.

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

9 years agoRerun AutoRegen.sh.
Eric Christopher [Fri, 14 Nov 2014 22:10:16 +0000 (22:10 +0000)]
Rerun AutoRegen.sh.

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

9 years agoTurn a leaked object into a stack variable instead.
David Blaikie [Fri, 14 Nov 2014 21:53:50 +0000 (21:53 +0000)]
Turn a leaked object into a stack variable instead.

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

9 years agoAdd the code and test cases for 64-bit ARM to llvm-objdump’s Mach-O symbolizer.
Kevin Enderby [Fri, 14 Nov 2014 21:52:18 +0000 (21:52 +0000)]
Add the code and test cases for 64-bit ARM to llvm-objdump’s Mach-O symbolizer.

FYI, removed the unused MCInstrAnalysis as it does not exist for 64-bit ARM and
was causing a “couldn't initialize disassembler for target” error.

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

9 years agoAdd a test for r222029 that doesn't rely on the default target being a COFF platform.
Frederic Riss [Fri, 14 Nov 2014 21:23:26 +0000 (21:23 +0000)]
Add a test for r222029 that doesn't rely on the default target being a COFF platform.

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

9 years agoInstCombine: Fix infinite loop caused by visitFPTrunc
David Majnemer [Fri, 14 Nov 2014 21:21:15 +0000 (21:21 +0000)]
InstCombine: Fix infinite loop caused by visitFPTrunc

We would attempt to replace a fptrunc of an frem with an identical
fptrunc.  This would cause the new fptrunc to be added to the worklist.
Of course, this results in an infinite loop because we will keep
visiting the newly created fptruncs.

This fixes PR21576.

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

9 years agoReapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before
Chad Rosier [Fri, 14 Nov 2014 21:09:13 +0000 (21:09 +0000)]
Reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before
doing Load PRE"

This commit updates the failing test in
Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll

The failing test is sensitive to the order in which we process loads.  This
version turns on the RPO traversal instead of the while DT traversal in GVN.
The new test code is functionally same just the order of loads that are
eliminated is swapped.

This new version also fixes an issue where GVN splits a critical edge and
potentially invalidate the RPO/DT iterator.

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

9 years agoChange order of tablegen generated fast-isel instruction code to be
Bill Schmidt [Fri, 14 Nov 2014 21:05:45 +0000 (21:05 +0000)]
Change order of tablegen generated fast-isel instruction code to be
based on instruction complexity

The order that tablegen fast-isel instruction code is generated is
currently based on the text of the predicate (using string
less-than). This patch changes this to instead use the instruction
complexity. Because the complexities are not unique a C++ multimap is
used instead of a map.

This fixes the problem where code with no predicate always comes out
first (the empty string always compares as less than all other
strings) thus making the code with predicates dead code. See the FMUL
code in PPCFastISel.cpp for an example. It also more closely matches
the normal codegen ordering. Some error checking in the tablegen
fast-isel code is fixed as well.

Patch by Bill Seurer.

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

9 years agoR600/SI: Mark s_movk_i32 as rematerializable
Tom Stellard [Fri, 14 Nov 2014 20:43:28 +0000 (20:43 +0000)]
R600/SI: Mark s_movk_i32 as rematerializable

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

9 years agoR600/SI: Fix spilling of m0 register
Tom Stellard [Fri, 14 Nov 2014 20:43:26 +0000 (20:43 +0000)]
R600/SI: Fix spilling of m0 register

If we have spilled the value of the m0 register, then we need to restore
it with v_readlane_b32 to a regular sgpr, because v_readlane_b32 can't
write to m0.

v_readlane_b32 can't write to m0, so

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

9 years agoCOFF: Add support for Dwarf accelerator tables.
Frederic Riss [Fri, 14 Nov 2014 20:33:40 +0000 (20:33 +0000)]
COFF: Add support for Dwarf accelerator tables.

This allows COFF targets to emit accelerator tables
when requested by -dwarf-accel-tables=Enable instead
of aborting. The test DebugInfo/cross-cu-inlining.ll
covers this on COFF platforms.

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

9 years agoR600/SI: Combine min3/max3 instructions
Matt Arsenault [Fri, 14 Nov 2014 20:08:52 +0000 (20:08 +0000)]
R600/SI: Combine min3/max3 instructions

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

9 years agoyaml2obj, COFF: Correctly calculate SizeOfImage and SizeOfHeaders
David Majnemer [Fri, 14 Nov 2014 19:35:59 +0000 (19:35 +0000)]
yaml2obj, COFF: Correctly calculate SizeOfImage and SizeOfHeaders

SizeOfHeaders must be aligned to the FileAlignment.
SizeOfImage must be at least the SizeOfHeaders aligned to the
SectionAlignment.

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

9 years ago[dwarfdump] Handle relocations in Dwarf accelerator tables
Frederic Riss [Fri, 14 Nov 2014 19:30:08 +0000 (19:30 +0000)]
[dwarfdump] Handle relocations in Dwarf accelerator tables

ELF targets (and maybe COFF) use relocations when referring
to strings in the .debug_str section. Handle that in the
accelerator table dumper. This commit restores the
test/DebugInfo/cross-cu-inlining.ll test to its expected
platform independant form, validating that the fix works
(this test failed on linux boxes).

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

9 years agoRemove redundant virtual on overriden functions.
David Blaikie [Fri, 14 Nov 2014 19:06:36 +0000 (19:06 +0000)]
Remove redundant virtual on overriden functions.

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

9 years agoIR: Make MDString inherit from Metadata
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:45:40 +0000 (18:45 +0000)]
IR: Make MDString inherit from Metadata

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

9 years agoR600/SI: Fix verifier error from a branch on IMPLICIT_DEF
Matt Arsenault [Fri, 14 Nov 2014 18:43:41 +0000 (18:43 +0000)]
R600/SI: Fix verifier error from a branch on IMPLICIT_DEF

SIILowerI1Copies wasn't correctly handling this case.

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

9 years agoIR: Take an LLVMContext in Metadata::Metadata()
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:42:09 +0000 (18:42 +0000)]
IR: Take an LLVMContext in Metadata::Metadata()

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

9 years agoAdd a blank line, NFC
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:42:06 +0000 (18:42 +0000)]
Add a blank line, NFC

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

9 years agoFix unused variable warning without asserts
Matt Arsenault [Fri, 14 Nov 2014 18:40:49 +0000 (18:40 +0000)]
Fix unused variable warning without asserts

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

9 years agoR600/SI: Match integer min / max instructions
Matt Arsenault [Fri, 14 Nov 2014 18:30:06 +0000 (18:30 +0000)]
R600/SI: Match integer min / max instructions

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

9 years agoR600/SI: Use S_BFE_I64 for 64-bit sext_inreg
Matt Arsenault [Fri, 14 Nov 2014 18:18:16 +0000 (18:18 +0000)]
R600/SI: Use S_BFE_I64 for 64-bit sext_inreg

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

9 years ago[Reassociate] Canonicalize the operands of all binary operators.
Chad Rosier [Fri, 14 Nov 2014 17:09:19 +0000 (17:09 +0000)]
[Reassociate] Canonicalize the operands of all binary operators.

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

9 years agoTentatively appease the bots.
Frederic Riss [Fri, 14 Nov 2014 17:08:18 +0000 (17:08 +0000)]
Tentatively appease the bots.

If this workaround gets the bots green, then we have to find out
why the -dwarf-accel-tables=Enable option doesn't work as
expected on non-darwin platforms.

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

9 years ago[Reassociate] Canonicalize operands of vector binary operators.
Chad Rosier [Fri, 14 Nov 2014 17:08:15 +0000 (17:08 +0000)]
[Reassociate] Canonicalize operands of vector binary operators.

Prior to this commit fmul and fadd binary operators were being canonicalized for
both scalar and vector versions.  We now canonicalize add, mul, and, or, and xor
vector instructions.

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

9 years ago[Reassociate] Canonicalize constants to RHS operand.
Chad Rosier [Fri, 14 Nov 2014 17:05:59 +0000 (17:05 +0000)]
[Reassociate] Canonicalize constants to RHS operand.

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

9 years agoReapply "[dwarfdump] Add support for dumping accelerator tables."
Frederic Riss [Fri, 14 Nov 2014 16:15:53 +0000 (16:15 +0000)]
Reapply "[dwarfdump] Add support for dumping accelerator tables."

This reverts commit r221842 which was a revert of r221836 and of the
test parts of r221837.

This new version fixes an UB bug pointed out by David (along with
addressing some other review comments), makes some dumping more
resilient to broken input data and forces the accelerator tables
to be dumped in the tests where we use them (this decision is
platform specific otherwise).

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

9 years ago[AVX512] Add 512b masked integer shift by immediate patterns.
Cameron McInally [Fri, 14 Nov 2014 15:43:00 +0000 (15:43 +0000)]
[AVX512] Add 512b masked integer shift by immediate patterns.

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