Commit Graph

90097 Commits

Author SHA1 Message Date
Michael Liao 53e7ef35b5 Minor coding style fix
llvm-svn: 176334
2013-03-01 04:19:34 +00:00
Akira Hatanaka e9e588dd72 [mips] Remove unused option. Fix 80-column violations.
llvm-svn: 176330
2013-03-01 02:17:02 +00:00
Akira Hatanaka 8f7bfb39be [mips] Add the capability to search delay slot filling instructions in
successor basic blocks.

Currently this is off by default.

llvm-svn: 176329
2013-03-01 02:03:51 +00:00
Akira Hatanaka 28dc83ceb3 [mips] Do not add SecondLastInst to list BranchInstrs if there is only one
terminator.

No functionality change.

llvm-svn: 176326
2013-03-01 01:22:26 +00:00
Akira Hatanaka 7320b2364d [mips] Define an overloaded version of function MipsInstrInfo::AnalyzeBranchAdd.
This function will be used later when the capability to search delay slot
filling instructions in successor blocks is added. No intended functionality
changes.

llvm-svn: 176325
2013-03-01 01:10:17 +00:00
Akira Hatanaka e44e30ca5a [mips] Add options to disable searching backward and in successor blocks.
llvm-svn: 176321
2013-03-01 01:02:36 +00:00
Akira Hatanaka e01ff9dc60 [mips] Add capability to search in the forward direction for instructions that
can fill the delay slot.

Currently, this is off by default.

llvm-svn: 176320
2013-03-01 00:50:52 +00:00
Akira Hatanaka f815db5bcb [mips] Define helper function searchRange
No functionality change.

llvm-svn: 176318
2013-03-01 00:26:14 +00:00
Akira Hatanaka 50e174d95d [mips] Rename function findDelayInstr to searchBackward.
llvm-svn: 176317
2013-03-01 00:20:16 +00:00
Andrew Trick f9669beacd Scheduler diagnostics. Print the register name.
llvm-svn: 176316
2013-03-01 00:19:14 +00:00
Andrew Trick 8e897ca393 Fix incorrect ScheduleDAG comment and formalize Weak edges.
llvm-svn: 176315
2013-03-01 00:19:12 +00:00
Andrew Trick 2a8edef70b Instructions schedulers should report correct height/depth.
We avoided computing DAG height/depth during Node printing because it
shouldn't depend on an otherwise valid DAG. But this has become far
too annoying for the common case of a valid DAG where we want to see
valid values. If doing the computation on-the-fly turns out to be a
problem in practice, then I'll add a mode to the diagnostics to only
force it when we're likely to have a valid DAG, otherwise explicitly
print INVALID instead of bogus numbers. For now, just go for it all
the time.

llvm-svn: 176314
2013-03-01 00:19:09 +00:00
Akira Hatanaka eb33ced08f [mips] Define class MemDefsUses.
This class tracks dependence between memory instructions using underlying
objects of memory operands. 

llvm-svn: 176313
2013-03-01 00:16:31 +00:00
Daniel Malea 6e9b040649 Connect LLVM CMake build scripts to LLDB's CMake scripts:
- if you have LLDB checked out in $llvm/tools, CMake will build it now!
- LLDB is known to build on Linux with libstdc++ and GCC 4.6/4.7 or Clang 3.3
- to run lldb tests, do "make check-lldb" after a build

llvm-svn: 176307
2013-02-28 23:15:15 +00:00
Eli Bendersky 33ebf836bc A small refactoring + adding comments.
SelectionDAGIsel::LowerArguments needs a function, not a basic block. So it
makes sense to pass it the function instead of extracting a basic-block from
the function and then tossing it. This is also more self-documenting (functions
have arguments, BBs don't).

In addition, added comments to a couple of Select* methods.

llvm-svn: 176305
2013-02-28 23:09:18 +00:00
Bill Wendling 8a0e0841f3 Don't add the 'Value' string if there isn't one.
This was causing the folding set to fail to fold attributes, because it was
being calculated in one spot without an empty values string but here with an
empty values string.

llvm-svn: 176301
2013-02-28 21:17:03 +00:00
Quentin Colombet e684a6d4aa Fix a bug in instcombine for fmul in fast math mode.
The instcombine recognized pattern looks like:
a = b * c
d = a +/- Cst
or
a = b * c
d = Cst +/- a

When creating the new operands for fadd or fsub instruction following the related fmul, the first operand was created with the second original operand (M0 was created with C1) and the second with the first (M1 with Opnd0).

The fix consists in creating the new operands with the appropriate original operand, i.e., M0 with Opnd0 and M1 with C1.

llvm-svn: 176300
2013-02-28 21:12:40 +00:00
Eric Christopher 0ac16d539c Move an assert earlier in a file and check that the result of
our bitwise compare is equal to the field we're looking for.

Noticed on inspection.

llvm-svn: 176296
2013-02-28 20:26:17 +00:00
Benjamin Kramer a87d5128dd Brag about function call vectorization in the docs.
llvm-svn: 176292
2013-02-28 19:33:46 +00:00
Bill Wendling 8c8f9871c3 Don't add an attribute that already exists and don't remove an attribute that doesn't exist.
llvm-svn: 176289
2013-02-28 19:17:40 +00:00
Chad Rosier 537ff50b5d Tidy up; no functional change.
llvm-svn: 176288
2013-02-28 19:16:42 +00:00
Benjamin Kramer f7cfac7a14 Cost model support for lowered math builtins.
We make the cost for calling libm functions extremely high as emitting the
calls is expensive and causes spills (on x86) so performance suffers. We still
vectorize important calls like ceilf and friends on SSE4.1. and fabs.

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

llvm-svn: 176287
2013-02-28 19:09:33 +00:00
Chad Rosier 11a9828745 Style; no functional change.
llvm-svn: 176285
2013-02-28 18:54:27 +00:00
Eli Bendersky d0c6e7b038 Put some per-instruction statistics of fast isel under NDEBUG, together with
other per-instruction statistics.

llvm-svn: 176273
2013-02-28 18:05:12 +00:00
Yiannis Tsiouris d4842e5ee9 Re-format comments (and check commit access)
llvm-svn: 176270
2013-02-28 16:59:10 +00:00
Tim Northover ce17020c97 AArch64: remove post-encoder method from FCMP (immediate) instructions.
The work done by the post-encoder (setting architecturally unused bits to 0 as
required) can be done by the existing operand that covers the "#0.0". This
removes at least one use of the discouraged PostEncoderMethod uses.

llvm-svn: 176261
2013-02-28 14:46:14 +00:00
Tim Northover c3c5c0971d AArch64: be more careful resorting to inefficient addressing for weak vars.
If an otherwise weak var is actually defined in this unit, it can't be
undefined at runtime so we can use normal global variable sequences (ADRP/ADD)
to access it.

llvm-svn: 176259
2013-02-28 14:36:31 +00:00
Tim Northover b9d4fd210b AArch64: don't drop GlobalAddress offset when handling extern_weak decls.
llvm-svn: 176258
2013-02-28 14:36:24 +00:00
Bill Wendling c7e0a04433 Add the -disable-opt option to LTO. This adds:
- Consistency with opt (which supports the same option with the same meaning and
  description).
- Debugging gold plugin-based linking without optimizations getting in the way.
- Debugging programs linked with the gold plugin while preserving the original
  debug info.
- Fine-grained control over LTO passes using the gold plugin in combination with
  opt (or clang/dragonegg).

Patch by Cristiano Giuffrida!

llvm-svn: 176257
2013-02-28 14:11:10 +00:00
Tim Northover 9fafdf6d5a AArch64: Use cbnz instead of cmp/b.ne pair for atomic operations.
llvm-svn: 176253
2013-02-28 13:52:07 +00:00
Evgeniy Stepanov 00062b4498 [msan] Implement sanitize_memory attribute.
Shadow checks are disabled and memory loads always produce fully initialized
values in functions that don't have a sanitize_memory attribute. Value and
argument shadow is propagated as usual.

This change also updates blacklist behaviour to match the above.

llvm-svn: 176247
2013-02-28 11:25:14 +00:00
Renato Golin 0d89178ba3 Corrections for XFAIL armv5 tests
Most of the tests that behave differently on llvm-arm-linux buildbot
did so becase the triple wasn't set correctly to armv5, so we can
revert most of the special behaviour added previously. Some tests
still need the special treatment, though.

llvm-svn: 176243
2013-02-28 10:05:10 +00:00
Evgeniy Stepanov 4c9300e630 Remove unused leftover declarations.
llvm-svn: 176240
2013-02-28 08:42:11 +00:00
Bill Wendling 0615dbe44c Enable syntax highlighting for reStructuredText files.
Patch by Journeyer J. Joh!

llvm-svn: 176235
2013-02-28 06:43:24 +00:00
Michael J. Spencer 12e3dfc58e [Support][ErrorOr] Add support for implicit conversion from error code/condition enums.
llvm-svn: 176228
2013-02-28 01:44:26 +00:00
Argyrios Kyrtzidis eed2dc5769 [PathV2] In llvm::sys::fs::unique_file, make sure it doesn't fall into an infinite loop by constantly trying
to create the parent path.

This can happen if the path is a relative filename and the current directory was removed.
Thanks to Daniel D. for the hint in fixing it.

llvm-svn: 176226
2013-02-28 00:38:19 +00:00
Shuxin Yang 1e55d8c663 Fix a problem in alias analysis. It is about the misinterpretation of "Object".
This problem is exposed by r171325 which is already reverted. It is rather
hard to fabricate a testing case without it.

r171325 should *NOT* be resurrected as it has a potential problem although 
this problem dosen't directly contribute to PR14988.

The bug is tracked by:
  - rdar://13063553, and
  - http://llvm.org/bugs/show_bug.cgi?id=14988

Thank Arnold for coming up a better solution to this problem. After
comparing this solution and my original proposal, I decided to ditch mine.

llvm-svn: 176225
2013-02-28 00:24:45 +00:00
Eric Christopher 5958b46053 Remove unnecessary check against isGlobalVariable. We check it
a few lines above.

llvm-svn: 176224
2013-02-27 23:49:50 +00:00
Eric Christopher 3f79b8c374 Rework comment slightly and fix a few typos.
llvm-svn: 176223
2013-02-27 23:49:47 +00:00
Eric Christopher 10d35e9065 Remove unnecessary cast to void.
llvm-svn: 176222
2013-02-27 23:49:45 +00:00
Manman Ren 584e4c0eda Debug Info: for static member variables, always put AT_MIPS_linkage_name to the
definition DIE (TAG_variable), and put AT_MIPS_linkage_name to TAG_member when
DarwinGDBCompat is true.

Darwin GDB needs AT_MIPS_linkage_name at both places to work.

Follow-up patch to r176143.
rdar://problem/13291234

llvm-svn: 176220
2013-02-27 23:21:02 +00:00
Nadav Rotem c29095fb50 Silence the unused variable warning.
llvm-svn: 176218
2013-02-27 22:52:54 +00:00
Nadav Rotem 00b75dd3c4 The FastISEL should be fast. But when we record statistics we use atomic operations to increment the counters.
This patch disables the counters on non-debug builds. This reduces the runtime of SelectionDAGISel::SelectCodeCommon by ~5%.

llvm-svn: 176214
2013-02-27 21:59:43 +00:00
David Blaikie 9aa8e0b30a Copy missing member in DataLayout copy ctor.
Test case is missing due to it not being reachable through the current tools
but out of tree code such as the sample at
http://llvm.org/docs/tutorial/LangImpl4.html

Patch by Peng Cheng <gm4cheng@gmail.com>

llvm-svn: 176213
2013-02-27 21:44:59 +00:00
Jim Grosbach 5f21587648 ARM: FMA is legal only if VFP4 is available.
rdar://13306723

llvm-svn: 176212
2013-02-27 21:31:12 +00:00
Chad Rosier d3e47ca423 Remove this instance of dl as it's defined in a previous scope.
llvm-svn: 176208
2013-02-27 20:34:14 +00:00
Michael Ilseman ba8446c80e Reverted: r176136 - Have a way for a target to opt-out of target-independent fast isel
llvm-svn: 176204
2013-02-27 19:54:00 +00:00
Sean Silva f8e58016f6 [docs] Discuss manpage output.
llvm-svn: 176199
2013-02-27 18:48:42 +00:00
Aaron Ballman a2b75bcb52 Switching -1ULL to UINT64_MAX to fix MSVC warnings. Patch thanks to Peng Cheng!
llvm-svn: 176197
2013-02-27 18:38:33 +00:00
Sean Silva 1b46534445 [docs] Provide pointer for building Sphinx docs.
llvm-svn: 176195
2013-02-27 18:33:21 +00:00
Aaron Ballman ce18e58f93 Suppressing MSVC warnings; patch thanks to Peng Cheng!
llvm-svn: 176193
2013-02-27 18:25:41 +00:00
Shankar Easwaran e0bdc946ab print TLS segment
llvm-svn: 176192
2013-02-27 17:57:17 +00:00
Tim Northover 29931ab21d ARM: permit full range of valid ADR immediates.
This fixes an issue where trying to assemlbe valid ADR instructions would cause
LLVM to hit a failed assertion.

Patch by Keith Walker.

llvm-svn: 176189
2013-02-27 16:43:09 +00:00
Benjamin Kramer dc145816fd LoopVectorize: Vectorize math builtin calls.
This properly asks TargetLibraryInfo if a call is available and if it is, it
can be translated into the corresponding LLVM builtin. We don't vectorize sqrt()
yet because I'm not sure about the semantics for negative numbers. The other
intrinsic should be exact equivalents to the libm functions.

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

llvm-svn: 176188
2013-02-27 15:24:19 +00:00
Nick Lewycky 5e5421a645 Forgot that this file needs to be C89 not C99 thanks to MSVC. No functionality
change!

llvm-svn: 176176
2013-02-27 08:28:35 +00:00
Nick Lewycky 6fd43e4071 In GCC 4.7, function names are now forbidden from .gcda files. Support this by
passing a null pointer to the function name in to GCDAProfiling, and add another
switch onto GCOVProfiling.

llvm-svn: 176173
2013-02-27 06:22:56 +00:00
Nick Lewycky 625f395663 Doh, fix behaviour change introduced in r176168 which is tested in clang,
not llvm.

llvm-svn: 176172
2013-02-27 06:21:30 +00:00
Nadav Rotem 08ab877cc7 Revert r176166 because it broke one of the lit tests.
llvm-svn: 176171
2013-02-27 05:56:20 +00:00
Nadav Rotem 464e807d41 For each function that we optimize we initialize a new list of lib functions. For each function name we malloc memory. This patch changes the Libcall map to use BumpPtrAllocator. Now we malloc only once. This speeds up instcombine by a few % on a large c++ program.
llvm-svn: 176170
2013-02-27 05:53:43 +00:00
Nick Lewycky 8e94d80aab IRBuilder has grown all sorts of useful utility functions. Make use of them to
clean up this code a tiny bit. No functionality change.

llvm-svn: 176168
2013-02-27 05:46:30 +00:00
Nadav Rotem 85e1211fbf std::string to StringRef.
llvm-svn: 176166
2013-02-27 05:23:56 +00:00
Reed Kotler 5bf8020d83 Fix cut/paste error in a comment.
llvm-svn: 176165
2013-02-27 04:20:14 +00:00
Reed Kotler bb3094aa1e Add the skeleton for the Mips constant island pass.
It will only be used for Mips 16 at this time.
 

llvm-svn: 176161
2013-02-27 03:33:58 +00:00
Meador Inge 9b47f6414b IR: Don't constant fold GEP bitcasts between different address spaces
PR15262 reported a bug where the following instruction:

  i8 getelementptr inbounds i8* bitcast ([4 x i8] addrspace(12)* @buf to i8*),
                                i32 2

was getting folded into:

  addrspace(12)* getelementptr inbounds ([4 x i8] addrspace(12)* @buf, i32 0,
                                        i32 2)

This caused instcombine to crash because the original instruction and
the folded instruction have different types.  The issue was fixed by
disallowing bitcasts between different address spaces to be folded away.

llvm-svn: 176156
2013-02-27 02:26:42 +00:00
Manman Ren 683f59b36c SelectionDAG: If llvm.donothing has a landingpad, we should clear
CurrentCallSite to avoid an assertion failure:
assert(MMI.getCurrentCallSite() == 0 && "Overlapping call sites!");

rdar://problem/13228754

llvm-svn: 176154
2013-02-27 02:11:57 +00:00
Manman Ren 5ae44d2b75 Debug Info: for static member variables, add AT_MIPS_linkage_name to the
definition DIE, to make old GDB happy.

We have a regression for old GDB when Clang uses DW_TAG_member to declare
static members inside a class, instead of DW_TAG_variable. This patch will fix
this regression.

rdar://problem/13291234

llvm-svn: 176143
2013-02-27 00:02:32 +00:00
Pedro Artigas e40467b589 Enhance integer division emulation support to handle types smaller than 32 bits,
enhancement done the trivial way; by extending inputs and truncating outputs 
which is addequate for targets with little or no support for integer arithmetic
on integer types less than 32 bits.

llvm-svn: 176139
2013-02-26 23:33:20 +00:00
Michael Ilseman 846c6f0a32 Have a way for a target to opt-out of target-independent fast isel
llvm-svn: 176136
2013-02-26 23:15:23 +00:00
Eli Bendersky 6f5d70efe9 Try to get rid of a -wunitialized warning: explicitly initialize the pointer
to NULL and use asserts to check in relevant places.

llvm-svn: 176134
2013-02-26 23:04:17 +00:00
Michael Ilseman a7b93c1e5f Constant fold vector bitcasts of halves similarly to how floats and doubles are folded. Test case included.
llvm-svn: 176131
2013-02-26 22:51:07 +00:00
Roman Divacky fd666e9e3c Add support for autodetection of ADM bdver2.
llvm-svn: 176130
2013-02-26 22:41:01 +00:00
Manman Ren fe494749e4 Revert r176120 as it caused a failure at static-member.cpp
llvm-svn: 176129
2013-02-26 22:35:53 +00:00
Michael J. Spencer 2bb7db9d01 [TableGen] Fix ICE on MSVC 2012 Release builds.
llvm-svn: 176125
2013-02-26 21:29:47 +00:00
Bill Schmidt 8ea7af8e44 Fix PR15332 (patch by Florian Zeitz).
There's no need to generate a stack frame for PPC32 SVR4 when there are
no local variables assigned to the stack, i.e., when no red zone is needed.
(PPC64 supports a red zone, but PPC32 does not.)

llvm-svn: 176124
2013-02-26 21:28:57 +00:00
Matt Arsenault bceea5dfea Fix auto_ptr is deprecated warnings
llvm-svn: 176123
2013-02-26 21:20:35 +00:00
Manman Ren 5222195831 Debug Info: for static member variables, move AT_MIPS_linkage_name from
TAG_member inside a class to the specification DIE.

Having AT_MIPS_linkage_name on TAG_member caused old gdb (GNU 6.3.50) to
error out. Also gcc 4.7 has AT_MIPS_linkage_name on the specification DIE.

rdar://problem/13291234

llvm-svn: 176120
2013-02-26 20:48:29 +00:00
Chad Rosier 31a9bbcd4a Add a test case for r176066.
llvm-svn: 176119
2013-02-26 20:22:30 +00:00
Jim Grosbach 94a2260a7f AsmParser: More generic support for integer type suffices.
For integer constants, allow 'L', 'UL' as well as 'ULL' and 'LL'. This provides
better support for shared headers between .s and .c files that define bunches
of constant values.

rdar://9321056

llvm-svn: 176118
2013-02-26 20:17:10 +00:00
Matt Arsenault 2d17bbee48 Fix typo
llvm-svn: 176117
2013-02-26 20:13:09 +00:00
Matt Arsenault c0550990c5 Another test commit. Remove trailing whitespace.
llvm-svn: 176113
2013-02-26 19:33:48 +00:00
Matt Arsenault 58f546cd15 Test commit. Remove trailing whitespace.
llvm-svn: 176111
2013-02-26 19:18:06 +00:00
Chad Rosier d2686ffa56 Remove a few unused arguments.
llvm-svn: 176109
2013-02-26 18:39:31 +00:00
Sean Silva cf6848f112 [docs] Use reST link instead of direct HTML link.
llvm-svn: 176108
2013-02-26 18:22:18 +00:00
Eli Bendersky 4e7f548efb Slight cosmetic fixes
llvm-svn: 176107
2013-02-26 18:05:31 +00:00
Christian Konig e500e445c5 R600/SI: Add promotion of e32 to e64 in operand folding
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176105
2013-02-26 17:52:47 +00:00
Christian Konig f741fbfb1b R600/SI: add VOP mapping functions
Make it possible to map between e32 and e64 encoding opcodes.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176104
2013-02-26 17:52:42 +00:00
Christian Konig 6612ac39c9 R600/SI: swap operands if it helps folding
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176103
2013-02-26 17:52:36 +00:00
Christian Konig 76edd4f2bc R600/SI: add some more instruction flags
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176102
2013-02-26 17:52:29 +00:00
Christian Konig f82901af2a R600/SI: add post ISel folding for SI v2
Include immediate folding and SGPR limit handling for VOP3 instructions.

v2: remove leftover hasExtraSrcRegAllocReq

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176101
2013-02-26 17:52:23 +00:00
Christian Konig d910b7d534 R600/SI: add folding helper
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176100
2013-02-26 17:52:16 +00:00
Christian Konig d303996918 R600/SI: fix VOP3b encoding v2
v2: document why we hardcode VCC for now.

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176099
2013-02-26 17:52:09 +00:00
Christian Konig 0f0a8fe2dd R600/SI: fix and cleanup SI register definition v2
Prevent producing real strange tablegen code by using
proper register sizes, alignments and hierarchy.

Also cleanup the unused definitions and add some comments.

v2: add SGPR 512 bit registers, stop registers from wrapping around,
    fix SGPR alignment

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176098
2013-02-26 17:52:03 +00:00
Christian Konig d76ed54b60 R600/SI: fix stupid typo
This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176097
2013-02-26 17:51:57 +00:00
Renato Golin 276ec45704 Adding ARM as supported architecture
llvm-svn: 176096
2013-02-26 17:23:13 +00:00
Renato Golin e7693537d8 Proper XFAILs for ARMv7 / v5
llvm-svn: 176095
2013-02-26 17:16:27 +00:00
Bill Schmidt 441907dc09 Fix PR15359.
The PowerPC TLS relocation types were not previously added to the
necessary list in MCELFStreamer::fixSymbolsInTLSFixups().  Now they are!

llvm-svn: 176094
2013-02-26 16:41:03 +00:00
Renato Golin 2c2fce0e00 GCC 4.6.3 O3 miscompiles on ARM
llvm-svn: 176090
2013-02-26 13:32:40 +00:00
Kostya Serebryany cf880b9443 Unify clang/llvm attributes for asan/tsan/msan (LLVM part)
These are two related changes (one in llvm, one in clang).
LLVM: 
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG: 
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176075
2013-02-26 06:58:09 +00:00
Michael Ilseman c33b6ac7c9 Use a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the pass-manager overhead from FPPassManager::runOnFunction() by about 10%.
llvm-svn: 176072
2013-02-26 01:31:59 +00:00
Akira Hatanaka 979899e5cc [mips] Use class RegDefsUses to track register defs and uses.
No functionality change.

llvm-svn: 176070
2013-02-26 01:30:05 +00:00
Chad Rosier 1b33e8d63e [fast-isel] Make sure the FastLowerArguments function checks to make sure the
arguments type is a simple type.
rdar://13290455

llvm-svn: 176066
2013-02-26 01:05:31 +00:00
Michael Liao 609a527286 Refine fix to PR10499, no functionality change
- Put expensive checking after simple one

llvm-svn: 176060
2013-02-25 23:16:36 +00:00
Michael Liao ab97668061 Fix PR10499
- Check whether SSE is available before lowering all 1s vector building with
  PCMPEQD, which is only available from SSE2

llvm-svn: 176058
2013-02-25 23:01:03 +00:00
Andrew Kaylor cf99fd5709 Provide workaround for PR 15130.
This changes the RecordingMemoryManager in lli to use mapped memory rather than malloc to allocate memory for sections and uses a 'near' MemoryBlock to keep the allocations together.  This works around a problem in MCJIT where relocations are applied to a generated image immediately oupon generation, which isn't appropriate for the remote case.

llvm-svn: 176057
2013-02-25 23:00:19 +00:00
Chad Rosier 0587597fb8 Fix wording.
llvm-svn: 176055
2013-02-25 22:20:00 +00:00
Chad Rosier 0adc042392 Remove extraneous attribute number.
llvm-svn: 176053
2013-02-25 22:06:05 +00:00
Chad Rosier a92ef4ba5b [fast-isel] Add X86FastIsel::FastLowerArguments to handle functions with 6 or
fewer scalar integer (i32 or i64) arguments. It completely eliminates the need
for SDISel for trivial functions.

Also, add the new llc -fast-isel-abort-args option, which is similar to
-fast-isel-abort option, but for formal argument lowering.

llvm-svn: 176052
2013-02-25 21:59:35 +00:00
Andrew Trick 7cf4361912 pre-RA-sched fix: only reevaluate physreg interferences when necessary.
Fixes rdar:13279013: scheduler was blowing up on select instructions.

llvm-svn: 176037
2013-02-25 19:11:48 +00:00
Chad Rosier 669bb3ee77 [ms-inline asm] Add support for the pushad/popad mnemonics.
rdar://13254235

llvm-svn: 176036
2013-02-25 19:06:27 +00:00
Renato Golin 8b90511e6b ARM build docs easier for copy&paste
llvm-svn: 176033
2013-02-25 18:25:58 +00:00
Matt Beaumont-Gay 0e760da5fc 'Hexadecimal' has two 'a's and only one 'i'.
llvm-svn: 176031
2013-02-25 18:11:18 +00:00
Bill Schmidt b454829981 Fix missing relocation for TLS addressing peephole optimization.
Report and fix due to Kai Nacke.  Testcase update by me.

llvm-svn: 176029
2013-02-25 16:44:35 +00:00
Chandler Carruth 121dbf8846 Fix spelling noticed by Duncan.
llvm-svn: 176023
2013-02-25 14:29:38 +00:00
Chandler Carruth 05920b1847 Fix the root cause of PR15348 by correctly handling alignment 0 on
memory intrinsics in the SDAG builder.

When alignment is zero, the lang ref says that *no* alignment
assumptions can be made. This is the exact opposite of the internal API
contracts of the DAG where alignment 0 indicates that the alignment can
be made to be anything desired.

There is another, more explicit alignment that is better suited for the
role of "no alignment at all": an alignment of 1. Map the intrinsic
alignment to this early so that we don't end up generating aligned DAGs.

It is really terrifying that we've never seen this before, but we
suddenly started generating a large number of alignment 0 memcpys due to
the new code to do memcpy-based copying of POD class members. That patch
contains a bug that rounds bitfield alignments down when they are the
first field. This can in turn produce zero alignments.

This fixes weird crashes I've seen in library users of LLVM on 32-bit
hosts, etc.

llvm-svn: 176022
2013-02-25 14:20:21 +00:00
Reed Kotler bd1058a877 Make pseudos FEXT_CCRX16_ins and FEXT_CCRXI16_ins into custom emitters.
llvm-svn: 176007
2013-02-25 02:25:47 +00:00
David Blaikie bbe0e1abe6 DIBuilder: support structs with vtable pointers in the same way as classes
llvm-svn: 176004
2013-02-25 01:07:18 +00:00
Reed Kotler 7a86b3dc2b Make psuedo FEXT_T8I816_ins into a custom emitter.
llvm-svn: 176002
2013-02-24 23:17:51 +00:00
Bill Schmidt c68c6df884 Fix PR14364.
This removes a const_cast hack from PPCRegisterInfo::hasReservedSpillSlot().
The proper place to save the frame index for the CR spill slot is in the
PPCFunctionInfo object, not the PPCRegisterInfo object.

No new test cases, as this just reimplements existing function.  Existing
tests such as test/CodeGen/PowerPC/crsave.ll are sufficient.

llvm-svn: 175998
2013-02-24 17:34:50 +00:00
Benjamin Kramer ee40b9a2d4 CVP: If we have a PHI with an incoming select, try to skip the select.
This is a common pattern with dyn_cast and similar constructs, when the
PHI no longer depends on the select it can often be turned into a simpler
construct or even get hoisted out of the loop.

PR15340.

llvm-svn: 175995
2013-02-24 15:34:43 +00:00
Benjamin Kramer b867fea5e6 Fix invalid IR in test, missing incoming value for PHI node.
llvm-svn: 175994
2013-02-24 15:34:29 +00:00
Francois Pichet d1cef3ecd3 Typo
llvm-svn: 175991
2013-02-24 12:34:13 +00:00
Nadav Rotem b532fca92c Revert r169638 because it broke Mesa llvmpipe tests.
Fix PR15239.

llvm-svn: 175985
2013-02-24 07:09:35 +00:00
Reed Kotler e2bead7a2d Make psuedo FEXT_T8I816_ins a custom inserter. It should be expanded
as early as possible; which means during instruction selection.

llvm-svn: 175984
2013-02-24 06:16:39 +00:00
Cameron Zwarich 1b4c64c23b Add a use of an otherwise unused variable to remove a warning in non-Asserts
builds.

llvm-svn: 175981
2013-02-24 01:26:05 +00:00
Cameron Zwarich 6868f386c7 TwoAddressInstructionPass::tryInstructionTransform() only potentially returns
true when shouldOnlyCommute is false, so we can remove code that checks
otherwise.

llvm-svn: 175980
2013-02-24 00:27:29 +00:00
Cameron Zwarich f05c0cbb20 TwoAddrInstructionPass::tryInstructionTransform() has a case where it calls
itself recursively with a new instruction that has not been finalized, in order
to determine whether to keep the instruction. On 'make check' and test-suite the
only cases where the recursive invocation made any transformations were simple
instruction commutations, so I am restricting the recursive invocation to do
only this.

The other cases wouldn't work correctly when updating LiveIntervals, since the
new instructions don't have slot indices and LiveIntervals hasn't yet been
updated. If the other transformations were actually triggering in any test case
it would be possible to support it with a lot of effort, but since they don't
it's not worth it.

llvm-svn: 175979
2013-02-24 00:27:26 +00:00
Reed Kotler 80070bd439 Add new base instruction def for cmpi, cmp, slt and sltu so that def/uses
proper. Fixed this already a few days ago for slti.

llvm-svn: 175975
2013-02-23 23:37:03 +00:00
Cameron Zwarich e6907bc0e6 TargetInstrInfo::commuteInstruction() doesn't actually return a new instruction
unless it was requested to with an optional parameter that defaults to false, so
we don't need to handle that case in TwoAddressInstructionPass.

llvm-svn: 175974
2013-02-23 23:13:28 +00:00
Renato Golin f2ea19ea2e Add global structure vectorization to docs
llvm-svn: 175965
2013-02-23 13:25:41 +00:00
Renato Golin 0890ace58a Some more tests for the global structure vectorizer
llvm-svn: 175964
2013-02-23 12:48:30 +00:00
Benjamin Kramer ee23dcb461 X86: Disable cmov-memory patterns on subtargets without cmov.
Fixes PR15115.

llvm-svn: 175962
2013-02-23 10:40:58 +00:00
Cameron Zwarich 63acc73f21 Make some fixes for LiveInterval repair with debug info. Debug value
MachineInstrs don't have a slot index.

llvm-svn: 175961
2013-02-23 10:25:25 +00:00
Cameron Zwarich 4e80d9e853 Fix a bug with the LiveIntervals updating in the two-address pass found by
running ASCI_Purple/SMG2000 in the test-suite.

llvm-svn: 175957
2013-02-23 04:49:22 +00:00
Cameron Zwarich 35c3050e7a Make TwoAddressInstructionPass::sink3AddrInstruction() LiveIntervals-aware.
llvm-svn: 175956
2013-02-23 04:49:20 +00:00
Cameron Zwarich 7d13fb4d5a Make rescheduleMIBelowKill() and rescheduleKillAboveMI() LiveIntervals-aware in
TwoAddressInstructionPass. The code in rescheduleMIBelowKill() is a bit tricky,
since multiple instructions need to be moved down, one-at-a-time, in reverse
order.

llvm-svn: 175955
2013-02-23 04:49:13 +00:00
Reed Kotler dacee2bb44 Expand pseudos/macros for Selt. This is the last of the complex
macros.The rest is some small misc. stuff.

llvm-svn: 175950
2013-02-23 03:09:56 +00:00
Jim Grosbach 9be2d71512 ARM: Convenience aliases for 'srs*' instructions.
Handle an implied 'sp' operand.

rdar://11466783

llvm-svn: 175940
2013-02-23 00:52:09 +00:00
Michael Gottesman f4b7761ed7 Fixed a careless mistake.
rdar://13273675.

llvm-svn: 175939
2013-02-23 00:31:32 +00:00
Eric Christopher dae389bb98 Use getSplitDebugFilename when constructing the skeleton cu and
update testcase accordingly to give the correct name to the cu.

llvm-svn: 175934
2013-02-22 23:50:08 +00:00
Eric Christopher 0dab36478a Add a field to the compile unit of where we plan on splitting out
the debug info for -gsplit-dwarf so we can encode that location
in the skeleton cu.

llvm-svn: 175933
2013-02-22 23:50:04 +00:00
Eric Christopher 8952471328 Add a TODO and explain when we can get rid of the isMain field.
llvm-svn: 175932
2013-02-22 23:50:01 +00:00
Eric Christopher a3da7a5879 Formatting.
llvm-svn: 175931
2013-02-22 23:49:58 +00:00
Nadav Rotem b7f90bd97b SelectionDAG compile time improvement.
One of the phases of SelectionDAG is LegalizeVectors. We don't need to sort the DAG and copy nodes around if there are no vector ops.

Speeds up the compilation time of SelectionDAG on a big scalar workload by ~8%.

llvm-svn: 175929
2013-02-22 23:33:30 +00:00
Akira Hatanaka 02b0e48f6a [mips] Emit call16 operator instead of got_disp. The former allows lazy binding.
llvm-svn: 175920
2013-02-22 21:10:03 +00:00
Peter Collingbourne e049fd2c31 Fix test by matching movaps instead of AVX-only vmovaps
llvm-svn: 175914
2013-02-22 19:53:30 +00:00
Peter Collingbourne 7b57621fb3 x86_64: designate most general purpose and SSE registers as callee save under coldcc
llvm-svn: 175911
2013-02-22 19:19:44 +00:00
Peter Collingbourne 399c95125c Revert "Test commit"
llvm-svn: 175910
2013-02-22 19:19:41 +00:00
Peter Collingbourne 634464fba5 Test commit
llvm-svn: 175909
2013-02-22 19:18:15 +00:00
Benjamin Kramer 3abc30a497 An Optional<T> is pod-like if the inner type is.
llvm-svn: 175908
2013-02-22 18:58:26 +00:00
Pete Cooper 23e8b6b8c9 Remove unused CHECK lines copied from another test
llvm-svn: 175905
2013-02-22 18:16:21 +00:00
Renato Golin adc1b07002 More tests to global struct vectorizer
llvm-svn: 175898
2013-02-22 16:18:31 +00:00
Pekka Jaaskelainen 119a2b6f31 Made it more explicit that the self-referential llvm.loop identifier metadata
should be unique for each loop.

llvm-svn: 175888
2013-02-22 12:03:07 +00:00
Michel Danzer 0cc991e17b R600/SI: Add pattern for sign extension of i1 to i32.
16 more little piglits with radeonsi.

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175887
2013-02-22 11:22:58 +00:00
Michel Danzer 00fb283560 R600/SI: Add pattern for logical or of i1 values.
24 more little piglits with radeonsi.

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175886
2013-02-22 11:22:54 +00:00
Michel Danzer c3ea4041b9 R600/SI: Add pattern for fceil.
9 more little piglits with radeonsi.

NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175885
2013-02-22 11:22:49 +00:00
Kristof Beyls 0ba797e8f7 Make ARMAsmPrinter generate the correct alignment specifier syntax in instructions.
The Printer will now print instructions with the correct alignment specifier syntax, like
    vld1.8  {d16}, [r0:64]

llvm-svn: 175884
2013-02-22 10:01:33 +00:00
Bill Wendling a032374ea0 Use references to attribute groups on the call/invoke instructions.
Listing all of the attributes for the callee of a call/invoke instruction is way
too much and makes the IR unreadable. Use references to attributes instead.

llvm-svn: 175877
2013-02-22 09:09:42 +00:00
Reed Kotler fbe4e863db Fix a nomenclature mistake. Slt->Slti in the functions. The "i" refers
to the immediate operand of sli or cmp function.

llvm-svn: 175865
2013-02-22 05:59:39 +00:00
Reed Kotler 4416cdadd5 Expand mips16 SelT form pseudso/macros.
llvm-svn: 175862
2013-02-22 05:10:51 +00:00
Pete Cooper 047f81a5df Fix isa<> check which could never be true.
It was incorrectly checking a Function* being an IntrinsicInst* which
isn't possible.  It should always have been checking the CallInst* instead.

Added test case for x86 which ensures we only get one constant load.
It was 2 before this change.

rdar://problem/13267920

llvm-svn: 175853
2013-02-22 01:50:38 +00:00
Andrew Trick 57ecf603c4 Remove code copied from GenRegisterInfo.inc.
There's no apparent reason this code was copied from generated source
into a .cpp. It sets a bad example for those working on other targets
and trying to understand the register info API.

llvm-svn: 175849
2013-02-22 01:15:08 +00:00
Eli Bendersky 8e352e30fd Code cleanup: pass Offset by pointer to parseInstruction to more explicitly
convey that it's a INOUT argument.
Also, if parsing of entry instructions fails, don't push the entry.

llvm-svn: 175847
2013-02-22 00:50:48 +00:00
Bill Wendling 25342e126f Remove warning about default covering no cases.
llvm-svn: 175846
2013-02-22 00:50:09 +00:00
Bill Wendling 7bfdfe7317 Add a bitmask for NoBuiltin. This should *not* be used.
llvm-svn: 175843
2013-02-22 00:40:12 +00:00
Bill Wendling 09bd1f71ee Implement the NoBuiltin attribute.
The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should
not treat the callee function as a built-in function. I.e., it shouldn't try to
replace that function with different code.

llvm-svn: 175835
2013-02-22 00:12:35 +00:00
Cameron Zwarich 384026b3d4 Stop relying on physical register kill flags in isKilled() in the two-address
pass. One of the callers of isKilled() can cope with overapproximation of kills
and the other can't, so I added a flag to indicate this.

In theory this could pessimize code slightly, but in practice most physical
register uses are kills, and most important kills of physical registers are the
only uses of that register prior to register allocation, so we can recognize
them as kills even without kill flags.

This is relevant because LiveIntervals gets rid of all kill flags.

llvm-svn: 175821
2013-02-21 22:58:42 +00:00
Eli Bendersky 705085da37 Previously, parsing capability of the .debug_frame section was added
to lib/DebugInfo, with dumping in llvm-dwarfdump. This patch adds
initial ability to parse and dump CFA instructions contained in
entries.

To keep it manageable, the patch omits some more advanced capabilities
(accounted in TODOs):

* Parsing of instructions with BLOCK arguments (expression lists)
* Dumping of actual instruction arguments (currently only names are
dumped). This is quite tricky since the dumper has to effectively
"interpret" the instructions.

llvm-svn: 175820
2013-02-21 22:53:19 +00:00
David Blaikie 65615996b9 Limit cast machinery to preserve const and not accept temporaries
After cleaning up the following type hierarchies:
  * TypeLoc: r175462
  * SVal: r175594
  * CFGElement: r175462
  * ProgramPoint: r175812
that all invoked undefined behavior by causing a derived copy construction of a
base object through an invalid cast (thus supporting code that relied on
casting temporaries that were direct base objects) Clang/LLVM is now clean of
casts of temporaries. So here's some fun SFINAE machinery (courtesy of Eli
Friedman, with some porting back from C++11 to LLVM's traits by me) to cause
compile-time failures if llvm::cast & friends are ever passed an rvalue.

This should avoid a repeat of anything even remotely like PR14321/r168124.

Thanks to Jordan Rose for the help with the various Static Analyzer related
hierarchies that needed cleaning up, Eli for the SFINAE, Richard Smith, John
McCall, Ted Kremenek, and Anna Zaks for their input/reviews/patience along the
way.

llvm-svn: 175819
2013-02-21 22:48:34 +00:00
Renato Golin cf928cb53f Allow GlobalValues to vectorize with AliasAnalysis
Storing the load/store instructions with the values
and inspect them using Alias Analysis to make sure
they don't alias, since the GEP pointer operand doesn't
take the offset into account.

Trying hard to not add any extra cost to loads and stores
that don't overlap on global values, AA is *only* calculated
if all of the previous attempts failed.

Using biggest vector register size as the stride for the
vectorization access, as we're being conservative and
the cost model (which calculates the real vectorization
factor) is only run after the legalization phase.

We might re-think this relationship in the future, but
for now, I'd rather be safe than sorry.

llvm-svn: 175818
2013-02-21 22:39:03 +00:00
Lang Hames 4309020200 Re-apply r175688, with the changes suggested by Jakob in PR15320.
llvm-svn: 175809
2013-02-21 22:16:43 +00:00
Chad Rosier 9b7f9c3e9e Remove dead code and whitespace.
llvm-svn: 175804
2013-02-21 21:40:51 +00:00
Pedro Artigas 699cf390ff Clear the whole table including the tombstones, since the tombstone count will
be set to zero that is what it was intended. Should improve performance of 
the data structure when clear is invoked frequently (both compile time and
memory usage).

llvm-svn: 175799
2013-02-21 21:32:00 +00:00
Eli Bendersky 8da87163ca Move the eliminateCallFramePseudoInstr method from TargetRegisterInfo
to TargetFrameLowering, where it belongs. Incidentally, this allows us
to delete some duplicated (and slightly different!) code in TRI.

There are potentially other layering problems that can be cleaned up
as a result, or in a similar manner.

The refactoring was OK'd by Anton Korobeynikov on llvmdev.

Note: this touches the target interfaces, so out-of-tree targets may
be affected.

llvm-svn: 175788
2013-02-21 20:05:00 +00:00
Bill Wendling efbbbfd384 Don't assert on empty attributes.
llvm-svn: 175785
2013-02-21 19:46:51 +00:00
Anshuman Dasgupta d062c70444 Hexagon: Expand cttz, ctlz, and ctpop for now.
llvm-svn: 175783
2013-02-21 19:39:40 +00:00
Jakob Stoklund Olesen 2ff4dc0ff2 Make RAFast::UsedInInstr indexed by register units.
This fixes some problems with too conservative checking where we were
marking all aliases of a register as used, and then also checking all
aliases when allocating a register.

<rdar://problem/13249625>

llvm-svn: 175782
2013-02-21 19:35:21 +00:00
Evan Cheng ab28b9ae73 Radar numbers don't belong in source code.
llvm-svn: 175775
2013-02-21 18:37:54 +00:00
Bill Schmidt 836c45badf Trivial cleanup
llvm-svn: 175771
2013-02-21 17:26:05 +00:00
Paul Redmond eaaed3b1fe add missing space which prevented the llvm.loop code-block from appearing in the
generated html.

llvm-svn: 175769
2013-02-21 17:20:45 +00:00
Bill Schmidt 27917785ae Large code model support for PowerPC.
Large code model is identical to medium code model except that the
addis/addi sequence for "local" accesses is never used.  All accesses
use the addis/ld sequence.

The coding changes are straightforward; most of the patch is taken up
with creating variants of the medium model tests for large model.

llvm-svn: 175767
2013-02-21 17:12:27 +00:00
Lang Hames 071890b554 Revert r175688 - It broke a test case (see PR15320).
llvm-svn: 175765
2013-02-21 17:01:59 +00:00
Eli Bendersky e93249befa getX86SubSuperRegister has a special mode with High=true for i64 which
exists solely to enable it to call itself for i8 with some registers.
The proposed patch simplifies the function somewhat to make the High
bit only meaningful for the i8 mode, which makes sense. No functional
difference (getX86SubSuperRegister is not getting called from anywhere
outside with i64 and High=true).

llvm-svn: 175762
2013-02-21 16:40:18 +00:00
Benjamin Kramer 3238dc0c61 DAGCombiner: Make the post-legalize vector op optimization more aggressive.
A legal BUILD_VECTOR goes in and gets constant folded into another legal
BUILD_VECTOR so we don't lose any legality here. The problematic PPC
optimization that made this check necessary was fixed recently.

llvm-svn: 175759
2013-02-21 15:24:35 +00:00
Christian Konig 71088e68e8 R600/SI: inline V_ADD|SUB_F32 patterns
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175758
2013-02-21 15:17:41 +00:00
Christian Konig 7c9de8e6e8 R600/SI: replace IMPLICIT_DEF with SIOperand.ZERO
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175757
2013-02-21 15:17:36 +00:00
Christian Konig 2aca043312 R600/SI: replace SI_V_CNDLT with a pattern
It actually fixes quite a bunch of piglit tests.

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175756
2013-02-21 15:17:32 +00:00
Christian Konig 8dbe6f617c R600/SI: use patterns for clamp, fabs, fneg
Instead of using custom inserters, it's simpler and
should make DAG folding easier.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175755
2013-02-21 15:17:27 +00:00
Christian Konig bf114b42a8 R600/SI: add all the other missing asm operands v2
v2: put implicit parameters in []

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175754
2013-02-21 15:17:22 +00:00
Christian Konig 08e768b4cf R600/SI: add the missing M*BUF|IMG asm operands
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175753
2013-02-21 15:17:17 +00:00
Christian Konig e0130a2f25 R600/SI: add the missing S_* asm operands
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175752
2013-02-21 15:17:13 +00:00
Christian Konig f5754a011d R600/SI: rework VOP3 classes
Order the classes and add asm operands.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175751
2013-02-21 15:17:09 +00:00
Christian Konig b19849a682 R600/SI: simplify VOPC_* pattern v2
Fixing asm operation names.

v2: fix name of the e64 encoding, also add asm operands

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175750
2013-02-21 15:17:04 +00:00
Christian Konig ae034e63f1 R600/SI: rework VOP2_* pattern v2
Fixing asm operation names.

v2: use ZERO constant, also add asm operands

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175749
2013-02-21 15:16:58 +00:00
Christian Konig 3da7017e81 R600/SI: rework VOP1_* patterns v2
Fixing asm operation names.

v2: use ZERO constant, also add asm operands

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175748
2013-02-21 15:16:53 +00:00
Christian Konig eabf8333d6 R600/SI: add constant for inline zero operand
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175747
2013-02-21 15:16:49 +00:00
Christian Konig 72d5d5c754 R600/SI: cleanup SIInstrInfo.td and SIInstrFormat.td
Those two files got mixed up.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
llvm-svn: 175746
2013-02-21 15:16:44 +00:00
Tom Stellard 0d171c8877 R600: Fix for Unigine when MachineSched is enabled
Fixes for-loop.cl piglit test

Patch By: Vincent Lejeune

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

NOTE: This is a candidate for the Mesa stable branch.
llvm-svn: 175742
2013-02-21 15:06:59 +00:00
Bill Schmidt 49498dac9d Code review cleanup for r175697
llvm-svn: 175739
2013-02-21 14:35:42 +00:00
Michel Danzer 7f02a8c7a7 R600/SI: Make sure M0 is loaded for V_INTERP_MOV_F32
NOTE: This is a candidate for the Mesa stable branch.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 175733
2013-02-21 08:57:10 +00:00
Cameron Zwarich 3ab4c4ba30 Don't rely on the isDead() MachineOperand flag when updating LiveIntervals.
llvm-svn: 175732
2013-02-21 08:51:58 +00:00
Cameron Zwarich d113292bce Use getInterval() instead of getOrCreateInterval().
llvm-svn: 175731
2013-02-21 08:51:55 +00:00
David Blaikie db2c7412e4 Only include move-related Optional<T> tests when rvalue references are available.
llvm-svn: 175730
2013-02-21 07:58:45 +00:00
David Blaikie 1bcb538c3f Add move ctor/assignment to Optional<T>
Code review feedback for r175580 by Jordan Rose.

llvm-svn: 175729
2013-02-21 07:55:39 +00:00
Cameron Zwarich 9e722aed4a Make another kill check LiveIntervals-aware.
This brings the number of remaining failures in 'make check' without
LiveVariables down to 39, with 1 unexpectedly passing test.

llvm-svn: 175727
2013-02-21 07:02:30 +00:00
Cameron Zwarich c896478f0d Split part of isKilled() into a separate function for use elsewhere.
llvm-svn: 175726
2013-02-21 07:02:28 +00:00
David Blaikie 654aa755ae Correct spelling of 'enumerator'.
Post commit code review feedback to r175705 from Jordan Rose.

llvm-svn: 175724
2013-02-21 06:08:22 +00:00
David Blaikie 86d88f7168 Make Optional<T>'s operator bool 'explicit' in C++11
Provides a general way to add 'explicit' for conversion operators (a no-op when
compiling as C++98).

llvm-svn: 175723
2013-02-21 06:05:57 +00:00
Cameron Zwarich 94b204be54 Update isKilledAt in TwoAddressInstructionPass.cpp to use LiveIntervals when
available.

With this commit there are no longer any assertion or verifier failures when
running 'make check' without LiveVariables. There are still 56 failing tests
with codegen differences and 1 unexpectedly passing test.

llvm-svn: 175719
2013-02-21 04:33:02 +00:00
Reed Kotler 97ba5f2772 Expand the sel pseudo/macro. This generates basic blocks where previously
there were inline br .+4 instructions. Soon everything can enjoy the
full instruction scheduling experience.

llvm-svn: 175718
2013-02-21 04:22:38 +00:00
NAKAMURA Takumi 8c5d388850 ADT/Optional.h: Appease msvc. It reapplies r175626.
llvm-svn: 175710
2013-02-21 02:32:25 +00:00
Michael J. Spencer ed820958c8 [objdump] Add PT_PHDR.
llvm-svn: 175709
2013-02-21 02:21:29 +00:00
Jack Carter dc46338e2d Mips specific standalone assembler addressing mode %hi and %lo.
The constructs %hi() and %lo() represent the high and low 16 
bits of the address. 
Because the 16 bit offset field of an LW instruction is 
interpreted as signed, if bit 15 of the low part is 1 then the 
low part will act as a negative and 1 needs to be added to the 
high part.

Contributer: Vladimir Medic
llvm-svn: 175707
2013-02-21 02:09:31 +00:00
Bill Schmidt f5b474c6c6 PPCDAGToDAGISel::PostprocessISelDAG()
This patch implements the PPCDAGToDAGISel::PostprocessISelDAG virtual
method to perform post-selection peephole optimizations on the DAG
representation.

One optimization is implemented here:  folds to clean up complex
addressing expressions for thread-local storage and medium code
model.  It will also be useful for large code model sequences when
those are added later.  I originally thought about doing this on the
MI representation prior to register assignment, but it's difficult to
do effective global dead code elimination at that point.  DCE is
trivial on the DAG representation.

A typical example of a candidate code sequence in assembly:

   addis 3, 2, globalvar@toc@ha
   addi  3, 3, globalvar@toc@l
   lwz   5, 0(3)

When the final instruction is a load or store with an immediate offset
of zero, the offset from the add-immediate can replace the zero,
provided the relocation information is carried along:

   addis 3, 2, globalvar@toc@ha
   lwz   5, globalvar@toc@l(3)

Since the addi can in general have multiple uses, we need to only
delete the instruction when the last use is removed.

llvm-svn: 175697
2013-02-21 00:38:25 +00:00
David Blaikie ef04593de1 Provide a "None" value for convenience when using Optional<T>()
This implementation of NoneType/None does have some holes but I haven't
found one that doesn't - open to improvement.

llvm-svn: 175696
2013-02-21 00:27:28 +00:00
Bill Schmidt 3822ef2c0c Relocation enablement for PPC DAG postprocessing pass
llvm-svn: 175693
2013-02-21 00:05:29 +00:00
Chad Rosier c0955a57df Formatting.
llvm-svn: 175692
2013-02-20 23:57:30 +00:00
Jakob Stoklund Olesen 1744fd8018 Don't allocate memory in LiveInterval::join().
Rewrite value numbers directly in the 'Other' LiveInterval which is
moribund anyway. This avoids allocating the OtherAssignments vector.

llvm-svn: 175690
2013-02-20 23:51:10 +00:00
Lang Hames 24e3759230 Kill of TransferDeadFlag - Dead copies and subreg-to-reg instructions should
just be turned into kills on the spot.

llvm-svn: 175688
2013-02-20 23:36:57 +00:00
Pedro Artigas 0c09481d6b as the allocator is reset zero out the number of bytes allocated, this was just
missed before but probably what was intended.

llvm-svn: 175687
2013-02-20 23:30:56 +00:00
Jack Carter 1ac5322e61 ELF symbol table field st_other support,
excluding visibility bits.

Mips specific standalone assembler directive "set at".

This directive changes the general purpose register
that the assembler will use when given the symbolic
register name $at.

This does not include negative testing. That will come
in a future patch.

A side affect of this patch recognizes the different 
GPR register names for temporaries between old abi
and new abi so a test case for that is included.

Contributer: Vladimir Medic
llvm-svn: 175686
2013-02-20 23:11:17 +00:00
Jakob Stoklund Olesen b389271101 Copy single reaching defs directly into the LiveInterval.
When findReachingDefs() finds that only one value can reach the basic
block, just copy the work list of visited blocks directly into the live
interval.

Sort the block list and use a LiveRangeUpdater to make the bulk add
fast.

When multiple reaching defs are found, transfer the work list to the
updateSSA() work list as before. Also use LiveRangeUpdater in
updateLiveIns() following updateSSA().

This makes live interval analysis more than 3x faster on one huge test
case.

llvm-svn: 175685
2013-02-20 23:08:26 +00:00
Bill Wendling 1c20ff028e Add and remove the attribute from the correct slot.
The slot that we're adding/removing the attribute from may not be the same as
the attribute coming in. Make sure that they match up before we try to
add/remove them.
PR15313

llvm-svn: 175684
2013-02-20 23:04:11 +00:00
Bill Schmidt 4437ad7d94 Stabilize vec_constants.ll
llvm-svn: 175683
2013-02-20 22:43:03 +00:00
Erik Verbruggen ef40cdd95b Fix accidental concatenation for "outputuntil" in the -debug-buffer-size option description.
llvm-svn: 175682
2013-02-20 22:33:46 +00:00
Jim Grosbach d2037eb1ee MCParser: Update method names per coding guidelines.
s/AddDirectiveHandler/addDirectiveHandler/
s/ParseMSInlineAsm/parseMSInlineAsm/
s/ParseIdentifier/parseIdentifier/
s/ParseStringToEndOfStatement/parseStringToEndOfStatement/
s/ParseEscapedString/parseEscapedString/
s/EatToEndOfStatement/eatToEndOfStatement/
s/ParseExpression/parseExpression/
s/ParseParenExpression/parseParenExpression/
s/ParseAbsoluteExpression/parseAbsoluteExpression/
s/CheckForValidSection/checkForValidSection/

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

No functional change intended.

llvm-svn: 175675
2013-02-20 22:21:35 +00:00
Cameron Zwarich 2ad3ca37bd Only use LiveIntervals in TwoAddressInstructionPass, not a mix of Liveintervals
and SlotIndexes.

llvm-svn: 175674
2013-02-20 22:10:02 +00:00
Cameron Zwarich caad7e10c1 Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically.

llvm-svn: 175673
2013-02-20 22:10:00 +00:00
Cameron Zwarich 8e7dc068c9 Make repairIntervalsInRange() more robust. There are now no longer any liveness-
related failures when running 'make check' without LiveVariables with the
verifier enabled. Some of the remaining failures elsewhere may still be fallout
from incorrect updating of LiveIntervals or the few missing cases left in the
two-address pass.

llvm-svn: 175672
2013-02-20 22:09:57 +00:00
Arnold Schwaighofer 3f9568e921 DAGCombiner: Fold pointless truncate, bitcast, buildvector series
(2xi32) (truncate ((2xi64) bitcast (buildvector i32 a, i32 x, i32 b, i32 y)))
can be folded into a (2xi32) (buildvector i32 a, i32 b).

Such a DAG would cause uneccessary vdup instructions followed by vmovn
instructions.

We generate this code on ARM NEON for a setcc olt, 2xf64, 2xf64. For example, in
the vectorized version of the code below.

double A[N];
double B[N];

void test_double_compare_to_double() {
  int i;
  for(i=0;i<N;i++)
    A[i] = (double)(A[i] < B[i]);
}

radar://13191881

Fixes bug 15283.

llvm-svn: 175670
2013-02-20 21:33:32 +00:00
Jim Grosbach d15cd2a11c R600: Update for name changes from r175667.
llvm-svn: 175668
2013-02-20 21:31:28 +00:00
Jim Grosbach 341ad3e72a Update TargetLowering ivars for name policy.
http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

ivars should be camel-case and start with an upper-case letter. A few in
TargetLowering were starting with a lower-case letter.

No functional change intended.

llvm-svn: 175667
2013-02-20 21:13:59 +00:00
Bill Schmidt c6cbecc2c7 Additional fixes for bug 15155.
This handles the cases where the 6-bit splat element is odd, converting
to a three-instruction sequence to add or subtract two splats.  With this
fix, the XFAIL in test/CodeGen/PowerPC/vec_constants.ll is removed.

llvm-svn: 175663
2013-02-20 20:41:42 +00:00
Michael J. Spencer 1366a61242 [objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.
llvm-svn: 175659
2013-02-20 20:18:10 +00:00
Chad Rosier 4d87d45a05 Update a comment that looks to have been accidentally deleted many moons ago.
llvm-svn: 175658
2013-02-20 20:15:55 +00:00
Dan Gohman f857cd7518 Rewrite comments.
llvm-svn: 175651
2013-02-20 19:28:46 +00:00
Krzysztof Parzyszek 12ba711f35 Add comment in Memory.inc explaining r175646.
llvm-svn: 175650
2013-02-20 19:25:09 +00:00
Dan Gohman 5cdb345883 SIGQUIT is a "kill" signal, rather than an "int" signal, in this context.
llvm-svn: 175648
2013-02-20 19:15:01 +00:00
Andrew Kaylor fca968e13d Formatting, grammar
llvm-svn: 175647
2013-02-20 18:24:34 +00:00
Krzysztof Parzyszek 798679e140 On PowerPC, the cache-flush instructions dcbf and icbi are treated as
loads. On FreeBSD, add PROT_READ page protection flag before flushing
cache.

llvm-svn: 175646
2013-02-20 18:24:30 +00:00
Jakob Stoklund Olesen 623d8329e3 Use LiveRangeUpdater instead of mergeIntervalRanges.
Performance is the same, but LiveRangeUpdater has a more flexible
interface.

llvm-svn: 175645
2013-02-20 18:18:15 +00:00
Jakob Stoklund Olesen 521c708e6e Add a LiveRangeUpdater class.
Adding new segments to large LiveIntervals can be expensive because the
LiveRange objects after the insertion point may need to be moved left or
right. This can cause quadratic behavior when adding a large number of
segments to a live range.

The LiveRangeUpdater class allows the LIveInterval to be in a temporary
invalid state while segments are being added. It maintains an internal
gap in the LiveInterval when it is shrinking, and it has a spill area
for new segments when the LiveInterval is growing.

The behavior is similar to the existing mergeIntervalRanges() function,
except it allocates less memory for the spill area, and the algorithm is
turned inside out so the loop is driven by the clients.

llvm-svn: 175644
2013-02-20 18:18:12 +00:00
Andrew Kaylor 3d5d3101ed Adding support for absolute relocations. This occurs in ELF files when a relocation is given with no name and an undefined section. The relocation is applied with an address of zero.
llvm-svn: 175643
2013-02-20 18:09:21 +00:00
Michael Liao 7fb39669ef Fix PR15267
- When extloading from a vector with non-byte-addressable element, e.g.
  <4 x i1>, the current logic breaks. Extend the current logic to
  fix the case where the element type is not byte-addressable by loading
  all bytes, bit-extracting/packing each element.

llvm-svn: 175642
2013-02-20 18:04:21 +00:00
Chad Rosier a018cfd10c [ms-inline asm] Make the comment a bit more verbose.
llvm-svn: 175641
2013-02-20 18:03:44 +00:00
Jakob Stoklund Olesen 14a32d8682 Add a default constructor for LiveRange.
It is useful to be able to create temporary LiveRange object whose
members are filled in later.

llvm-svn: 175639
2013-02-20 17:46:51 +00:00
Bill Schmidt 6631e94838 Fix bug 14779 for passing anonymous aggregates [patch by Kai Nacke].
The PPC backend doesn't handle these correctly.  This patch uses logic
similar to that in the X86 and ARM backends to track these arguments
properly.

llvm-svn: 175635
2013-02-20 17:31:41 +00:00
Jyotsna Verma 7503a62bce Hexagon: Move HexagonMCInst.h to MCTargetDesc/HexagonMCInst.h.
Add HexagonMCInst class which adds various Hexagon VLIW annotations.
In addition, this class also includes some APIs related to the
constant extenders.

llvm-svn: 175634
2013-02-20 16:13:27 +00:00
NAKAMURA Takumi f4652c32e8 Revert r175626, "ADT/Optional.h: Appease msvc."
Sorry, I didn't cover +Asserts, by accident. :(

llvm-svn: 175633
2013-02-20 15:52:44 +00:00
Bill Schmidt 51e7951e24 Fix PR15155: lost vadd/vsplat optimization.
During lowering of a BUILD_VECTOR, we look for opportunities to use a
vector splat.  When the splatted value fits in 5 signed bits, a single
splat does the job.  When it doesn't fit in 5 bits but does fit in 6,
and is an even value, we can splat on half the value and add the result
to itself.

This last optimization hasn't been working recently because of improved
constant folding.  To circumvent this, create a pseudo VADD_SPLAT that
can be expanded during instruction selection.

llvm-svn: 175632
2013-02-20 15:50:31 +00:00
NAKAMURA Takumi 3389c55e10 Whitespace.
llvm-svn: 175627
2013-02-20 15:12:32 +00:00