Commit Graph

188704 Commits

Author SHA1 Message Date
Matthias Braun 42fab34ffb LiveRangeCalc: use more range based for loops; NFC
llvm-svn: 224263
2014-12-15 19:40:46 +00:00
Adrian Prantl 98f1f27810 Update this testcase for the new metadata assembler syntax.
llvm-svn: 224262
2014-12-15 19:25:33 +00:00
Colin LeMahieu fe4012a969 [Hexagon] Adding encoding bits for halfword multiplies.
llvm-svn: 224261
2014-12-15 19:22:07 +00:00
Ahmed Bougacha c2a87ddf01 [X86] Also pretty-print shuffle mask for INSERTPS rm variants.
llvm-svn: 224260
2014-12-15 19:17:54 +00:00
Duncan P. N. Exon Smith b3a66691f8 IR: Make metadata typeless in assembly, clang side
Match LLVM changes from r224257.

llvm-svn: 224259
2014-12-15 19:10:08 +00:00
Hafiz Abid Qadeer fcbc3cdf3c Replace ioctl with select to reduce processor usage by lldb-mi on OSX.
This saga started with a hang on OSX. 2 solutions were proposed.
1) 'select' based solution works ok on OSX but slows down test completion time
on Linux many times.
2) 'ioctl' base solution also works but it causes heavy processor usage on OSX
as reported by Ilia K.

But as the original hang did not occur on Linux so this commit re-introduces the
'select' in conditional code so that it only runs for OSX. There is no need for
this 'fix' to run on Linux.

Initial patch by Ilia K <ki.stfu@gmail.com>. A few changes were made by me. 

llvm-svn: 224258
2014-12-15 19:09:40 +00:00
Duncan P. N. Exon Smith be7ea19b58 IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly.  These
are the matching assembly changes for the metadata/value split in
r223802.

  - Only use the `metadata` type when referencing metadata from a call
    intrinsic -- i.e., only when it's used as a `Value`.

  - Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
    when referencing it from call intrinsics.

So, assembly like this:

    define @foo(i32 %v) {
      call void @llvm.foo(metadata !{i32 %v}, metadata !0)
      call void @llvm.foo(metadata !{i32 7}, metadata !0)
      call void @llvm.foo(metadata !1, metadata !0)
      call void @llvm.foo(metadata !3, metadata !0)
      call void @llvm.foo(metadata !{metadata !3}, metadata !0)
      ret void, !bar !2
    }
    !0 = metadata !{metadata !2}
    !1 = metadata !{i32* @global}
    !2 = metadata !{metadata !3}
    !3 = metadata !{}

turns into this:

    define @foo(i32 %v) {
      call void @llvm.foo(metadata i32 %v, metadata !0)
      call void @llvm.foo(metadata i32 7, metadata !0)
      call void @llvm.foo(metadata i32* @global, metadata !0)
      call void @llvm.foo(metadata !3, metadata !0)
      call void @llvm.foo(metadata !{!3}, metadata !0)
      ret void, !bar !2
    }
    !0 = !{!2}
    !1 = !{i32* @global}
    !2 = !{!3}
    !3 = !{}

I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines).  I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.

This is part of PR21532.

llvm-svn: 224257
2014-12-15 19:07:53 +00:00
Paul Robinson 30e41fb4da Warn when attribute 'optnone' conflicts with attributes on a
different declaration of the same function.

llvm-svn: 224256
2014-12-15 18:57:28 +00:00
Michael Ilseman addddc441f Silence more static analyzer warnings.
Add in definedness checks for shift operators, null checks when
pointers are assumed by the code to be non-null, and explicit
unreachables.

llvm-svn: 224255
2014-12-15 18:48:43 +00:00
Reid Kleckner b736bf3899 Move mips1 tests to test/MC/Disassembler/Mips/mips1
This matches the pattern of the mips2 and 3 tests, as well as our normal
conventions.

llvm-svn: 224254
2014-12-15 17:56:02 +00:00
Vladimir Medic d7ecf49e97 Add disassembler tests for mips3 platform. There are no functional changes.
llvm-svn: 224253
2014-12-15 16:19:34 +00:00
Vladimir Medic 19703a0bd6 Add disassembler tests for mips2 platform. There are no functional changes.
llvm-svn: 224252
2014-12-15 15:58:20 +00:00
Vladimir Medic a67937331d This is the first in a series of patches that add missing disassembler tests for mips platform. The patches are divided per version of mips CPU to keep the patches smaller and ease the review. There are no functional changes, code is changed only if new tests reveal a bug.This patch adds disassembler tests for mips1 CPU.
llvm-svn: 224251
2014-12-15 15:22:33 +00:00
Samuel Benzaquen b405c08bdb Add voidType() matcher.
Summary: Add voidType() matcher.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 224250
2014-12-15 15:09:22 +00:00
Aaron Ballman 2d67fd6d64 Changing a cast from unsigned to uint64_t, should be NFC in practice.
llvm-svn: 224249
2014-12-15 14:25:12 +00:00
Elena Demikhovsky bf74736290 Added a test related to 224247 revision
llvm-svn: 224248
2014-12-15 14:14:10 +00:00
Elena Demikhovsky a5599bfd72 Sink store based on alias analysis
- by Ella Bolshinsky
The alias analysis is used define whether the given instruction
is a barrier for store sinking. For 2 identical stores, following
instructions are checked in the both basic blocks, to determine
whether they are sinking barriers.

http://reviews.llvm.org/D6420

llvm-svn: 224247
2014-12-15 14:09:53 +00:00
Michael Kuperstein 47c97157ef [X86] Break false dependencies before partial register updates when the source operand is in memory
Adds the various "rm" instruction variants into the list of instructions that have a partial register update. Also adds all variants of SQRTSD that were missing in the original list.

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

llvm-svn: 224246
2014-12-15 13:18:21 +00:00
Rui Ueyama 7da4037c81 Replace ReaderError with DynamicError.
ReaderErrorCategory was used only at one place. We now have a
DynamicErrorCategory for this kind of one-time error, so use it.
The calling function doesn't really care the type of an error, so
ReaderErrorCategory was actually dead code.

llvm-svn: 224245
2014-12-15 12:20:13 +00:00
Suyog Sarda 2b27fc78a2 Typo Correction in Test Case. NFC.
llvm-svn: 224244
2014-12-15 12:19:46 +00:00
Kumar Sukhani 3176f9b65d [ubsan][arm] supporting misaligned testcase
After previous commit: http://reviews.llvm.org/rL224242, misaligned testcase is now supported on ARM also

llvm-svn: 224243
2014-12-15 12:16:36 +00:00
Kumar Sukhani fef606cf0a [UBSan][MIPS] Adding support of MIPS64 in UBSan testing
On mips64 addresses are 40-bit. Where as a 48 bit address is used in TypeCheck/misaligned.cpp.
Using regular expression for that address.

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224242
2014-12-15 10:52:06 +00:00
Elena Demikhovsky 72860c341e AVX-512: Added EXPAND instructions and intrinsics.
llvm-svn: 224241
2014-12-15 10:03:52 +00:00
David Majnemer 7e21745e22 Sema: Don't diagnose string + int if the int is value dependent
Don't send a value dependent expression into the expression evaluator,
HandleSizeof would crash.  Making HandleSizeof handle dependent types
would noisily warn about the operation even if everything turns out OK
after instantiation.

This fixes PR21848.

llvm-svn: 224240
2014-12-15 10:00:35 +00:00
Kumar Sukhani 79c79e3e8a [UBSan][MIPS] Adding support for MIPS64
No MIPS64 architecture dependant code

reviewed by : samsonov
submitted by: sagar

llvm-svn: 224239
2014-12-15 09:20:06 +00:00
David Majnemer d616362fe3 Preprocessor: Recover instead of mutating a token in ExpandBuiltinMacro
We would CreateString on arbitrary garbage instead of just skipping to
the end of the builtin macro.  Eventually, this would cause us to crash
because we would end up replacing the contents of a character token with
a numeric literal.

This fixes PR21825.

llvm-svn: 224238
2014-12-15 09:03:58 +00:00
David Majnemer 418ad3ff10 Sema: Don't leave switch stack inconsistent when recovering
We would exit Sema::ActOnFinishSwitchStmt early if we didn't have a
body.  This would leave an extra SwitchStmt on the SwitchStack.

This fixes PR21841.

llvm-svn: 224237
2014-12-15 07:46:12 +00:00
Rui Ueyama c1eeb310d4 Remove dead code.
This field was not even initialized properly.

llvm-svn: 224236
2014-12-15 07:22:29 +00:00
Rui Ueyama 0a2c2dbfc2 Protect doParse() because that's not a public interface.
llvm-svn: 224235
2014-12-15 07:14:32 +00:00
Alexander Musman 51eb1308bd Test for 'omp for' (for r224233).
llvm-svn: 224234
2014-12-15 07:08:38 +00:00
Alexander Musman c638868bdf First patch with codegen of the 'omp for' directive. It implements
the simplest case, which is used when no chunk_size is specified in
the schedule(static) or no 'schedule' clause is specified - the
iteration space is divided by the library into chunks that are
approximately equal in size, and at most one chunk is distributed
to each thread. In this case, we do not need an outer loop in each
thread - each thread requests once which iterations range it should
handle (using __kmpc_for_static_init runtime call) and then runs the
inner loop on this range.

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

llvm-svn: 224233
2014-12-15 07:07:06 +00:00
David Majnemer ecabbc52d5 Parse: Don't reorder tokens using ConsumeToken
ConsumeToken doesn't work with special tokens.  Instead, just use PP.Lex
to eat the token.

This fixes PR21817.

llvm-svn: 224232
2014-12-15 07:00:05 +00:00
Alexey Bataev a47ae907e8 Fixed test/CodeGen/atomic_ops.c for compatibility with hexagon target
llvm-svn: 224231
2014-12-15 06:12:42 +00:00
Alexey Bataev 452d8e1133 Bugfix for Codegen of atomic load/store/other ops.
Currently clang fires assertions on x86-64 on any atomic operations for long double operands. Patch fixes codegen for such operations.
Differential Revision: http://reviews.llvm.org/D6499

llvm-svn: 224230
2014-12-15 05:25:25 +00:00
Alexey Bataev 48be28ef1a Fix line mapping information in LLVM JIT profiling with Vtune
The line mapping information for dynamic code is reported incorrectly. It causes VTune to map LLVM generated code to source lines incorrectly. This patch fix this issue.
Patch by Denis Pravdin.
Differential Revision: http://reviews.llvm.org/D6603

llvm-svn: 224229
2014-12-15 04:45:43 +00:00
Alexey Bataev 583b076223 MSVC: A wide string literal from L#macro_arg in a macro
Clang should form a wide string literal from L#macro_arg in a function-like macro in -fms-compatibility mode.
Fix for http://llvm.org/PR9984.
Differential Revision: http://reviews.llvm.org/D6604

llvm-svn: 224228
2014-12-15 04:18:11 +00:00
David Majnemer c175dd2ea5 ThreadLocal: Move Unix-specific code out of Support/ThreadLocal.cpp
Just a cleanup, no functionality change is intended.

llvm-svn: 224227
2014-12-15 01:19:53 +00:00
David Majnemer 393d8013f3 StringPool: Cleanup typos in unittest comments
No functional change intended.

llvm-svn: 224226
2014-12-15 01:04:49 +00:00
David Majnemer 421c89debc ThreadLocal: Return a mutable pointer if templated with a non-const type
It makes more sense for ThreadLocal<const T>::get to return a const T*
and ThreadLocal<T>::get to return a T*.

llvm-svn: 224225
2014-12-15 01:04:45 +00:00
Craig Topper 574f6d4608 Use unique_ptr to remove explicit delete.
llvm-svn: 224224
2014-12-15 00:40:07 +00:00
Alexander Kornienko 732b6bd4d1 Don't break single-line raw string literals.
Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 224223
2014-12-14 20:47:11 +00:00
David Blaikie c4fbfee4ff Update test case with more accurate column information now that Clang produces same
llvm-svn: 224222
2014-12-14 18:49:31 +00:00
David Blaikie 09f12fa1ca DebugInfo: More accurate line information for placement new.
This actually came up as a break in UBSan tests (look for a follow-up
commit to this one to see the UBSan test fallout) when I tried a broader
fix to location information.

I have some other ideas about how to do that broader change & will keep
looking into it.

llvm-svn: 224221
2014-12-14 18:48:18 +00:00
David Majnemer 17e2633cd6 CodeGen: Compound literals with funny types shouldn't crash
CodeGen assumed that a compound literal with array type should have a
corresponding LLVM IR array type.

We had two bugs in this area:
- Zero sized arrays in compound literals would lead to the creation of
  an opaque type.  This is unnecessary, we should just create an array
  type with a bound of zero.
- Funny record types (like unions) lead to exotic IR types for compound
  literals.  In this case, CodeGen must be prepared to deal with the
  possibility that it might not have an array IR type.

This fixes PR21912.

llvm-svn: 224219
2014-12-14 12:16:43 +00:00
Elena Demikhovsky 3fcafa2cdb Loop Vectorizer minor changes in the code -
some comments, function names, identation.

Reviewed here: http://reviews.llvm.org/D6527

llvm-svn: 224218
2014-12-14 09:43:50 +00:00
David Majnemer 7f03920dad APInt: udivrem should use machine instructions for single-word APInts
This mirrors the behavior of APInt::udiv and APInt::urem.  Some
architectures, like X86, have a single instruction which can compute
both division and remainder.

llvm-svn: 224217
2014-12-14 09:41:56 +00:00
David Majnemer 4e87936d2f ScalarEvolution: Remove SCEVUDivision, it's unused
This is just a code simplification, no functionality change is intended.

llvm-svn: 224216
2014-12-14 09:12:33 +00:00
David Majnemer 8c92b87cd0 AST: Limit zero-sized constexpr behavior to array types
Restricting this "extension" to array types maximizes our standards
conformance while not miscompiling real-world programs.

llvm-svn: 224215
2014-12-14 08:40:47 +00:00
Rui Ueyama 0b23c37413 Clean up #include dependency.
Core/File.h does not use LinkingContext.h, so remove that dependency.

llvm-svn: 224214
2014-12-14 07:57:35 +00:00
Hal Finkel 4104a1a346 [PowerPC] Handle cmp op promotion for SELECT[_CC] nodes in PPCTL::DAGCombineExtBoolTrunc
PPCTargetLowering::DAGCombineExtBoolTrunc contains logic to remove unwanted
truncations and extensions when dealing with nodes of the form:
  zext(binary-ops(binary-ops(trunc(x), trunc(y)), ...)

There was a FIXME in the implementation (now removed) regarding the fact that
the function would abort the transformations if any of the non-output operands
of a SELECT or SELECT_CC node would need to be promoted (because they were
also output operands, for example). As a result, we continued to generate
unnecessary zero-extends for code such as this:

  unsigned foo(unsigned a, unsigned b) {
    return  (a <= b) ? a : b;
  }

which would produce:

  cmplw 0, 3, 4
  isel 3, 4, 3, 1
  rldicl 3, 3, 0, 32
  blr

and now we produce:

  cmplw 0, 3, 4
  isel 3, 4, 3, 1
  blr

which is better in the obvious way.

llvm-svn: 224213
2014-12-14 05:53:19 +00:00