oota-llvm.git
9 years ago[x32] Change the condition from bitness to LP64 for TCRETURNdi64.
Michael Kuperstein [Wed, 28 Jan 2015 16:11:35 +0000 (16:11 +0000)]
[x32] Change the condition from bitness to LP64 for TCRETURNdi64.

TCRETURNmi64, which was mistakenly changed in r227307 will wait for another day.

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

9 years agoR600: Move DataLayout to AMDGPUTargetMachine
Tom Stellard [Wed, 28 Jan 2015 16:04:26 +0000 (16:04 +0000)]
R600: Move DataLayout to AMDGPUTargetMachine

This is a follow up to r227113.

It is now required to use the amdgcn target for SI and newer GPUs.

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

9 years agoR600: Use a Southern Islands GPU as the default for the amdgcn target
Tom Stellard [Wed, 28 Jan 2015 15:38:42 +0000 (15:38 +0000)]
R600: Use a Southern Islands GPU as the default for the amdgcn target

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

9 years agoCorrect the AggressiveAntiDepBreaker's handling of subregisters defining super registers
Hal Finkel [Wed, 28 Jan 2015 14:44:14 +0000 (14:44 +0000)]
Correct the AggressiveAntiDepBreaker's handling of subregisters defining super registers

As the AggressiveAntiDepBreaker iterated backward through a scheduling region,
we must leave super registers live through subregister definitions so that all
relevant subregister definitions are renamed together. The problem was that we
were also discarding sub-register use locations as the sub-registers are
redefined. The result is that we'd rename the super register along with some,
but not all, subregister definitions.

  R0_D = {R0_L, R1_L}
  R0_L = {R0_S, R1_S}

  %R0_L<def> = TRLi9 16, pred:8, pred:%noreg
  %R1_L<def> = LSRLrr %R1_L<kill>, %R0_S, pred:8, pred:%noreg
  %R0_L<def> = LSRLrr %R2_L, %R0_S, pred:8, pred:%noreg, %R0_L<imp-use,kill>
  %R1_L<def> = ANDLri %R1_L<kill>, 2047, pred:8, pred:%noreg
  %R0_L<def> = ANDLri %R0_L<kill>, 2047, pred:8, pred:%noreg
  %R4_D<def> = ASRDrr %R0_D<kill>, %R6_S

  Anti:   %R4_D<def> = ASRDrr %R0_D<kill>, %R6_S
   Def Groups: R4_D=g213->g215(via R4_S)->g214(via R4_L)->g216(via R5_S)->g216(via R4_L)->g217(via R5_L)
   Use Groups: R0_D=g0->g218(last-use) R1_L->g219(last-use) R6_S=g204->g220(last-use)
  Anti:   %R0_L<def> = ANDLri %R0_L<kill>, 2047, pred:8, pred:%noreg
   Def Groups: R0_L=g208->g209(via R0_S)->g218(via R0_D)->g210(via R1_S)->g210(via R0_D)
   Antidep reg: R0_L (real dependency)
   Use Groups: R0_L=g210->g224(last-use) R0_S->g225(last-use) R1_S->g226(last-use)
  Anti:   %R1_L<def> = ANDLri %R1_L<kill>, 2047, pred:8, pred:%noreg
   Def Groups: R1_L=g219->g210(via R0_D)
   Antidep reg: R1_L (real dependency)
   Use Groups: R1_L=g210->g229(last-use)
  Anti:   %R0_L<def> = LSRLrr %R2_L, %R0_S, pred:8, pred:%noreg, %R0_L<imp-use,kill>
   Def Groups: R0_L=g224->g225(via R0_S)->g210(via R0_D)->g226(via R1_S)->g226(via R0_D)
   Antidep reg: R0_L Use Groups: R2_L=g192 R0_S=g226->g230(last-use) R0_L=g226->g231(last-use) R1_S->g232(last-use)
  Anti:   %R1_L<def> = LSRLrr %R1_L<kill>, %R0_S, pred:8, pred:%noreg
   Def Groups: R1_L=g229->g226(via R0_D)
   Antidep reg: R1_L Use Groups: R1_L=g226->g233(last-use) R0_S=g230
  Anti:   %R0_L<def> = TRLi9 16, pred:8, pred:%noreg
   Def Groups: R0_L=g231->g230(via R0_S)->g226(via R0_D)->g232(via R1_S)->g232(via R0_D)
   Antidep reg: R0_L
   Rename Candidates for Group g232:
    R0_D: elcInt64Regs :: R0_D R1_D R2_D R3_D R4_D R5_D R8_D R9_D R10_D R11_D R12_D R13_D R14_D R15_D R16_D R17_D R18_D R19_D R20_D R21_D R22_D R23_D R24_D R25_D
    R0_L: elcIntRegs :: R0_L R1_L R2_L R3_L R4_L R5_L R8_L R9_L R10_L R11_L R12_L R13_L R14_L R15_L R16_L R17_L R18_L R19_L R20_L R21_L R22_L R23_L R24_L R25_L
    R0_S: elcShrtRegs elcShrtRegs :: R0_S R1_S R2_S R3_S R4_S R5_S R8_S R9_S R10_S R11_S R12_S R13_S R14_S R15_S R16_S R17_S R18_S R19_S R20_S R21_S R22_S R23_S R24_S R25_S
   Find Registers: [R12_D: R12_D R12_L R12_S]
   Breaking anti-dependence edge on R0_L: R0_D->R12_D(1 refs) R0_L->R12_L(2 refs) R0_S->R12_S(2 refs)
   Use Groups:
  ...

  %R12_L<def> = TRLi9 16, pred:8, pred:%noreg
  %R1_L<def> = LSRLrr %R1_L<kill>, %R12_S, pred:8, pred:%noreg
  %R0_L<def> = LSRLrr %R2_L<kill>, %R12_S, pred:8, pred:%noreg, %R12_L<imp-use>
  %R1_L<def> = ANDLri %R1_L<kill>, 2047, pred:8, pred:%noreg
  %R0_L<def> = ANDLri %R0_L<kill>, 2047, pred:8, pred:%noreg
  %R4_D<def> = ASRDrr %R12_D<kill>, %R6_S

With this change, we now produce:

  Anti:   %R4_D<def> = ASRDrr %R0_D<kill>, %R6_S
   Def Groups: R4_D=g213->g215(via R4_S)->g214(via R4_L)->g216(via R5_S)->g216(via R4_L)->g217(via R5_L)
   Use Groups: R0_D=g0->g218(last-use) R1_L->g219(last-use) R6_S=g204->g220(last-use)
  Anti:   %R0_L<def> = ANDLri %R0_L<kill>, 2047, pred:8, pred:%noreg
   Def Groups: R0_L=g208->g209(via R0_S)->g218(via R0_D)->g210(via R1_S)->g210(via R0_D)
   Antidep reg: R0_L (real dependency)
   Use Groups: R0_L=g210
  Anti:   %R1_L<def> = ANDLri %R1_L<kill>, 2047, pred:8, pred:%noreg
   Def Groups: R1_L=g219->g210(via R0_D)
   Antidep reg: R1_L (real dependency)
   Use Groups: R1_L=g210
  Anti:   %R0_L<def> = LSRLrr %R2_L, %R0_S, pred:8, pred:%noreg, %R0_L<imp-use,kill>
   Def Groups: R0_L=g210->g210(via R0_D)->g210(via R0_D)
   Antidep reg: R0_L Use Groups: R2_L=g192 R0_S=g210 R0_L=g210
  Anti:   %R1_L<def> = LSRLrr %R1_L<kill>, %R0_S, pred:8, pred:%noreg
   Def Groups: R1_L=g210->g210(via R0_D)
   Antidep reg: R1_L Use Groups: R1_L=g210 R0_S=g210
  Anti:   %R0_L<def> = TRLi9 16, pred:8, pred:%noreg
   Def Groups: R0_L=g210->g210(via R0_D)->g210(via R0_D)
   Antidep reg: R0_L
   Rename Candidates for Group g210:
    R0_D: elcInt64Regs :: R0_D R1_D R2_D R3_D R4_D R5_D R8_D R9_D R10_D R11_D R12_D R13_D R14_D R15_D R16_D R17_D R18_D R19_D R20_D R21_D R22_D R23_D R24_D R25_D
    R0_L: elcIntRegs elcIntAIRegs elcIntRegs elcIntRegs elcIntRegs elcIntRegs :: R0_L R1_L R2_L R3_L R4_L R5_L R8_L R9_L R10_L R11_L R12_L R13_L R14_L R15_L R16_L R17_L R18_L R19_L R20_L R21_L R22_L R23_L R24_L R25_L
    R1_L: elcIntRegs elcIntRegs elcIntRegs elcIntRegs elcIntRegs :: R0_L R1_L R2_L R3_L R4_L R5_L R8_L R9_L R10_L R11_L R12_L R13_L R14_L R15_L R16_L R17_L R18_L R19_L R20_L R21_L R22_L R23_L R24_L R25_L
    R0_S: elcShrtRegs elcShrtRegs :: R0_S R1_S R2_S R3_S R4_S R5_S R8_S R9_S R10_S R11_S R12_S R13_S R14_S R15_S R16_S R17_S R18_S R19_S R20_S R21_S R22_S R23_S R24_S R25_S
   Find Registers: [R12_D: R12_D R12_L R13_L R12_S]
   Breaking anti-dependence edge on R0_L: R0_D->R12_D(1 refs) R0_L->R12_L(7 refs) R1_L->R13_L(5 refs) R0_S->R12_S(2 refs)
   Use Groups:
  ...

  %R12_L<def> = TRLi9 16, pred:8, pred:%noreg
  %R13_L<def> = LSRLrr %R13_L<kill>, %R12_S, pred:8, pred:%noreg
  %R12_L<def> = LSRLrr %R2_L<kill>, %R12_S<kill>, pred:8, pred:%noreg, %R12_L<imp-use,kill>
  %R13_L<def> = ANDLri %R13_L<kill>, 2047, pred:8, pred:%noreg
  %R12_L<def> = ANDLri %R12_L<kill>, 2047, pred:8, pred:%noreg
  %R4_D<def> = ASRDrr %R12_D, %R6_S, %R12_L<imp-def>, %R12_S<imp-def>, %R13_S<imp-def>

As demonstrated by this example, this is also somewhat unfortunate, because
there is actually no need to rename the super register in this case (it is
fully covered by later subregister definitions), but we don't seem to track
enough information here to exploit that either.

Thanks to Daniil Troshkov for reporting the issue. The debug outputs in this
commit message are from Daniil.

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

9 years ago[X86] Reduce some 32-bit imuls into lea + shl
Michael Kuperstein [Wed, 28 Jan 2015 14:08:22 +0000 (14:08 +0000)]
[X86] Reduce some 32-bit imuls into lea + shl

Reduce integer multiplication by a constant of the form k*2^c, where k is in {3,5,9} into a lea + shl. Previously it was only done for imulq on 64-bit platforms, but it makes sense for imull and 32-bit as well.

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

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

9 years ago[x32] Enable sibcall optimization on x32.
Michael Kuperstein [Wed, 28 Jan 2015 13:38:48 +0000 (13:38 +0000)]
[x32] Enable sibcall optimization on x32.

This includes two things:
1) Fix TCRETURNdi and TCRETURN64di patterns to check the right thing (LP64 as opposed to target bitness).
2) Allow LEA64_32 in MatchingStackOffset.

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

9 years ago[docs] Use slightly more proper .rst markup
Sean Silva [Wed, 28 Jan 2015 10:36:41 +0000 (10:36 +0000)]
[docs] Use slightly more proper .rst markup

Again, I'd like to emphasize to everyone that this sort of markup change
is *not* what you should be concerned about when writing docs. Focus on
*content*.

I applaud Chandler for focusing on the fantastic content of this new
section!

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

9 years ago[docs] [cleanup] No need for a comment around C++11 override
Sean Silva [Wed, 28 Jan 2015 10:26:29 +0000 (10:26 +0000)]
[docs] [cleanup] No need for a comment around C++11 override

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

9 years agoAVX-512: Added FMA intrinsics with rounding mode
Elena Demikhovsky [Wed, 28 Jan 2015 10:21:27 +0000 (10:21 +0000)]
AVX-512: Added FMA intrinsics with rounding mode
By Asaf Badouh and Elena Demikhovsky

Added special nodes for rounding: FMADD_RND, FMSUB_RND..
It will prevent merge between nodes with rounding and other standard nodes.

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

9 years ago[X86] Teach disassembler to handle illegal immediates on AVX512 integer compare instr...
Craig Topper [Wed, 28 Jan 2015 10:09:56 +0000 (10:09 +0000)]
[X86] Teach disassembler to handle illegal immediates on AVX512 integer compare instructions.

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

9 years ago[X86] Merge printSSECC and printAVXCC. They only differed by an assertion.
Craig Topper [Wed, 28 Jan 2015 10:09:52 +0000 (10:09 +0000)]
[X86] Merge printSSECC and printAVXCC. They only differed by an assertion.

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

9 years ago[LPM] Rip all of ManagedStatic and ThreadLocal out of the pretty stack
Chandler Carruth [Wed, 28 Jan 2015 09:52:14 +0000 (09:52 +0000)]
[LPM] Rip all of ManagedStatic and ThreadLocal out of the pretty stack
tracing code.

Managed static was just insane overhead for this. We took memory fences
and external function calls in every path that pushed a pretty stack
frame. This includes a multitude of layers setting up and tearing down
passes, the parser in Clang, everywhere. For the regression test suite
or low-overhead JITs, this was contributing to really significant
overhead.

Even the LLVM ThreadLocal is really overkill here because it uses
pthread_{set,get}_specific logic, and has careful code to both allocate
and delete the thread local data. We don't actually want any of that,
and this code in particular has problems coping with deallocation. What
we want is a single TLS pointer that is valid to use during global
construction and during global destruction, any time we want. That is
exactly what every host compiler and OS we use has implemented for
a long time, and what was standardized in C++11. Even though not all of
our host compilers support the thread_local keyword, we can directly use
the platform-specific keywords to get the minimal functionality needed.
Provided this limited trial survives the build bots, I will move this to
Compiler.h so it is more widely available as a light weight if limited
alternative to the ThreadLocal class. Many thanks to David Majnemer for
helping me think through the implications across platforms and craft the
MSVC-compatible syntax.

The end result is *substantially* faster. When running llc in a tight
loop over a small IR file targeting the aarch64 backend, this improves
its performance by over 10% for me. It also seems likely to fix the
remaining regressions seen by JIT users with threading enabled.

This may actually have more impact on real-world compile times due to
the use of the pretty stack tracing utility throughout the rest of Clang
or LLVM, but I've not collected any detailed measurements.

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

9 years ago[LPM] A targeted but somewhat horrible fix to the legacy pass manager's
Chandler Carruth [Wed, 28 Jan 2015 09:47:21 +0000 (09:47 +0000)]
[LPM] A targeted but somewhat horrible fix to the legacy pass manager's
querying of the pass registry.

The pass manager relies on the static registry of PassInfo objects to
perform all manner of its functionality. I don't understand why it does
much of this. My very vague understanding is that this registry is
touched both during static initialization *and* while each pass is being
constructed. As a consequence it is hard to make accessing it not
require a acquiring some lock. This lock ends up in the hot path of
setting up, tearing down, and invaliditing analyses in the legacy pass
manager.

On most systems you can observe this as a non-trivial % of the time
spent in 'ninja check-llvm'. However, I haven't really seen it be more
than 1% in extreme cases of compiling more real-world software,
including LTO.

Unfortunately, some of the GPU JITs are seeing this taking essentially
all of their time because they have very small IR running through
a small pass pipeline very many times (at least, this is the vague
understanding I have of it).

This patch tries to minimize the cost of looking up PassInfo objects by
leveraging the fact that the objects themselves are immutable and they
are allocated separately on the heap and so don't have their address
change. It also requires a change I made the last time I tried to debug
this problem which removed the ability to de-register a pass from the
registry. This patch creates a single access path to these objects
inside the PMTopLevelManager which memoizes the result of querying the
registry. This is somewhat gross as I don't really know if
PMTopLevelManager is the *right* place to put it, and I dislike using
a mutable member to memoize things, but it seems to work.

For long-lived pass managers this should completely eliminate
the cost of acquiring locks to look into the pass registry once the
memoized cache is warm. For 'ninja check' I measured about 1.5%
reduction in CPU time and in total time on a machine with 32 hardware
threads. For normal compilation, I don't know how much this will help,
sadly. We will still pay the cost while we populate the memoized cache.
I don't think it will hurt though, and for LTO or compiles with many
small functions it should still be a win. However, for tight loops
around a pass manager with many passes and small modules, this will help
tremendously. On the AArch64 backend I saw nearly 50% reductions in time
to complete 2000 cycles of spinning up and tearing down the pipeline.
Measurements from Owen of an actual long-lived pass manager show more
along the lines of 10% improvements.

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

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

9 years agoFold fcmp in cases where value is provably non-negative. By Arch Robison.
Elena Demikhovsky [Wed, 28 Jan 2015 08:03:58 +0000 (08:03 +0000)]
Fold fcmp in cases where value is provably non-negative. By Arch Robison.

This patch folds fcmp in some cases of interest in Julia. The patch adds a function CannotBeOrderedLessThanZero that returns true if a value is provably not less than zero. I.e. the function returns true if the value is provably -0, +0, positive, or a NaN. The patch extends InstructionSimplify.cpp to fold instances of fcmp where:
 - the predicate is olt or uge
 - the first operand is provably not less than zero
 - the second operand is zero
The motivation for handling these cases optimizing away domain checks for sqrt in Julia for common idioms such as sqrt(x*x+y*y)..

http://reviews.llvm.org/D6972

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

9 years agollvm-ar: Remove unimplemented -N option from -help
David Majnemer [Wed, 28 Jan 2015 06:00:01 +0000 (06:00 +0000)]
llvm-ar: Remove unimplemented -N option from -help

This fixes PR22358.

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

9 years ago[LPM] Stop using the string based preservation API. It is an
Chandler Carruth [Wed, 28 Jan 2015 04:57:56 +0000 (04:57 +0000)]
[LPM] Stop using the string based preservation API. It is an
abomination.

For starters, this API is incredibly slow. In order to lookup the name
of a pass it must take a memory fence to acquire a pointer to the
managed static pass registry, and then potentially acquire locks while
it consults this registry for information about what passes exist by
that name. This stops the world of LLVMs in your process no matter
how little they cared about the result.

To make this more joyful, you'll note that we are preserving many passes
which *do not exist* any more, or are not even analyses which one might
wish to have be preserved. This means we do all the work only to say
"nope" with no error to the user.

String-based APIs are a *bad idea*. String-based APIs that cannot
produce any meaningful error are an even worse idea. =/

I have a patch that simply removes this API completely, but I'm hesitant
to commit it as I don't really want to perniciously break out-of-tree
users of the old pass manager. I'd rather they just have to migrate to
the new one at some point. If others disagree and would like me to kill
it with fire, just say the word. =]

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

9 years agoMigrate AArch64 except for TTI and AsmPrinter away from getSubtargetImpl.
Eric Christopher [Wed, 28 Jan 2015 03:51:33 +0000 (03:51 +0000)]
Migrate AArch64 except for TTI and AsmPrinter away from getSubtargetImpl.

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

9 years agoIntroduce a section to the programmers manual about type hierarchies,
Chandler Carruth [Wed, 28 Jan 2015 03:04:54 +0000 (03:04 +0000)]
Introduce a section to the programmers manual about type hierarchies,
polymorphism, and virtual dispatch.

This is essentially trying to explain the emerging design techniques
being used in LLVM these days somewhere more accessible than the
comments on a particular piece of infrastructure. It covers the
"concepts-based polymorphism" that caused some confusion during initial
reviews of the new pass manager as well as the tagged-dispatch mechanism
used pervasively in LLVM and Clang.

Perhaps most notably, I've tried to provide some criteria to help
developers choose between these options when designing new pieces of
infrastructure.

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

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

9 years agoAdd description to assert
David Blaikie [Wed, 28 Jan 2015 02:43:15 +0000 (02:43 +0000)]
Add description to assert

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

9 years agoPR22356: DebugInfo: Handle the size of a member where the type of that member is...
David Blaikie [Wed, 28 Jan 2015 02:34:53 +0000 (02:34 +0000)]
PR22356: DebugInfo: Handle the size of a member where the type of that member is a typedef (or other sugar) of a declaration.

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

9 years agoRevert r227247 and r227228: "Add weak symbol support to RuntimeDyld".
Lang Hames [Wed, 28 Jan 2015 01:30:37 +0000 (01:30 +0000)]
Revert r227247 and r227228: "Add weak symbol support to RuntimeDyld".

This has wider implications than I expected when I reviewed the patch: It can
cause JIT crashes where clients have used the default value for AbortOnFailure
during symbol lookup. I'm currently investigating alternative approaches and I
hope to have this back in tree soon.

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

9 years ago[llvm-pdbdump] Add basic symbol dumping.
Zachary Turner [Wed, 28 Jan 2015 01:22:33 +0000 (01:22 +0000)]
[llvm-pdbdump] Add basic symbol dumping.

This adds two command line options:

--symbols dumps a list of all symbols found in the PDB.
--symbol-details dumps the same list, but with detailed information
                 for every symbol such as type, attributes, etc.

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

9 years agoMove EH personality type classification to Analysis/LibCallSemantics.h
Reid Kleckner [Wed, 28 Jan 2015 01:17:38 +0000 (01:17 +0000)]
Move EH personality type classification to Analysis/LibCallSemantics.h

Summary:
Also add enum types for __C_specific_handler and _CxxFrameHandler3 for
which we know a few things.

Reviewers: majnemer

Subscribers: llvm-commits

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

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

9 years ago[llvm-pdbdump] Add support for printing source files and compilands.
Zachary Turner [Wed, 28 Jan 2015 00:33:00 +0000 (00:33 +0000)]
[llvm-pdbdump] Add support for printing source files and compilands.

This adds two command line options to llvm-pdbdump.

--source-files prints a flat list of all source files in the PDB.

--compilands prints a list of all compilands (e.g. object files)
             that the PDB knows about, and for each one, a list of
             source files that the compiland is composed of as well
             as a hash of the original source file.

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

9 years ago[llvm-pdbdump] Print more friendly names for enum values.
Zachary Turner [Wed, 28 Jan 2015 00:32:49 +0000 (00:32 +0000)]
[llvm-pdbdump] Print more friendly names for enum values.

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

9 years agoRevert r227242 - Merge vector stores into wider vector stores (PR21711).
Quentin Colombet [Tue, 27 Jan 2015 23:58:01 +0000 (23:58 +0000)]
Revert r227242 - Merge vector stores into wider vector stores (PR21711).

This commit creates infinite loop in DAG combine for in the LLVM test-suite
for aarch64 with mcpu=cylcone (just having neon may be enough to expose this).

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

9 years ago[mips] Use __clear_cache builtin instead of cacheflush()
Petar Jovanovic [Tue, 27 Jan 2015 23:30:18 +0000 (23:30 +0000)]
[mips] Use __clear_cache builtin instead of cacheflush()

Use __clear_cache builtin instead of cacheflush() in
Unix Memory::InvalidateInstructionCache().

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

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

9 years agoRun dos2unix against llvm-pdbdump.
Zachary Turner [Tue, 27 Jan 2015 23:02:23 +0000 (23:02 +0000)]
Run dos2unix against llvm-pdbdump.

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

9 years agoSymbolRewriter: allow rewriting with comdats
Saleem Abdulrasool [Tue, 27 Jan 2015 22:57:39 +0000 (22:57 +0000)]
SymbolRewriter: allow rewriting with comdats

COMDATs must be identically named to the symbol.  When support for COMDATs was
introduced, the symbol rewriter was not updated, resulting in rewriting failing
for symbols which were placed into COMDATs.  This corrects the behaviour and
adds test cases for this.

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

9 years agoSymbolRewriter: prevent unnecessary rewrite
Saleem Abdulrasool [Tue, 27 Jan 2015 22:57:35 +0000 (22:57 +0000)]
SymbolRewriter: prevent unnecessary rewrite

The rewrite for the pattern based rewrite is unnecessary if the existing name
matches the pattern.

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

9 years agoAdd support for dumping debug tables to llvm-pdbdump.
Zachary Turner [Tue, 27 Jan 2015 22:40:14 +0000 (22:40 +0000)]
Add support for dumping debug tables to llvm-pdbdump.

PDB stores some of its data in streams and some in tables.
This patch teaches llvm-pdbdump to dump basic summary data
for the debug tables.

In support of this, this patch also adds some DIA helper
classes, such as a wrapper around an IDiaSymbol interface,
as well as helpers for outputting various enumerations to
a raw_ostream.

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

9 years agoremove function names from comments; NFC
Sanjay Patel [Tue, 27 Jan 2015 22:26:56 +0000 (22:26 +0000)]
remove function names from comments; NFC

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

9 years agoRe-landing changes to use ArrayRef instead of SmallVectorImpl, and new API test.
Chris Bieneman [Tue, 27 Jan 2015 22:21:06 +0000 (22:21 +0000)]
Re-landing changes to use ArrayRef instead of SmallVectorImpl, and new API test.

This contains the changes from r227148 & r227154, and also fixes to the test case to properly clean up the stack options.

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

9 years ago[fuzzer] properly enable asan's coverage feedback
Kostya Serebryany [Tue, 27 Jan 2015 22:19:55 +0000 (22:19 +0000)]
[fuzzer] properly enable asan's coverage feedback

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

9 years agofix typos; NFC
Sanjay Patel [Tue, 27 Jan 2015 22:16:52 +0000 (22:16 +0000)]
fix typos; NFC

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

9 years agoAdd a Fuzzer library
Kostya Serebryany [Tue, 27 Jan 2015 22:08:41 +0000 (22:08 +0000)]
Add a Fuzzer library

Summary:
A simple genetic in-process coverage-guided fuzz testing library.

I've used this fuzzer to test clang-format
(it found 12+ bugs, thanks djasper@ for the fixes!)
and it may also help us test other parts of LLVM.
So why not keep it in the LLVM repository?

I plan to add the cmake build rules later (in a separate patch, if that's ok)
and also add a clang-format-fuzzer target.

See README.txt for details.

Test Plan: Tests will follow separately.

Reviewers: djasper, chandlerc, rnk

Reviewed By: rnk

Subscribers: majnemer, ygribov, dblaikie, llvm-commits

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

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

9 years ago[SimplifyLibCalls] Don't confuse strcpy_chk for stpcpy_chk.
Ahmed Bougacha [Tue, 27 Jan 2015 21:52:16 +0000 (21:52 +0000)]
[SimplifyLibCalls] Don't confuse strcpy_chk for stpcpy_chk.

This was introduced in a faulty refactoring (r225640, mea culpa):
the tests weren't testing the return values, so, for both
__strcpy_chk and __stpcpy_chk, we would return the end of the
buffer (matching stpcpy) instead of the beginning (for strcpy).

The root cause was the prefix "__" being ignored when comparing,
which made us always pick LibFunc::stpcpy_chk.
Pass the LibFunc::Func directly to avoid this kind of error.
Also, make the testcases as explicit as possible to prevent this.

The now-useful testcases expose another, entangled, stpcpy problem,
with the further simplification.  This was introduced in a
refactoring (r225640) to match the original behavior.

However, this leads to problems when successive simplifications
generate several similar instructions, none of which are removed
by the custom replaceAllUsesWith.

For instance, InstCombine (the main user) doesn't erase the
instruction in its custom RAUW.  When trying to simplify say
__stpcpy_chk:
- first, an stpcpy is created (fortified simplifier),
- second, a memcpy is created (normal simplifier), but the
  stpcpy call isn't removed.
- third, InstCombine later revisits the instructions,
  and simplifies the first stpcpy to a memcpy.  We now have
  two memcpys.

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

9 years agoTeach IRCE to look at branch weights when recognizing range checks
Sanjoy Das [Tue, 27 Jan 2015 21:38:12 +0000 (21:38 +0000)]
Teach IRCE to look at branch weights when recognizing range checks

Splitting a loop to make range checks redundant is profitable only if
the range check "never" fails. Make this fact a part of recognizing a
range check -- a branch is a range check only if it is expected to
pass (via branch_weights metadata).

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

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

9 years agoRevert "[x86] Combine x86mmx/i64 to v2i64 conversion to use scalar_to_vector"
Alexey Samsonov [Tue, 27 Jan 2015 21:34:11 +0000 (21:34 +0000)]
Revert "[x86] Combine x86mmx/i64 to v2i64 conversion to use scalar_to_vector"

This reverts commits r226953 and r226974.

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

9 years ago[ExecutionEngine] Fix r227228 tests on Windows
Keno Fischer [Tue, 27 Jan 2015 21:33:25 +0000 (21:33 +0000)]
[ExecutionEngine] Fix r227228 tests on Windows

On Windows, we're running MCJIT with ELF, so the module needs to have
its Triple explicitly adjusted.

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

9 years agodd the option, -link-opt-hints to llvm-objdump used with -macho to print the
Kevin Enderby [Tue, 27 Jan 2015 21:28:24 +0000 (21:28 +0000)]
dd the option, -link-opt-hints to llvm-objdump used with -macho to print the
Mach-O AArch64 linker optimization hints for ADRP code optimization.

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

9 years agoMerge vector stores into wider vector stores (PR21711)
Sanjay Patel [Tue, 27 Jan 2015 20:50:27 +0000 (20:50 +0000)]
Merge vector stores into wider vector stores (PR21711)

This patch resolves part of PR21711 ( http://llvm.org/bugs/show_bug.cgi?id=21711 ).

The 'f3' test case in that report presents a situation where we have two 128-bit
stores extracted from a 256-bit source vector.

Instead of producing this:

vmovaps %xmm0, (%rdi)
vextractf128    $1, %ymm0, 16(%rdi)

This patch merges the 128-bit stores into a single 256-bit store:

vmovups %ymm0, (%rdi)

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

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

9 years agoAdd llvm-pdbdump to tools.
Zachary Turner [Tue, 27 Jan 2015 20:46:21 +0000 (20:46 +0000)]
Add llvm-pdbdump to tools.

llvm-pdbdump is a tool which can be used to dump the contents
of Microsoft-generated PDB files.  It makes use of the Microsoft
DIA SDK, which is a COM based library designed specifically for
this purpose.

The initial commit of this tool dumps the raw bytes from PDB data
streams.  Future commits will dump more semantic information such
as types, symbols, source files, etc similar to the types of
information accessible via llvm-dwarfdump.

Reviewed by: Aaron Ballman, Reid Kleckner, Chandler Carruth
Differential Revision: http://reviews.llvm.org/D7153

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

9 years agotsan: properly instrument unaligned accesses
Dmitry Vyukov [Tue, 27 Jan 2015 20:19:17 +0000 (20:19 +0000)]
tsan: properly instrument unaligned accesses

If a memory access is unaligned, emit __tsan_unaligned_read/write
callbacks instead of __tsan_read/write.
Required to change semantics of __tsan_unaligned_read/write to not do the user memory.
But since they were unused (other than through __sanitizer_unaligned_load/store) this is fine.
Fixes long standing issue 17:
https://code.google.com/p/thread-sanitizer/issues/detail?id=17

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

9 years agooverloaded-intrinsic-name: exercise anyptr on struct
Ramkumar Ramachandra [Tue, 27 Jan 2015 20:03:08 +0000 (20:03 +0000)]
overloaded-intrinsic-name: exercise anyptr on struct

No other test I know shows how struct names are mangled in overloaded
intrinsic functions.

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

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

9 years ago[ExecutionEngine] Add weak symbol support to RuntimeDyld
Keno Fischer [Tue, 27 Jan 2015 20:02:31 +0000 (20:02 +0000)]
[ExecutionEngine] Add weak symbol support to RuntimeDyld

Support weak symbols by first looking up if there is an externally visible symbol we can find,
and only if that fails using the one in the object file we're loading.

Reviewed By: lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6950

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

9 years ago[ExecutionEngine] FindFunctionNamed: Skip declarations
Keno Fischer [Tue, 27 Jan 2015 19:29:00 +0000 (19:29 +0000)]
[ExecutionEngine] FindFunctionNamed: Skip declarations

Summary:
Basically all other methods that look up functions by name skip them if they are mere declarations.
Do the same in FindFunctionNamed.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

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

9 years ago[mips] Add range checks and transformation to octeon instructions in AsmParser.
Kai Nacke [Tue, 27 Jan 2015 19:11:28 +0000 (19:11 +0000)]
[mips] Add range checks and transformation to octeon instructions in AsmParser.

This patch adds range checks to the immediate operands of octeon
instructions in the AsmParser. Like gas, it applies the following
transformations if the immediate is to large:

bbit0 $8, 42, foo => bbit032 $8, 10, foo
bbit1 $8, 46, foo => bbit132 $8, 14, foo
cins $8, $31, 32, 31 => cins32 $8, $31, 0, 31
exts $7, $4, 54, 9 => exts32 $7, $4, 22, 9

Reviewed By: dsanders

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

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

9 years agoAdd cmake flag LLVM_USE_SANITIZE_COVERAGE
Kostya Serebryany [Tue, 27 Jan 2015 17:59:28 +0000 (17:59 +0000)]
Add cmake flag LLVM_USE_SANITIZE_COVERAGE

Summary:
When LLVM_USE_SANITIZE_COVERAGE=YES
and one of the sanitizers is used -fsanitize-coverage=3 will be added
to build flag. This will be used to run a coverage-guided fuzzer on various
llvm libraries.

Test Plan: n/a

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

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

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

9 years agoR600/SI: Enable all tests that pass on VI without changes
Marek Olsak [Tue, 27 Jan 2015 17:27:15 +0000 (17:27 +0000)]
R600/SI: Enable all tests that pass on VI without changes

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

9 years agoR600/SI: Fix MIN3/MAX3 on VI, define MED3
Marek Olsak [Tue, 27 Jan 2015 17:25:15 +0000 (17:25 +0000)]
R600/SI: Fix MIN3/MAX3 on VI, define MED3

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

9 years agoR600/SI: Don't set patterns for chip-specific instructions while having pseudos
Marek Olsak [Tue, 27 Jan 2015 17:25:11 +0000 (17:25 +0000)]
R600/SI: Don't set patterns for chip-specific instructions while having pseudos

Only pseudos have patterns on them.

Also don't set the asm string for VINTRP_Pseudo. All pseudos should have empty
asm.

This matches what all other multiclasses do.

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

9 years agoR600/SI: Add VI versions of LDS atomics
Marek Olsak [Tue, 27 Jan 2015 17:25:07 +0000 (17:25 +0000)]
R600/SI: Add VI versions of LDS atomics

Each class is split into two: one adds let statements around non-pseudos,
and the other one specifies the parameters.

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

9 years agoR600/SI: Add VI versions of MUBUF atomics
Marek Olsak [Tue, 27 Jan 2015 17:25:02 +0000 (17:25 +0000)]
R600/SI: Add VI versions of MUBUF atomics

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

9 years agoR600/SI: Add VI versions of MUBUF loads and stores
Marek Olsak [Tue, 27 Jan 2015 17:24:58 +0000 (17:24 +0000)]
R600/SI: Add VI versions of MUBUF loads and stores

This enables a lot of existing patterns for VI.

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

9 years agoR600/SI: Add pseudos for MUBUF loads and stores
Marek Olsak [Tue, 27 Jan 2015 17:24:54 +0000 (17:24 +0000)]
R600/SI: Add pseudos for MUBUF loads and stores

This defines the SI versions only, so it shouldn't change anything.

There are no changes other than using the new multiclasses, adding missing
mayLoad/mayStore, and formatting fixes.

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

9 years ago[InstCombine] Teach how to fold a select into a cttz/ctlz with the 'is_zero_undef...
Andrea Di Biagio [Tue, 27 Jan 2015 15:58:14 +0000 (15:58 +0000)]
[InstCombine] Teach how to fold a select into a cttz/ctlz with the 'is_zero_undef' flag.

This patch teaches the Instruction Combiner how to fold a cttz/ctlz followed by
a icmp plus select into a single cttz/ctlz with flag 'is_zero_undef' cleared.

Added test InstCombine/select-cmp-cttz-ctlz.ll.

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

9 years ago[sancov] Fix unspecified constructor order between sancov and asan.
Evgeniy Stepanov [Tue, 27 Jan 2015 15:01:22 +0000 (15:01 +0000)]
[sancov] Fix unspecified constructor order between sancov and asan.

Sanitizer coverage constructor must run after asan constructor (for each DSO).
Bump constructor priority to guarantee that.

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

9 years agoAdd a FIXME in SelectionDAGBuilder before an assert that is valid only on X86.
Manuel Jacob [Tue, 27 Jan 2015 13:14:35 +0000 (13:14 +0000)]
Add a FIXME in SelectionDAGBuilder before an assert that is valid only on X86.

When lowering memcpy, memset or memmove, this assert checks whether the pointer
operands are in an address space < 256 which means "user defined address space"
on X86.  However, this notion of "user defined address space" does not exist
for other targets.

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

9 years agoReplace some uses of getSubtargetImpl with the cached version
Eric Christopher [Tue, 27 Jan 2015 08:48:42 +0000 (08:48 +0000)]
Replace some uses of getSubtargetImpl with the cached version
off of the MachineFunction or with the version that takes a
Function reference as an argument.

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

9 years ago[PM] Clean up file banner comments prior to refactoring this code.
Chandler Carruth [Tue, 27 Jan 2015 08:28:33 +0000 (08:28 +0000)]
[PM] Clean up file banner comments prior to refactoring this code.

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

9 years agoHave the PBQP register allocator use the subtarget on the MachineFunction.
Eric Christopher [Tue, 27 Jan 2015 08:27:06 +0000 (08:27 +0000)]
Have the PBQP register allocator use the subtarget on the MachineFunction.
(and remove an extraneous private).

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

9 years agoRemove some extraneous includes.
Eric Christopher [Tue, 27 Jan 2015 08:27:03 +0000 (08:27 +0000)]
Remove some extraneous includes.

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

9 years agoFix build failure with pointer vs reference.
Eric Christopher [Tue, 27 Jan 2015 08:00:42 +0000 (08:00 +0000)]
Fix build failure with pointer vs reference.

NB: Saving files after editing helps.

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

9 years agoUpdate a few calls to getSubtarget<> to either be getSubtargetImpl
Eric Christopher [Tue, 27 Jan 2015 07:54:39 +0000 (07:54 +0000)]
Update a few calls to getSubtarget<> to either be getSubtargetImpl
when we didn't need the cast to the base class or the cached version
off of the subtarget.

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

9 years agoClean up the AArch64 store pair suppression pass initialization
Eric Christopher [Tue, 27 Jan 2015 07:54:36 +0000 (07:54 +0000)]
Clean up the AArch64 store pair suppression pass initialization
and remove and unnecessary class variable.

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

9 years agoThe subtarget is cached on the MachineFunction. Access it directly.
Eric Christopher [Tue, 27 Jan 2015 07:31:29 +0000 (07:31 +0000)]
The subtarget is cached on the MachineFunction. Access it directly.

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

9 years agoMigrate SeparateConstOffsetFromGEP to use a Function with
Eric Christopher [Tue, 27 Jan 2015 07:16:37 +0000 (07:16 +0000)]
Migrate SeparateConstOffsetFromGEP to use a Function with
getSubtarget.

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

9 years agoLoopRotate: Don't walk the uses of a Constant
David Majnemer [Tue, 27 Jan 2015 06:21:43 +0000 (06:21 +0000)]
LoopRotate: Don't walk the uses of a Constant

LoopRotate wanted to avoid live range interference by looking at the
uses of a Value in the loop latch and seeing if any lied outside of the
loop.  We would wrongly perform this operation on Constants.

This fixes PR22337.

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

9 years agoRemove unused include.
Eric Christopher [Tue, 27 Jan 2015 05:58:44 +0000 (05:58 +0000)]
Remove unused include.

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

9 years agoRevert r227148 & r227154 which added a test which infinitely loops.
Richard Trieu [Tue, 27 Jan 2015 03:03:47 +0000 (03:03 +0000)]
Revert r227148 & r227154 which added a test which infinitely loops.

r227148 added test CommandLineTest.HideUnrelatedOptionsMulti which repeatedly
outputs two following lines:

-tool: CommandLine Error: Option 'test-option-1' registered more than once!
-tool: CommandLine Error: Option 'test-option-2' registered more than once!

r227154 depends on changes from r227148

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

9 years ago[PM] Run clang-format over this header to clean up the very few)
Chandler Carruth [Tue, 27 Jan 2015 02:20:43 +0000 (02:20 +0000)]
[PM] Run clang-format over this header to clean up the very few)
divergent formatting issues. This should prevent any format-only diffs
from sneaking into subsequent changes to port TTI to the new pass
manager.

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

9 years ago[PM] Switch a doxygen comment to the standard format. NFC
Chandler Carruth [Tue, 27 Jan 2015 02:20:41 +0000 (02:20 +0000)]
[PM] Switch a doxygen comment to the standard format. NFC

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

9 years ago[PM] Refactor the core logic to run EarlyCSE over a function into an
Chandler Carruth [Tue, 27 Jan 2015 01:34:14 +0000 (01:34 +0000)]
[PM] Refactor the core logic to run EarlyCSE over a function into an
object that manages a single run of this pass.

This was already essentially how it worked. Within the run function, it
would point members at *stack local* allocations that were only live for
a single run. Instead, it seems much cleaner to have a utility object
whose lifetime is clearly bounded by the run of the pass over the
function and can use member variables in a more direct way.

This also makes it easy to plumb the analyses used into it from the pass
and will make it re-usable with the new pass manager.

No functionality changed here, its just a refactoring.

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

9 years agoMachineRegisterInfo can access TII off of the MachineFunction's
Eric Christopher [Tue, 27 Jan 2015 01:15:16 +0000 (01:15 +0000)]
MachineRegisterInfo can access TII off of the MachineFunction's
subtarget and so doesn't need the TargetMachine or to access via
getSubtargetImpl. Update all callers.

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

9 years agoMigrate AtomicExpandPass and DwarfEHPrepare to using a Function-ized getSubtargetImpl.
Eric Christopher [Tue, 27 Jan 2015 01:04:42 +0000 (01:04 +0000)]
Migrate AtomicExpandPass and DwarfEHPrepare to using a Function-ized getSubtargetImpl.

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

9 years agoFix unsigned/signed comparison warning.
Eric Christopher [Tue, 27 Jan 2015 01:01:39 +0000 (01:01 +0000)]
Fix unsigned/signed comparison warning.

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

9 years agoMigrate CodeGenPrepare to use the Function based getSubtarget
Eric Christopher [Tue, 27 Jan 2015 01:01:38 +0000 (01:01 +0000)]
Migrate CodeGenPrepare to use the Function based getSubtarget
code.

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

9 years agoGrab the TargetLowering info from the DAG rather than querying for
Eric Christopher [Tue, 27 Jan 2015 01:01:36 +0000 (01:01 +0000)]
Grab the TargetLowering info from the DAG rather than querying for
a subtarget.

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

9 years agoRemove extraneous period.
Eric Christopher [Tue, 27 Jan 2015 01:01:34 +0000 (01:01 +0000)]
Remove extraneous period.

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

9 years agoOne more fix to the new API to fix const-correctness.
Chris Bieneman [Tue, 27 Jan 2015 00:42:00 +0000 (00:42 +0000)]
One more fix to the new API to fix const-correctness.

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

9 years agoReplace this testcase with an even shorter one provided by dblaikie.
Adrian Prantl [Tue, 27 Jan 2015 00:22:17 +0000 (00:22 +0000)]
Replace this testcase with an even shorter one provided by dblaikie.

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

9 years agoCommoning of target specific load/store intrinsics in Early CSE.
Chad Rosier [Mon, 26 Jan 2015 22:51:15 +0000 (22:51 +0000)]
Commoning of target specific load/store intrinsics in Early CSE.

Phabricator revision: http://reviews.llvm.org/D7121
Patch by Sanjin Sijaric <ssijaric@codeaurora.org>!

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

9 years agoPete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl...
Chris Bieneman [Mon, 26 Jan 2015 22:50:47 +0000 (22:50 +0000)]
Pete Cooper suggested the new API should use ArrayRef instead of SmallVectorImpl. Also adding a test case.

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

9 years agoAdd test cases for PRE w/volatile loads
Philip Reames [Mon, 26 Jan 2015 22:40:44 +0000 (22:40 +0000)]
Add test cases for PRE w/volatile loads

These tests check that the combination of 227110 (cross block query inst) and 227112 (volatile load semantics) work together properly to allow PRE in cases where a loop contains a volatile access.

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

9 years ago[X86][SSE] Float comparisons can sometimes be safely commuted
Simon Pilgrim [Mon, 26 Jan 2015 22:29:24 +0000 (22:29 +0000)]
[X86][SSE] Float comparisons can sometimes be safely commuted

For ordered, unordered, equal and not-equal tests, packed float and double comparison instructions can be safely commuted without affecting the results. This patch checks the comparison mode of the (v)cmpps + (v)cmppd instructions and commutes the result if it can.

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

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

9 years agoHave the UTF conversion wrappers append a null terminator.
Zachary Turner [Mon, 26 Jan 2015 22:05:50 +0000 (22:05 +0000)]
Have the UTF conversion wrappers append a null terminator.

This is especially useful for the UTF8 -> UTF16 direction, since
there is no equivalent of llvm::SmallString<> for wide characters.
This means that anyone who wants a null terminated string is forced
to manually push and pop their own null terminator.

Reviewed by: Reid Kleckner.

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

9 years ago[X86][PCLMUL] Enable commutation for PCLMUL instructions
Simon Pilgrim [Mon, 26 Jan 2015 22:00:18 +0000 (22:00 +0000)]
[X86][PCLMUL] Enable commutation for PCLMUL instructions

Patch to allow (v)pclmulqdq to be commuted - swaps the src registers and inverts the immediate (low/high) src mask.

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

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

9 years agoAdd new HideUnrelatedOptions API that takes a SmallVectorImpl.
Chris Bieneman [Mon, 26 Jan 2015 21:57:29 +0000 (21:57 +0000)]
Add new HideUnrelatedOptions API that takes a SmallVectorImpl.

Need a new API for clang-modernize that allows specifying a list of option categories to remain visible. This will allow clang-modernize to move off getRegisteredOptions.

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

9 years agoLine endings fix. NFC.
Simon Pilgrim [Mon, 26 Jan 2015 21:28:32 +0000 (21:28 +0000)]
Line endings fix. NFC.

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

9 years agoR600: Cleanup or test
Matt Arsenault [Mon, 26 Jan 2015 21:16:10 +0000 (21:16 +0000)]
R600: Cleanup or test

Fix broken check lines, use multiple check prefixes,
add an additional test for i1 or.

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

9 years agoLine endings fix. NFC.
Simon Pilgrim [Mon, 26 Jan 2015 21:15:42 +0000 (21:15 +0000)]
Line endings fix. NFC.

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

9 years agobpf: fix build due to 'Move DataLayout back to the TargetMachine'
Alexei Starovoitov [Mon, 26 Jan 2015 20:43:15 +0000 (20:43 +0000)]
bpf: fix build due to 'Move DataLayout back to the TargetMachine'

commit r227113 moved DataLayout

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

9 years ago[x86][MMX] Rename and cleanup tests: arith, intrinsics and shuffle
Bruno Cardoso Lopes [Mon, 26 Jan 2015 20:06:51 +0000 (20:06 +0000)]
[x86][MMX] Rename and cleanup tests: arith, intrinsics and shuffle

- Rename mmx-builtins to mmx-intrinsics to match other intrinsic test naming.
- Remove tests that duplicate functionality from mmx-intrinsics.ll.
- Move arith related tests to mmx-arith.ll.
- MMX related shuffle goes to vector-shuffle-mmx.ll.

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

9 years agoSimplifyCFG: Omit range checks for switch lookup tables when default is unreachable
Hans Wennborg [Mon, 26 Jan 2015 19:52:34 +0000 (19:52 +0000)]
SimplifyCFG: Omit range checks for switch lookup tables when default is unreachable

The range check would get optimized away later, but we might as well not emit
them in the first place.

http://reviews.llvm.org/D6471

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

9 years agoSimplifyCFG: don't remove unreachable default switch destinations
Hans Wennborg [Mon, 26 Jan 2015 19:52:32 +0000 (19:52 +0000)]
SimplifyCFG: don't remove unreachable default switch destinations

An unreachable default destination can be exploited by other optimizations and
allows for more efficient lowering. Both the SDag switch lowering and
LowerSwitch can exploit unreachable defaults.

Also make TurnSwitchRangeICmp handle switches with unreachable default.
This is kind of separate change, but it cannot be tested without the change
above, and I don't want to land the change above without this since that would
regress other tests.

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

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

9 years agoMake ConstantFoldTerminator() handle switches with unreachable default.
Hans Wennborg [Mon, 26 Jan 2015 19:52:24 +0000 (19:52 +0000)]
Make ConstantFoldTerminator() handle switches with unreachable default.

Tested by Transforms/SimplifyCFG/switch-to-br.ll's @unreachable function.

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

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

9 years ago[NVPTX] Generate a more optimal sequence for select of i1
Justin Holewinski [Mon, 26 Jan 2015 19:52:20 +0000 (19:52 +0000)]
[NVPTX] Generate a more optimal sequence for select of i1

Instead of creating a pattern like "(p && a) || ((!p) && b)",
just expand the i8 operands to i32 and perform the selp on them.

Fixes PR22246

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

9 years agoAdd a UTF8 to UTF16 conversion wrapper for use in the pdb dumper
Reid Kleckner [Mon, 26 Jan 2015 19:51:00 +0000 (19:51 +0000)]
Add a UTF8 to UTF16 conversion wrapper for use in the pdb dumper

This can also be used instead of the WindowsSupport.h ConvertUTF8ToUTF16
helpers, but that will require massaging some character types. The
Windows support routines want wchar_t output, but wchar_t is often 32
bits on non-Windows OSs.

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

9 years agoCache the lookup of TargetLowering in the atomic expand pass.
Eric Christopher [Mon, 26 Jan 2015 19:45:40 +0000 (19:45 +0000)]
Cache the lookup of TargetLowering in the atomic expand pass.

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