Commit Graph

18352 Commits

Author SHA1 Message Date
Richard Sandiford
4fc7355a21 [SystemZ] Use MVST to implement strcpy and stpcpy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188546 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 11:29:37 +00:00
Richard Sandiford
e1b2af731e [SystemZ] Use CLST to implement strcmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 11:21:54 +00:00
Aaron Ballman
4e31acb558 Calling the base class constructor from the derived class' initializer list. This matches DenseMap's behavior, and silences some warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188528 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 02:56:43 +00:00
Aaron Ballman
d5f33aa33f Tighten up the yamilizer so it stops eliding empty sequences if the embedded empty sequence is the first key/value in a map which is itself in a sequence.
Patch with help from Nick Kledzik.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188508 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 23:17:53 +00:00
Bill Wendling
873e392ffd Make a few more things const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188484 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 20:25:44 +00:00
Joey Gouly
a370bdb42e Drive-by fix for a doxygen comment in MachineInstr.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188467 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 16:02:44 +00:00
Jack Carter
bd71eea899 [Mips][msa] Added the simple builtins (madd_q to xori)
Includes:
madd_q, maddr_q, maddv, max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su],
msub_q, msubr_q, msubv, mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev,
pckod, pcnt, sat_[su], shf, sld, sldi, sll, slli, splat, splati, sr[al],
sr[al]i, subs_[su], subss_u, subus_s, subv, subvi, vshf, xori

Patch by Daniel Sanders


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188460 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 14:22:07 +00:00
Jack Carter
d0f99639c1 [Mips][msa] Added the simple builtins (fadd to ftq)
Includes:
fadd, fceq, fcg[et], fclass, fcl[et], fcne, fcun, fdiv, fexdo, fexp2,
fexup[lr], ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, frcp, frsqrt, fseq, fsge, fsgt, fsle, fslt,
fsne, fsqr, fsub, ftint_s, ftq

Patch by Daniel Sanders


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188458 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 13:45:36 +00:00
Jack Carter
e2a9376b1b [Mips][msa] Added the simple builtins (add_a to dpsub[su], ilvev to ldi)
Includes:
add_a, adds_[asu], addv, addvi, andi.b, asub_[su].[bhwd], aver?_[su]_[bhwd],
bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bseli, bset, bseti,
c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw], div_[su],
dotp_[su], dpadd_[su], dpsub_[su], ilvev, ilvl, ilvod, ilvr, insv, insve,
ldi

Patch by Daniel Sanders


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188457 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-15 12:24:57 +00:00
Mark Lacey
e742d68736 Auto-compute live intervals on demand.
When new virtual registers are created during splitting/spilling, defer
creation of the live interval until we need to use the live interval.

Along with the recent commits to notify LiveRangeEdit when new virtual
registers are created, this makes it possible for functions like
TargetInstrInfo::loadRegFromStackSlot() and
TargetInstrInfo::storeRegToStackSlot() to create multiple virtual
registers as part of the process of generating loads/stores for
different register classes, and then have the live intervals for those
new registers computed when they are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188437 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 23:50:16 +00:00
Mark Lacey
3bbd96e90b Add the MachineInstrSpan class.
MachineInstrSpan is initialized with a MachineBasicBlock::iterator,
and is intended to track which instructions are inserted before/after
that instruction from the time the MachineInstrSpan is created.

It provides a begin()/end() interface to walk the range of
instructions inserted around the initial instruction (including that
initial instruction).

It also provides a getInitial() interface to return the initial
iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188436 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 23:50:11 +00:00
Mark Lacey
03fe68e0a9 Notify LiveRangeEdit of new virtual registers.
Add a delegate class to MachineRegisterInfo with a single virtual
function, MRI_NoteNewVirtualRegister(). Update LiveRangeEdit to inherit
from this delegate class and override the definition of the callback
with an implementation that tracks the newly created virtual registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 23:50:09 +00:00
Mark Lacey
1feb5854ae Track new virtual registers by register number.
Track new virtual registers by register number, rather than by the live
interval created for them. This is the first step in separating the
creation of new virtual registers and new live intervals.  Eventually
live intervals will be created and populated on demand after the virtual
registers have been created and used in instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188434 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 23:50:04 +00:00
Peter Collingbourne
fdb1a6c341 DataFlowSanitizer: greylist is now ABI list.
This replaces the old incomplete greylist functionality with an ABI
list, which can provide more detailed information about the ABI and
semantics of specific functions.  The pass treats every function in
the "uninstrumented" category in the ABI list file as conforming to
the "native" (i.e. unsanitized) ABI.  Unless the ABI list contains
additional categories for those functions, a call to one of those
functions will produce a warning message, as the labelling behaviour
of the function is unknown.  The other supported categories are
"functional", "discard" and "custom".

- "discard" -- This function does not write to (user-accessible) memory,
  and its return value is unlabelled.
- "functional" -- This function does not write to (user-accessible)
  memory, and the label of its return value is the union of the label of
  its arguments.
- "custom" -- Instead of calling the function, a custom wrapper __dfsw_F
  is called, where F is the name of the function.  This function may wrap
  the original function or provide its own implementation.

Differential Revision: http://llvm-reviews.chandlerc.com/D1345

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188402 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 18:54:12 +00:00
Jakob Stoklund Olesen
1c6d387dc9 Remove unnecessary parameter to RenumberValues.
Patch by Matthias Braun!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188393 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 17:28:52 +00:00
Jakob Stoklund Olesen
906968c533 Remove unused function.
Patch by Matthias Braun!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188392 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 17:28:49 +00:00
Jakob Stoklund Olesen
292e417c1b Remove unused struct/enum
Patch by Matthias Braun!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188388 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 17:28:39 +00:00
Alexey Samsonov
ef7aefc53b Expose CRC-32 implementation from zlib
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188380 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 16:03:29 +00:00
Tim Northover
337439d12d Support C99 hexadecimal floating-point literals in assembly
It's useful to be able to write down floating-point numbers without having to
worry about what they'll be rounded to (as C99 discovered), this extends that
ability to the MC assembly parsers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188370 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 14:23:31 +00:00
Nick Lewycky
6c1fa7caae Revert r187191, which broke opt -mem2reg on the testcases included in PR16867.
However, opt -O2 doesn't run mem2reg directly so nobody noticed until r188146
when SROA started sending more things directly down the PromoteMemToReg path.

In order to revert r187191, I also revert dependent revisions r187296, r187322
and r188146. Fixes PR16867. Does not add the testcases from that PR, but both
of them should get added for both mem2reg and sroa when this revert gets
unreverted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188327 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 22:51:58 +00:00
Jack Carter
0fe3792a2f [Mips][msa] Value types for MSA support.
Added v8f16 to ValueTypes.h, ValueTypes.cpp, ValueTypes.td, 
and CodeGenTarget.cpp

Patch by Daniel Sanders


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188326 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 22:34:26 +00:00
Hans Wennborg
af9e355755 Options: Add new option kind that consumes remaining arguments
This adds KIND_REMAINING_ARGS, a class of options that consume
all remaining arguments on the command line.

This will be used to support /link in clang-cl, which is used
to forward all remaining arguments to the linker.

It also allows us to remove the hard-coded handling of "--",
allowing clients (clang and lld) to implement that functionality
themselves with this new option class.

Differential Revision: http://llvm-reviews.chandlerc.com/D1387

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188314 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 21:09:50 +00:00
Michael Gottesman
3add0679d2 Update makeLibCall to return both the call and the chain associated with the libcall instead of just the call. This allows us to specify libcalls that return void.
LowerCallTo returns a pair with the return value of the call as the first
element and the chain associated with the return value as the second element. If
we lower a call that has a void return value, LowerCallTo returns an SDValue
with a NULL SDNode and the chain for the call. Thus makeLibCall by just
returning the first value makes it impossible for you to set up the chain so
that the call is not eliminated as dead code.

I also updated all references to makeLibCall to reflect the new return type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188300 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 17:54:56 +00:00
Carlo Kok
e05a304e5a For COFF only: dwarf debug info output a label reference as a section relative item only when it's one of dw_from strp, sec_offset, ref_addr or op_call_ref instead of going by size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188296 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 17:45:53 +00:00
Nick Lewycky
72dba254ae Fix an oversight in isPotentiallyReachable where we wouldn't do any CFG-walking
to find loops if the From and To instructions were in the same block.

Refactor the code a little now that we need to fill to start the CFG-walking
algorithm with more than one starting basic block sometimes.

Special thanks to Andrew Trick for catching an error in my understanding of
natural loops in code review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188236 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 00:03:47 +00:00
Michael J. Spencer
d3d5e6d8eb [Object/ELF] sh_type is not a bitfield. Fixes RuntimeDyld test failure on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188220 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 22:59:14 +00:00
Michael Gottesman
93a013c760 Add editor C++ filetype declaration no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 21:10:23 +00:00
Michael Gottesman
15b2782ccf [stackprotector] Add in the stackprotector libcall.
We support this libcall on all platforms except for OpenBSD (See
lib/Codegen/StackProtector.cpp).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188193 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 18:45:38 +00:00
Michael Gottesman
2a64a639e5 [stackprotector] Added intrinsic llvm.stackprotectorcheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188191 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 18:35:32 +00:00
Alexey Samsonov
655abf57ed Remove unused SpecialCaseList constructors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188171 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 11:50:44 +00:00
Alexey Samsonov
e39e1316f0 Add SpecialCaseList::createOrDie() factory and use it in sanitizer passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188169 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 11:46:09 +00:00
Chandler Carruth
3729d7d62b Remove all checking for the various terminfo headers (term.h and
curses.h). Finding these headers is next to impossible. For example, on
Debian systems libtinfo-dev provides the terminfo reading library we
want, but *not* term.h. For the header, you have to use libncurses-dev.
And libncursesw-dev provides a *different* term.h in a different
location!

These headers aren't worth it. We want two functions the signatures of
which are clearly spec'ed in sys-v and other documentation. Just declare
them ourselves and call them. This should fix some debian builders and
provide better support for "minimal" debian systems that do want color
autodetection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188165 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 10:40:11 +00:00
Richard Sandiford
ac168b8bc8 [SystemZ] Use CLC and IPM to implement memcmp
For now this is restricted to fixed-length comparisons with a length
in the range [1, 256], as for memcpy() and MVC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188163 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 10:28:10 +00:00
Chandler Carruth
8d8bdff6d7 Target a minimal terminfo library rather than necessarily a full curses
library for color support detection. This still will use a curses
library if that is all we have available on the system. This change
tries to use a smaller subset of the curses library, specifically the
subset that is on some systems split off into a separate library. For
example, if you install ncurses configured --with-tinfo, a 'libtinfo' is
install that provides just the terminfo querying functionality. That
library is now used instead of curses when it is available.

This happens to fix a build error on systems with that library because
when we tried to link ncurses into the binary, we didn't pull tinfo in
as well. =]

It should also provide an easy path for supporting the NetBSD
libterminfo library, but as I don't have access to a NetBSD system I'm
leaving adding that support to those folks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188160 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 09:49:17 +00:00
Alexey Samsonov
d976d43f23 Introduce factory methods for SpecialCaseList
Summary:
Doing work in constructors is bad: this change suggests to
call SpecialCaseList::create(Path, Error) instead of
"new SpecialCaseList(Path)". Currently the latter may crash with
report_fatal_error, which is undesirable - sometimes we want to report
the error to user gracefully - for example, if he provides an incorrect
file as an argument of Clang's -fsanitize-blacklist flag.

Reviewers: pcc

Reviewed By: pcc

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1327

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188156 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 07:49:36 +00:00
Benjamin Kramer
fc6434a73d Add a overload to CostTable which allows it to infer the size of the table.
Use it to avoid repeating ourselves too often. Also store MVT::SimpleValueType
in the TTI tables so they can be statically initialized, MVT's constructors
create bloated initialization code otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188095 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 19:33:32 +00:00
David Blaikie
8328b6932f DebugInfo: provide the ability to add members to a class after it has been constructed
This is necessary to allow Clang to only emit implicit members when
there is code generated for them, rather than whenever they are ODR
used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188082 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 17:17:12 +00:00
Benjamin Kramer
5752b08aef Make directory iterator sentinels free.
This trades some complexity in operator== for not introducing static objects
into any functions using recursive directory iterators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188081 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 17:03:39 +00:00
Hans Wennborg
6c2dc9e66e ELFObjectFile.h: Silence warning on Windows
The compiler was warning about using | on a uintptr_t and bool:

  Object/ELFObjectFile.h(131) : warning C4805: '|' : unsafe
  mix of type 'uintptr_t' and type 'bool' in operation

I think the warning might be useful in other cases, so I added
a cast instead of disabling it altogether.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188079 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 16:48:21 +00:00
Alexey Samsonov
1b8ac53982 Try to unbreak Windows build after r188022
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188057 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 07:34:06 +00:00
Saleem Abdulrasool
1c9cd021c8 [CodeGen] prevent abnormal on invalid attributes
Currently, when an invalid attribute is encountered on processing a .s file,
clang will abort due to llvm_unreachable.  Invalid user input should not cause
an abnormal termination of the compiler.  Change the interface to return a
boolean to indicate the failure as a first step towards improving hanlding of
malformed user input to clang.

Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188047 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 01:52:03 +00:00
Michael J. Spencer
68554401fc llvm isn't C++11 yet :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188023 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 22:50:40 +00:00
Michael J. Spencer
081a1941b5 [Object] Split the ELF interface into 3 parts.
* ELFTypes.h contains template magic for defining types based on endianess, size, and alignment.
* ELFFile.h defines the ELFFile class which provides low level ELF specific access.
* ELFObjectFile.h contains ELFObjectFile which uses ELFFile to implement the ObjectFile interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188022 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 22:27:13 +00:00
David Fang
d4f9d05fde initial draft of PPCMachObjectWriter.cpp
this records relocation entries in the mach-o object file
for PIC code generation.
tested on powerpc-darwin8, validated against darwin otool -rvV

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188004 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 20:14:40 +00:00
Eric Christopher
3166762610 Be more rigorous about the sizes of forms and attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187953 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 01:41:00 +00:00
Ted Kremenek
bf473e2240 Forward resetColor() et al to the underlying stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187947 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 00:43:30 +00:00
Peter Collingbourne
c348ad00e5 Really unbreak Mac build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187938 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 23:41:13 +00:00
Peter Collingbourne
32647ca140 Unbreak Mac build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187937 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 23:29:46 +00:00
Hal Finkel
41418d17cc Add ISD::FROUND for libm round()
All libm floating-point rounding functions, except for round(), had their own
ISD nodes. Recent PowerPC cores have an instruction for round(), and so here I'm
adding ISD::FROUND so that round() can be custom lowered as well.

For the most part, this is straightforward. I've added an intrinsic
and a matching ISD node just like those for nearbyint() and friends. The
SelectionDAG pattern I've named frnd (because ISD::FP_ROUND has already claimed
fround).

This will be used by the PowerPC backend in a follow-up commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187926 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 22:49:12 +00:00
Peter Collingbourne
6fa33f5dd9 DataFlowSanitizer; LLVM changes.
DataFlowSanitizer is a generalised dynamic data flow analysis.

Unlike other Sanitizer tools, this tool is not designed to detect a
specific class of bugs on its own.  Instead, it provides a generic
dynamic data flow analysis framework to be used by clients to help
detect application-specific issues within their own code.

Differential Revision: http://llvm-reviews.chandlerc.com/D965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187923 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 22:47:18 +00:00