Commit Graph

87265 Commits

Author SHA1 Message Date
Pedro Artigas e4348b0412 moves doInitialization and doFinalization to the Pass class and removes some unreachable code in MachineModuleInfo
reviewed by Evan Cheng <evan.cheng@apple.com>

llvm-svn: 169164
2012-12-03 21:56:57 +00:00
Argyrios Kyrtzidis 8c114534ff Add a getMemorySize() function for DenseSet.
llvm-svn: 169163
2012-12-03 21:46:21 +00:00
Nadav Rotem eee203d885 Now that we have a basic if-conversion infrastructure we can rename the
"single basic block loop vectorizer" to "innermost loop vectorizer".

llvm-svn: 169158
2012-12-03 21:33:08 +00:00
Michael Ilseman e26658d372 Since this SmallVector immediately grows on the next line, don't waste stack space. SmallVector is still needed due to existing APIs growing their arguments
llvm-svn: 169157
2012-12-03 21:29:36 +00:00
Jakob Stoklund Olesen 499cac486a Add a new hook for providing register allocator hints more flexibly.
The TargetRegisterInfo::getRegAllocationHints() function is going to
replace the existing mechanisms for providing target-dependent hints to
the register allocator: ResolveRegAllocHint() and
getRawAllocationOrder().

The new hook is more flexible because it allows the target to provide
multiple preferred candidate registers for each virtual register, and it
is easier to use because targets are not required to return a reference
to a constant array like getRawAllocationOrder().

An optional VirtRegMap argument can be used to provide target-dependent
hints that depend on the provisional assignments of other virtual
registers.

llvm-svn: 169154
2012-12-03 21:17:00 +00:00
Jyotsna Verma 4d8686cc42 Define load instructions with base+immediate offset addressing mode
using multiclass.

llvm-svn: 169153
2012-12-03 21:13:13 +00:00
Nadav Rotem a30aba7a01 Add initial support for IF-conversion. This patch implements the first 1/3,
which is the legality of the if-conversion transformation. The next step is to
implement the cost-model for the if-converted code as well as the
vectorization itself.

llvm-svn: 169152
2012-12-03 21:06:35 +00:00
Jyotsna Verma c86b3e1b26 Define unsigned const-ext predicates.
llvm-svn: 169149
2012-12-03 20:39:45 +00:00
Jyotsna Verma 6aba56e9d4 Removing unnecessary 'else' statement from the predicates defined in HexagonOperards.td.
llvm-svn: 169148
2012-12-03 20:14:38 +00:00
Argyrios Kyrtzidis 479d37ed63 Eliminate redundant bitwise operations when using a llvm/ADT/PointerUnion.
For comparison, with this code sample:

PointerUnion<int *, char *> Data;
PointerUnion<int *, char *> foo1() {
	Data = new int;
	return new int;
}
PointerUnion<int *, char *> foo2() {
	Data = new char;
	return new char;
}

Before this patch we would get:

define i64 @_Z4foo1v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 4)
  %2 = ptrtoint i8* %1 to i64
  %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = and i64 %3, 1
  %.masked.i = and i64 %2, -3
  %5 = or i64 %4, %.masked.i
  store i64 %5, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %6 = tail call noalias i8* @_Znwm(i64 4)
  %7 = ptrtoint i8* %6 to i64
  %8 = and i64 %7, -3
  ret i64 %8
}

define i64 @_Z4foo2v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 1)
  %2 = ptrtoint i8* %1 to i64
  %3 = load i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = and i64 %3, 1
  %5 = or i64 %2, %4
  %6 = or i64 %5, 2
  store i64 %6, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %7 = tail call noalias i8* @_Znwm(i64 1)
  %8 = ptrtoint i8* %7 to i64
  %9 = or i64 %8, 2
  ret i64 %9
}

After the patch:

define i64 @_Z4foo1v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 4)
  %2 = ptrtoint i8* %1 to i64
  store i64 %2, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %3 = tail call noalias i8* @_Znwm(i64 4)
  %4 = ptrtoint i8* %3 to i64
  ret i64 %4
}

declare noalias i8* @_Znwm(i64)

define i64 @_Z4foo2v() uwtable ssp {
  %1 = tail call noalias i8* @_Znwm(i64 1)
  %2 = ptrtoint i8* %1 to i64
  %3 = or i64 %2, 2
  store i64 %3, i64* getelementptr inbounds (%"class.llvm::PointerUnion"* @Data, i64 0, i32 0, i32 0), align 8
  %4 = tail call noalias i8* @_Znwm(i64 1)
  %5 = ptrtoint i8* %4 to i64
  %6 = or i64 %5, 2
  ret i64 %6
}

llvm-svn: 169147
2012-12-03 19:59:23 +00:00
Eli Bendersky 5d7b117f44 Simplify this test a bit because DWARF emission/dumping on some platforms
is not yet good enough for more sophistication. The important goal of this
test is to make sure llc doesn't crash on this IR like it used to.

llvm-svn: 169146
2012-12-03 19:58:12 +00:00
Bill Wendling 7b246c3872 Add 'getInt64Field()' method to get the signed integer instead of unsigned.
llvm-svn: 169145
2012-12-03 19:44:25 +00:00
Alexey Samsonov ef51c3ff81 ASan: add blacklist file to ASan pass options. Clang patch for this will follow.
llvm-svn: 169143
2012-12-03 19:09:26 +00:00
Eli Bendersky b42d1466a0 Fix PR12942: Allow two CUs to be generated from the same source file.
Thanks Eric for the review.

llvm-svn: 169142
2012-12-03 18:45:45 +00:00
Nadav Rotem 2349531def Teach the jump threading optimization to stop scanning the basic block when calculating the cost after passing the threshold.
llvm-svn: 169135
2012-12-03 17:34:44 +00:00
Jakob Stoklund Olesen 4c2094be3c Revert r169039, "Aggregate pass execution time report by pass ID instead of pass instance."
llvm-svn: 169134
2012-12-03 17:31:11 +00:00
Chandler Carruth a79a28b7a8 Sort the #include lines for the include/... tree with the script.
AKA: Recompile *ALL* the source code!

This one went much better. No manual edits here. I spot-checked for
silliness and grep-checked for really broken edits and everything seemed
good. It all still compiles. Yell if you see something that looks goofy.

llvm-svn: 169133
2012-12-03 17:02:12 +00:00
Chandler Carruth 6a451d03c9 Teach the include sorter to not choke on include guards. ;]
Kind of important when prepping the include/... tree version of the sort
changes.

llvm-svn: 169132
2012-12-03 17:01:46 +00:00
Chandler Carruth ed0881b2a6 Use the new script to sort the includes of every file under lib.
Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

llvm-svn: 169131
2012-12-03 16:50:05 +00:00
Chris Lattner 309adbdd43 clarify that this isn't lld.
llvm-svn: 169130
2012-12-03 16:08:32 +00:00
Chandler Carruth cba0f3dd7c Add a completely hack-ish tool to sort includes according to the coding
standards.

I am a terrible Python programmer. Patches more the welcome. Please tell
me how this should look if it should look differently. It's just a tiny
little script so it didn't make sense to go through pre-commit review,
especially as someone who actually knows python may want to just rip it
apart and do it The Right Way.

I will be preparing a commit shortly that uses this script to
canonicalize *all* of the #include lines in LLVM. Really, all of them.

llvm-svn: 169125
2012-12-03 14:23:44 +00:00
Chandler Carruth f02b8bf11b Remove some buggy and apparantly unnecessary code from SROA.
The partitioning logic attempted to handle uses of an alloca with an
offset starting before the alloca so long as the use had some overlap
with the alloca itself. However, there was a bug where we tested
'(uint64_t)Offset >= AllocSize' without first checking whether 'Offset'
was positive. As a consequence, essentially every negative offset (that
is, starting *before* the alloca does) would be thrown out, even if it
was overlapping. The subsequent code to throw out negative offsets which
were actually non-overlapping was essentially dead. The code to *handle*
overlapping negative offsets was actually dead!

I've just removed all of this, and taught SROA to discard any uses which
start prior to the alloca from the beginning. It has the lovely property
of simplifying the code. =] All the tests still pass, and in fact no new
tests are needed as this is already covered by our testsuite. Fixing the
code so that negative offsets work the way the comments indicate they
were supposed to work causes regressions. That's how I found this.

Anyways, this is all progress in the correct direction -- tightening up
SROA to be maximally aggressive. Some day, I really hope to turn
out-of-bounds accesses to an alloca into 'unreachable'.

llvm-svn: 169120
2012-12-03 10:59:55 +00:00
Nuno Lopes 5eec2679df fix stats for added checks
llvm-svn: 169119
2012-12-03 10:15:03 +00:00
Jyotsna Verma 014dfe4de0 Define signed const-ext predicates.
llvm-svn: 169117
2012-12-03 06:54:50 +00:00
Bill Wendling fbecf8ba24 Remove 'deplibs' keyword, since it's no longer used.
llvm-svn: 169116
2012-12-03 06:34:06 +00:00
Eli Bendersky 035513831b Clean up, bring up-to-date and apply consistent formatting.
This document is a long-time pet peeve :-) More fixes to come.

llvm-svn: 169115
2012-12-03 04:10:58 +00:00
Nadav Rotem 1157e1410c Allow merging multiple store sequences on the same chain.
llvm-svn: 169111
2012-12-02 17:14:09 +00:00
Benjamin Kramer 65e7c6626a Bring vim keyword lists up to date.
llvm-svn: 169110
2012-12-02 16:40:38 +00:00
Eli Bendersky 061d2baa57 Fix a bug in FileCheck that wouldn't let define variables as follows:
; CHECK: [[VAR:[a-z]]]

The problem was that to find the end of the regex var definition, it was
simplistically looking for the next ]] and finding the incorrect one. A
better approach is to count nesting of brackets (taking escaping into
account). This way the brackets that are part of the regex can be discovered
and skipped properly, and the ]] ending is detected in the right place.

llvm-svn: 169109
2012-12-02 16:02:41 +00:00
Eli Bendersky b7b1ffc8e7 Fix an invalid regex in the test
llvm-svn: 169108
2012-12-02 15:46:02 +00:00
Chandler Carruth 494cfc0786 Simplify the coding standards for #include ordering. The ordering is now
trivially achievable with an editor. I'll likely check in a silly python
script to help with this too.

llvm-svn: 169107
2012-12-02 11:53:27 +00:00
Justin Holewinski 0bd335efcd Unbreak Sphinx build
llvm-svn: 169106
2012-12-02 02:47:48 +00:00
Eli Bendersky 04a382c796 Another fix attempt to Makefile.sphinx - copy the PNGs from tutorial/ as well,
and recursive copying is not required for the tutorial/ directory.

llvm-svn: 169105
2012-12-01 22:21:04 +00:00
Eli Bendersky e4adf43168 Attempt to fix Makefile.sphinx to not generate errors while trying to copy
files from tutorial/.svn

llvm-svn: 169104
2012-12-01 22:11:59 +00:00
Eli Bendersky 4ca99ba6b5 Update FileCheck's documentation to mention recently added feature of
matching a variable defined on the same line.

llvm-svn: 169103
2012-12-01 22:03:57 +00:00
Gregory Szorc 8757acb3f2 [python] Add markup option to disassembler
Patch contributed by Wladimir J. van der Laan <laanwj@gmail.com>

llvm-svn: 169102
2012-12-01 21:57:30 +00:00
Eli Bendersky e8b8f1bcb8 Support referencing variables defined on the same line.
See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157198.html
and related discussions.

llvm-svn: 169101
2012-12-01 21:54:48 +00:00
James Molloy e901b5fda2 Remove bugzilla link.
llvm-svn: 169091
2012-12-01 14:44:23 +00:00
Dmitri Gribenko 7174c5a074 Documentation: convert WritingAnLLVMBackend.html to reST
llvm-svn: 169087
2012-12-01 12:13:48 +00:00
Benjamin Kramer afbb6bd457 Add .arcconfig to the repository. Useful if someone wants to use phabricator's command line tool.
llvm-svn: 169085
2012-12-01 12:07:58 +00:00
Benjamin Kramer 47534c7440 SROA: Avoid struct and array types early to avoid creating an overly large integer type.
Fixes PR14465.

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

llvm-svn: 169084
2012-12-01 11:53:32 +00:00
Zhou Sheng 8e6d64a71d Revert previous check in r168581, r169079 as they are still in code review status.
llvm-svn: 169083
2012-12-01 10:54:28 +00:00
Zhou Sheng 13fb1ca44a The patch is to improve the memory footprint of pass GlobalOpt.
Also check in a case to repeat the issue, on which 'opt -globalopt' consumes 1.6GB memory.
The big memory footprint cause is that current GlobalOpt one by one hoists and stores the leaf element constant into the global array, in each iteration, it recreates the global array initializer constant and leave the old initializer alone. This may result in many obsolete constants left.
For example:  we have global array @rom = global [16 x i32] zeroinitializer
After the first element value is hoisted and installed:   @rom = global [16 x i32] [ 1, 0, 0, ... ]
After the second element value is installed:  @rom = global [16 x 32] [ 1, 2, 0, 0, ... ]        // here the previous initializer is obsolete
...
When the transform is done, we have 15 obsolete initializers left useless.

llvm-svn: 169079
2012-12-01 04:38:53 +00:00
NAKAMURA Takumi 7fe8a4032a VMCore/DebugInfo.cpp: DICompileUnit::getSubprograms(): Check numOperands().
2012-11-30-misched-dbg.ll had crashed. Then (MDNode)N was "!{}".
I am not sure it would be ill-formed or not.

llvm-svn: 169074
2012-12-01 02:23:45 +00:00
Daniel Dunbar 40f1d85807 MC/AsmParser: Avoid unnecessary use of SourceMgr::FindBufferForLoc()
- Each macro instantiation introduces a new buffer, and FindBufferForLoc() is
   linear, so previously macro instantiation could be N^2 for some pathological
   inputs.

llvm-svn: 169073
2012-12-01 01:38:48 +00:00
Andrew Trick b767d1eba8 misched: Fix RegisterPressureTracker handling of DebugVals.
Assertion failed: (TopRPTracker.getPos() == RegionBegin && "bad initial Top tracker").
rdar://12790302.

llvm-svn: 169072
2012-12-01 01:22:49 +00:00
Andrew Trick d5953622ce misched: Fix the DAG builder to handle an undef operand at ExitSU.
Assertion failed: (VNI && "No value to read by operand")
rdar://12790267.

llvm-svn: 169071
2012-12-01 01:22:44 +00:00
Andrew Trick a01302182c misched: Fix LiveInterval update to better handle DebugVal.
Assertion failed: (itr != mi2iMap.end() && "Instruction not found in maps.")
rdar://12777252.

llvm-svn: 169070
2012-12-01 01:22:41 +00:00
Andrew Trick e7ea8aa48a misched: fix RegionBegin when DebugValues get shuffled to the top.
assert (RemainingInstrs == 0 && "Instruction count mismatch!")

rdar://12776937.

llvm-svn: 169069
2012-12-01 01:22:38 +00:00
Jakob Stoklund Olesen da2b6b381a Simplify REG_SEQUENCE lowering.
The TwoAddressInstructionPass takes the machine code out of SSA form by
expanding REG_SEQUENCE instructions into copies. It is no longer
necessary to rewrite the registers used by a REG_SEQUENCE instruction
because the new coalescer algorithm can do it now.

REG_SEQUENCE is just converted to a sequence of sub-register copies now.

llvm-svn: 169067
2012-12-01 01:06:44 +00:00
Michael Ilseman 640a126d81 Update the emacs mode to recognize fadd, fsum, fmul, fdiv, frem, fcmp, icmp
llvm-svn: 169064
2012-12-01 00:42:27 +00:00
Eric Christopher 9c2ecd93d0 Add some first skeleton work for the DWARF5 Fission proposal. Emit
part of the compile unit CU and start separating out information into
the various sections that will be pulled out later.

WIP.

llvm-svn: 169061
2012-11-30 23:59:06 +00:00
Jakob Stoklund Olesen bb1e98318f Convert COPY instructions into KILLs if they have implicit defs.
MachineCopyPropagation doesn't understand super-register liveness well
enough to be able to remove implicit defs of super-registers.

This fixes a problem in ARM/2012-01-26-CopyPropKills.ll that is exposed
by an future TwoAddressInstructionPass change. The KILL instructions are
removed before the machine code is emitted.

llvm-svn: 169060
2012-11-30 23:53:00 +00:00
Eric Christopher c7e43fffc5 Add support for fission attributes/forms/operations -> string.
llvm-svn: 169056
2012-11-30 23:20:43 +00:00
Michael Ilseman 9d8da7b11b Vim mode updated to recognize fast-math flags
llvm-svn: 169055
2012-11-30 23:18:21 +00:00
Michael Ilseman f15af485a0 Removed redundancy in wording
llvm-svn: 169053
2012-11-30 23:14:52 +00:00
Michael Ilseman 1e1c524afd Clean up the documentation to have a common description area for fast-math flags.
llvm-svn: 169052
2012-11-30 23:12:42 +00:00
Bill Wendling 414abc471c Be more clear on what parts of code I own.
llvm-svn: 169050
2012-11-30 23:00:25 +00:00
Pedro Artigas 00b83c9b8d reversed the logic of the log2 detection routine to reduce the number of nested ifs
llvm-svn: 169049
2012-11-30 22:47:15 +00:00
Nadav Rotem 3ae24ee08a minor cleanups
llvm-svn: 169048
2012-11-30 22:37:11 +00:00
Alexey Samsonov 2b431d97aa Fix a bug in APFloat.cpp: declare APFloat after fltSemantics it
uses. APFloat::convert() takes the pointer to the fltSemantics
variable, which is later accessed it in ~APFloat() desctructor.
That is, semantics must still be alive at the moment we delete
APFloat.

Found by experimental AddressSanitizer use-after-scope checker.

llvm-svn: 169047
2012-11-30 22:27:54 +00:00
Bill Wendling d2901e94f1 Add me as LTO code owner.
llvm-svn: 169046
2012-11-30 22:15:08 +00:00
Bill Wendling c786b31233 Replace r168930 with a more reasonable patch.
The original patch removed a bunch of code that the SjLjEHPrepare pass placed
into the entry block if all of the landing pads were removed during the
CodeGenPrepare class. The more natural way of doing things is to run the CGP
*before* we run the SjLjEHPrepare pass.

Make it so!

llvm-svn: 169044
2012-11-30 22:08:55 +00:00
Pedro Artigas 993acd0c54 Addresses many style issues with prior checkin (r169025)
llvm-svn: 169043
2012-11-30 22:07:05 +00:00
Jakob Stoklund Olesen 2776b4c624 Add a -time-compilations=<N> option to llc.
This causes llc to repeat the module compilation N times, making it
possible to get more accurate information from -time-passes when
compiling small modules.

llvm-svn: 169040
2012-11-30 21:42:47 +00:00
Jakob Stoklund Olesen 366a2e812d Aggregate pass execution time report by pass ID instead of pass instance.
This avoids unidentified duplicates in the pass execution time report
when a pass runs more than once in the pass manager pipeline.

llvm-svn: 169039
2012-11-30 21:42:45 +00:00
Daniel Dunbar 2555a4fc08 lit: Add a simple test suite for checking test runner parallelism.
llvm-svn: 169038
2012-11-30 21:34:04 +00:00
Chad Rosier 31e7d2deb3 test/CodeGen/PowerPC/vec_mul.ll: Add a triple. Thanks, Hal.
llvm-svn: 169026
2012-11-30 19:15:10 +00:00
Pedro Artigas d8795040de Add fast math inst combine X*log2(Y*0.5)-->X*log2(Y)-X
reviewed by Michael Ilseman <milseman@apple.com>

llvm-svn: 169025
2012-11-30 19:09:41 +00:00
Sebastian Pop a204f72237 Codegen failure for vmull with small vectors
Codegen was failing with an assertion because of unexpected vector
operands when legalizing the selection DAG for a MUL instruction.

The asserting code was legalizing multiplies for vectors of size 128
bits. It uses a custom lowering to try and detect cases where it can
use a VMULL instruction instead of a VMOVL + VMUL.  The code was
looking for input operands to the MUL that had been sign or zero
extended. If it found the extended operands it would drop the
sign/zero extension and use the original vector size as input to a
VMULL instruction.

The code assumed that the original input vector was 64 bits so that
after dropping the extension it would fit directly into a D register
and could be used as an operand of a VMULL instruction. The input
code that trigger the failure used a vector of <4 x i8> that was
sign extended to <4 x i32>. It was not safe to drop the sign
extension in this case because the original vector is only 32 bits
wide. The fix is to insert a sign extension for the vector to reach
the required 64 bit size. In this particular example, the vector would
need to be sign extented to a <4 x i16>.

llvm-svn: 169024
2012-11-30 19:08:04 +00:00
Chad Rosier a820e7feff test/CodeGen/PowerPC/vec_mul.ll: Fix register operands.
llvm-svn: 169020
2012-11-30 18:29:01 +00:00
Jyotsna Verma a77c054e85 Use multiclass for the load instructions with MEMri operand.
llvm-svn: 169018
2012-11-30 17:31:52 +00:00
Nadav Rotem 6b494be886 Remove the use of LPPassManager. We can remove LPM because we dont need to run any additional loop passes on the new vector loop.
llvm-svn: 169016
2012-11-30 17:27:53 +00:00
Eli Bendersky 43d50d4a35 Clean up whitespace and add comments
llvm-svn: 169002
2012-11-30 14:22:14 +00:00
Eli Bendersky 8e1c647787 Make FileCheck return 2 in case of an error as documented,
instead of 1 or true (?!)

llvm-svn: 169001
2012-11-30 13:51:33 +00:00
NAKAMURA Takumi faaf131091 test/CodeGen/PowerPC: Add explicit -march=ppc32.
FIXME: Please add another RUN line if you would like to check also on ppc64.
llvm-svn: 168999
2012-11-30 13:28:31 +00:00
Adhemerval Zanella 812410f2d1 This patch fixes the Altivec addend construction for the fused multiply-add
instruction (vmaddfp) to conform with IEEE to ensure the sign of a zero
result when resulting product is -0.0.

The -0.0 vector addend to vmaddfp is generated by a creating a vector
with full bits sets and then shifting each elements by 31-bits to the
left, resulting in a vector of 0x80000000 (or -0.0 as float).

The 'buildvec_canonicalize.ll' was adjusted to reflect this change and
the 'vec_mul.ll' was complemented with the float vector multiplication
test.

llvm-svn: 168998
2012-11-30 13:05:44 +00:00
Evgeniy Stepanov 5a16af8638 [msan] Tests for vector manipulation instructions.
llvm-svn: 168997
2012-11-30 12:12:20 +00:00
Chandler Carruth f12e3a67db Switch LLVM_USE_RVALUE_REFERENCES to LLVM_HAS_RVALUE_REFERENCES.
Rationale:
1) This was the name in the comment block. ;]
2) It matches Clang's __has_feature naming convention.
3) It matches other compiler-feature-test conventions.

Sorry for the noise. =]

I've also switch the comment block to use a \brief tag and not duplicate
the name.

llvm-svn: 168996
2012-11-30 11:45:22 +00:00
Kostya Serebryany 817b60af38 [asan] simplify the code around doesNotReturn call. It now magically works.
llvm-svn: 168995
2012-11-30 11:08:59 +00:00
Chandler Carruth 9c7462a8b8 Separate out the tests for whether the compiler suports R-value
references from whether it supports an R-value reference *this. No
version of GCC today supports the latter, which breaks GCC C++11
compiles of LLVM and Clang now.

Also add doxygen comments clarifying what's going on here, and update
the usage in Optional. I'll update the usages in Clang next.

llvm-svn: 168993
2012-11-30 11:04:18 +00:00
Patrik Hagglund 086ee1ee50 More strict error checking in parseSpecifier + simplified code.
For example, don't allow empty strings to be passed to getInt.

Move asserts inside parseSpecifier. (One day we may want to pass parse
error messages to the user - from LLParser - instead of using asserts,
but keep the code simple until then. There have been an attempt to do
this. See r142288, which got reverted, and r142605.)

llvm-svn: 168991
2012-11-30 10:06:59 +00:00
Chandler Carruth d9ef81e133 Fix non-determinism introduced in r168970 and pointed out by Duncan.
We're iterating over a non-deterministically ordered container looking
for two saturating flags. To do this correctly, we have to saturate
both, and only stop looping if both saturate to their final value.
Otherwise, which flag we see first changes the result.

This is also a micro-optimization of the previous version as now we
don't go into the (possibly expensive) test logic once the first
violation of either constraint is detected.

llvm-svn: 168989
2012-11-30 09:34:29 +00:00
Chandler Carruth 77d433dafe Rearrange the comments, control flow, and variable names; no
functionality changed.

Evan's commit r168970 moved the code that the primary comment in this
function referred to to the other end of the function without moving the
comment, and there has been a steady creep of "boolean" logic in it that
is simpler if handled via early exit. That way each special case can
have its own comments. I've also made the variable name a bit more
explanatory than "AllFit". This is in preparation to fix the
non-deterministic output of this function.

llvm-svn: 168988
2012-11-30 09:26:25 +00:00
Eric Christopher 3c23009117 Add the rest of the experimental fission sections to MC.
llvm-svn: 168986
2012-11-30 06:47:06 +00:00
Jyotsna Verma b950ea61fc Use multiclass for the store instructions with MEMri operand.
llvm-svn: 168983
2012-11-30 06:10:22 +00:00
Jyotsna Verma ede608cce0 Use multiclass for the load instructions with 'base + register offset'
addressing mode.

llvm-svn: 168976
2012-11-30 04:19:09 +00:00
Meador Inge e3f2b26bfa Move library call simplification statistic to instcombine
The simplify-libcalls pass maintained a statistic to count the number
of library calls that have been simplified.  Now that library call
simplification is being carried out in instcombine the statistic should
be moved to there.

llvm-svn: 168975
2012-11-30 04:05:06 +00:00
Chandler Carruth dbd6958183 Move the InstVisitor utility into VMCore where it belongs. It heavily
depends on the IR infrastructure, there is no sense in it being off in
Support land.

This is in preparation to start working to expand InstVisitor into more
special-purpose visitors that are still generic and can be re-used
across different passes. The expansion will go into the Analylis tree
though as nothing in VMCore needs it.

llvm-svn: 168972
2012-11-30 03:08:41 +00:00
Evan Cheng 65df808f62 Fix logic to determine whether to turn a switch into a lookup table. When
the tables cannot fit in registers (i.e. bitmap), do not emit the table
if it's using an illegal type.

rdar://12779436

llvm-svn: 168970
2012-11-30 02:02:42 +00:00
Preston Briggs fd0b5c898a Modified dump() to provide a little
more information for dependences between
instructions that don't share a common loop.

Updated the test results appropriately.

llvm-svn: 168965
2012-11-30 00:44:47 +00:00
Jordan Rose 142e56d157 Add a new C++11 compatibility macro, LLVM_LVALUE_FUNCTION.
This expands to '&', and is intended to be used when an /optional/ rvalue
override is available.

Before:
  void foo() const { ... }

After:
  void foo() const LLVM_LVALUE_FUNCTION { ... }
  void foo() && { ... }

This is used to allow moving the contents of an Optional.

llvm-svn: 168963
2012-11-30 00:38:53 +00:00
Kevin Enderby 136d6746c5 Fixed the arm disassembly of invalid BFI instructions to not build a bad MCInst
which would then cause an assert when printed.  rdar://11437956

llvm-svn: 168960
2012-11-29 23:47:11 +00:00
Eric Christopher 42e3994e77 More comment.
llvm-svn: 168952
2012-11-29 22:56:13 +00:00
Dan Gohman 913c96da43 Update comment for malloc being a library call now, rather than an instruction.
llvm-svn: 168946
2012-11-29 21:58:47 +00:00
Michael Ilseman 05d3bf77a1 copyFastMathFlags utility and test case
llvm-svn: 168943
2012-11-29 21:25:12 +00:00
Eli Bendersky 03bb500052 Add a FileCheck test that makes sure two different CHECKs won't match the
same string

llvm-svn: 168942
2012-11-29 21:24:44 +00:00
Dan Gohman 0584c727f2 Update my email address.
llvm-svn: 168941
2012-11-29 21:17:26 +00:00
Chad Rosier 0987dd1a48 Whitespace.
llvm-svn: 168937
2012-11-29 20:58:08 +00:00
Chad Rosier c19b0695ba Fix 80-column violations.
llvm-svn: 168936
2012-11-29 20:56:58 +00:00
Benjamin Kramer f3e84b1790 Object: Pass the buffer name through when making a copy.
Should bring the buildbots back to life.

llvm-svn: 168935
2012-11-29 20:08:03 +00:00
Quentin Colombet 13cd521b24 Add cortex-a5 subtarget to the supported ARM architectures
llvm-svn: 168933
2012-11-29 19:48:01 +00:00
Justin Holewinski edec332437 Cleanup recent addition of DAGTypeLegalizer::SplitVecOp_VSELECT
llvm-svn: 168932
2012-11-29 19:42:09 +00:00
Shuxin Yang abcc370423 rdar://12100355 (part 1)
This revision attempts to recognize following population-count pattern:

 while(a) { c++; ... ; a &= a - 1; ... },
  where <c> and <a>could be used multiple times in the loop body.

 TODO: On X8664 and ARM, __buildin_ctpop() are not expanded to a efficent 
instruction sequence, which need to be improved in the following commits.

Reviewed by Nadav, really appreciate!

llvm-svn: 168931
2012-11-29 19:38:54 +00:00
Bill Wendling a4a77edf2e Handle the situation where CodeGenPrepare removes a reference to a BB that has
the last invoke instruction in the function. This also removes the last landing
pad in an function. This is fine, but with SjLj EH code, we've already placed a
bunch of code in the 'entry' block, which expects the landing pad to stick
around.

When we get to the situation where CGP has removed the last landing pad, go
ahead and nuke the SjLj instructions from the 'entry' block.
<rdar://problem/12721258>

llvm-svn: 168930
2012-11-29 19:38:06 +00:00
Jyotsna Verma e95559fc16 Use multiclass for 'transfer' instructions.
llvm-svn: 168929
2012-11-29 19:35:44 +00:00
Nadav Rotem ec739205cc No need to run LICM after loop vectorization because we dont generate invariant code any more.
llvm-svn: 168928
2012-11-29 19:28:29 +00:00
Nadav Rotem 8dd6ee8df5 When broadcasting invariant scalars into vectors, place the broadcast code in the preheader.
llvm-svn: 168927
2012-11-29 19:25:41 +00:00
Dmitri Gribenko f589e2418d Documentation for FileCheck: use 'option' and 'program' directives.
This enables option cross-referencing and now '--' in option names are no more turned into en dashes.

llvm-svn: 168926
2012-11-29 19:21:02 +00:00
Meador Inge 75798bb7fe instcombine: Migrate puts optimizations
This patch migrates the puts optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

All the simplifiers from simplify-libcalls have now been migrated to
instcombine.  Yay!  Just a few other bits to migrate (prototype attribute
inference and a few statistics) and simplify-libcalls can finally be put
to rest.

llvm-svn: 168925
2012-11-29 19:15:17 +00:00
Dmitri Gribenko 59aeece231 Documentation for llvm-link: reformat
llvm-svn: 168924
2012-11-29 19:14:35 +00:00
Jim Grosbach aae0a4bd87 Fix a memory leak in MachOObjectFile.
MachOObjectFile owns a MachOObj, but never frees it. Both MachOObjectFile
and MachOObj want to own the MemoryBuffer, though, so we have to be careful
and give them each one of their own.

Thanks to Greg Clayton, Eric Christopher and Michael Spencer for helping
figure out what's going wrong here.

rdar://12561773

llvm-svn: 168923
2012-11-29 19:14:11 +00:00
Dmitri Gribenko c9e206f090 Documentation for llvm-cov: reformat
llvm-svn: 168922
2012-11-29 19:10:21 +00:00
Benjamin Kramer ba11a9892c Follow up to 168711: It's safe to base this analysis on the found compare, just return the value for the right predicate.
Thanks to Andy for catching this.

llvm-svn: 168921
2012-11-29 19:07:57 +00:00
Dmitri Gribenko 1521681b59 Documentation for llvm-stress: reformat
llvm-svn: 168920
2012-11-29 19:05:55 +00:00
Dmitri Gribenko 6c80bcb56f Documentation for opt: reformat
llvm-svn: 168919
2012-11-29 19:02:50 +00:00
Andrew Trick fa59403bfd Improve isImpliedCond comment a bit.
llvm-svn: 168914
2012-11-29 18:35:13 +00:00
Alexey Samsonov 9a956e8cd2 [ASan] Simplify check added in r168861. Bail out from module pass early if the module is blacklisted.
llvm-svn: 168913
2012-11-29 18:27:01 +00:00
Dmitri Gribenko 76561e9741 Documentation for llc: reformat.
llvm-svn: 168912
2012-11-29 18:16:11 +00:00
Matt Beaumont-Gay c76536f886 Apply Takumi's patch to suppress unused-variable warnings in -Asserts builds.
llvm-svn: 168911
2012-11-29 18:15:49 +00:00
Alexey Samsonov df6245233c Add options to AddressSanitizer passes to make them configurable by frontend.
llvm-svn: 168910
2012-11-29 18:14:24 +00:00
Shuxin Yang f265351491 fix a typo
llvm-svn: 168909
2012-11-29 18:09:37 +00:00
Dmitri Gribenko e260d3af52 Documentation for lit: more formatting: use 'option' and 'program' directives.
This enables cross-referencing and now '--' in option names are no more turned into en dashes.

llvm-svn: 168906
2012-11-29 18:03:08 +00:00
Pedro Artigas d6b092bbd5 One more step towards making doInitialization and doFinalization useful for
start up and clean up module passes, now that ASAN and TSAN are fixed the
tests pass

llvm-svn: 168905
2012-11-29 17:47:05 +00:00
Dmitri Gribenko cbb07bea14 Documentation for tblgen: formatting
llvm-svn: 168904
2012-11-29 17:41:05 +00:00
Dmitri Gribenko 6e303f7615 Documentation for lit: formatting improvements.
llvm-svn: 168902
2012-11-29 17:05:34 +00:00
Patrik Hagglund 9758517894 Test commit.
llvm-svn: 168899
2012-11-29 16:19:11 +00:00
Dmitri Gribenko 8bd389d8d7 Documentation: formatting improvements
llvm-svn: 168897
2012-11-29 16:12:13 +00:00
Meador Inge f8e725081c instcombine: Migrate fputs optimizations
This patch migrates the fputs optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168893
2012-11-29 15:45:43 +00:00
Meador Inge bc84d1a4f5 instcombine: Migrate fwrite optimizations
This patch migrates the fwrite optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168892
2012-11-29 15:45:39 +00:00
Meador Inge 1009cecca0 instcombine: Migrate fprintf optimizations
This patch migrates the fprintf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168891
2012-11-29 15:45:33 +00:00
Evgeniy Stepanov 30484fc704 [msan] Handle vector manipulation instructions.
Handle insertelement, extractelement, shufflevector.

llvm-svn: 168889
2012-11-29 15:22:06 +00:00
Evgeniy Stepanov f433cecf96 [msan] Fix getOriginForNaryOp.
The old version failed on a 3-arg instruction with (-1, 0, 0) shadows (it would
pick the 3rd operand origin irrespective of its shadow).
    
The new version always picks the origin of the rightmost poisoned operand.

llvm-svn: 168887
2012-11-29 14:44:00 +00:00
Silviu Baranga 93aefa5f2c Added atomic 64 min/max/umin/umax instrinsics support in the ARM backend.
llvm-svn: 168886
2012-11-29 14:41:25 +00:00
Benjamin Kramer aa598b3be6 misched: Recompute priority queue when DFSResults are updated.
This was found by MSVC10's STL debug mode on a test from the test suite. Sadly
std::is_heap isn't standard so there is no way to assert this without writing
our own heap verify, which looks like overkill to me.

llvm-svn: 168885
2012-11-29 14:36:26 +00:00
Evgeniy Stepanov 7ad7e83031 [msan] Basic handling of inline asm.
llvm-svn: 168884
2012-11-29 14:32:03 +00:00
Justin Holewinski 0ac49bf846 Teach the legalizer how to handle operands for VSELECT nodes
If we need to split the operand of a VSELECT, it must be the mask operand. We
split the entire VSELECT operand with EXTRACT_SUBVECTOR.

llvm-svn: 168883
2012-11-29 14:26:28 +00:00
Justin Holewinski bc45119b44 Allow targets to prefer TypeSplitVector over TypePromoteInteger when computing the legalization method for vectors
For some targets, it is desirable to prefer scalarizing <N x i1> instead of promoting to a larger legal type, such as <N x i32>.

llvm-svn: 168882
2012-11-29 14:26:24 +00:00
Evgeniy Stepanov 857d9d2a59 [msan] Propagate shadow through (x<0) and (x>=0) comparisons.
This is a special case of signed relational comparison where result
only depends on the sign of x.

llvm-svn: 168881
2012-11-29 14:25:47 +00:00
Evgeniy Stepanov eeb8b7c391 [msan] Fix shadow & origin store & load alignment.
This change ensures that shadow memory accesses have the same alignment
as corresponding app memory accesses.

llvm-svn: 168880
2012-11-29 14:05:53 +00:00
Evgeniy Stepanov 62ba611828 [msan] Optimize getOriginPtr.
Rewrite getOriginPtr in a way that lets subsequent optimizations factor out
the common part of Shadow and Origin address calculation. Improves perf by
up to 5%.

llvm-svn: 168879
2012-11-29 13:43:05 +00:00
Evgeniy Stepanov da0072b676 [msan] Fix a few compilation warnings.
llvm-svn: 168878
2012-11-29 13:12:03 +00:00
Evgeniy Stepanov c3b579e5ac [msan] Add a test for r168873.
llvm-svn: 168877
2012-11-29 13:11:09 +00:00
Evgeniy Stepanov 62b5db9361 [msan] Transform memcpy and memset to library calls.
This was already done for memmove, where it is required for correctness.
This change improves performance by avoiding copyingthe same memory twice.
Also, the library functions are given __msan_ prefix to prevent instcombine
pass from converting them back to intrinsics.

llvm-svn: 168876
2012-11-29 12:49:04 +00:00
Elena Demikhovsky eace43bff7 I changed hasAVX() to hasFp256() and hasAVX2() to hasInt256() in X86IselLowering.cpp.
The logic was not changed, only names.

llvm-svn: 168875
2012-11-29 12:44:59 +00:00
Evgeniy Stepanov 4f9240d7e3 [msan] Update tests (broken in r168873).
llvm-svn: 168874
2012-11-29 12:43:56 +00:00
Evgeniy Stepanov 1d2da65bf8 [msan] Make sure that report callbacks do not get merged.
llvm-svn: 168873
2012-11-29 12:30:18 +00:00
Dmitri Gribenko 194d3685ec Documentation: use correct highlighter
llvm-svn: 168871
2012-11-29 12:00:32 +00:00
Evgeniy Stepanov d4bd7b73e3 Initial commit of MemorySanitizer.
Compiler pass only.

llvm-svn: 168866
2012-11-29 09:57:20 +00:00
Kostya Serebryany 4b929dae93 [asan/tsan] initialize the asan/tsan callbacks in runOnFunction as opposed to doInitialization. This is required to allow the upcoming changes in PassManager behavior
llvm-svn: 168864
2012-11-29 09:54:21 +00:00
Kostya Serebryany 633bf93fb8 [asan] when checking the noreturn attribute on the call, also check it on the callee
llvm-svn: 168861
2012-11-29 08:57:20 +00:00
Preston Briggs 4eb7ee566a Cleaned up a couple of comments.
llvm-svn: 168854
2012-11-29 04:30:52 +00:00
Jakob Stoklund Olesen bdb55e0c59 Use MCPhysReg for RegisterClassInfo allocation orders.
This saves a bit of memory.

llvm-svn: 168852
2012-11-29 03:34:17 +00:00
Jakob Stoklund Olesen 7afe1663e9 Add an MCPhysReg typedef to replace naked uint16_t.
Use this type for arrays of physical registers.

llvm-svn: 168850
2012-11-29 02:39:28 +00:00
Shuxin Yang 01ab5d718b Instruction::isAssociative() returns true for fmul/fadd if they are tagged "unsafe" mode.
Approved by: Eli and Michael.

llvm-svn: 168848
2012-11-29 01:47:31 +00:00
Jakob Stoklund Olesen 546e9e85f1 Avoid rewriting instructions twice.
This could cause miscompilations in targets where sub-register
composition is not always idempotent (ARM).

<rdar://problem/12758887>

llvm-svn: 168837
2012-11-29 00:26:11 +00:00
Nick Lewycky 1af94eb075 Issue a fatal error if the line doesn't have a regular expression.
Also a couple not-user-visible changes; using empty() instead of size(), and
make inSection() not insert NULL Regex*'s into StringMap when doing a lookup.

llvm-svn: 168833
2012-11-29 00:01:38 +00:00
Nadav Rotem 307d767177 When combining consecutive stores allow loads in between the stores, if the loads do not alias.
llvm-svn: 168832
2012-11-29 00:00:08 +00:00
Bill Wendling f3614fd8e2 When we delete a dead basic block, see if any of its successors are dead and
delete those as well.

llvm-svn: 168829
2012-11-28 23:23:48 +00:00
Dmitri Gribenko 5cb3f1097f Documentation: improve formatting and remove unneeded empty lines.
llvm-svn: 168817
2012-11-28 21:40:54 +00:00
Michael Ilseman 37018f8322 Whoops, fixed bad merge
llvm-svn: 168816
2012-11-28 21:21:18 +00:00
Michael Ilseman 1833e000a3 Fixed bad test case
llvm-svn: 168815
2012-11-28 21:19:52 +00:00
Michael Ilseman 018530268d Fast-math: IRBuilder test for creating instructions with fast-math flags
llvm-svn: 168814
2012-11-28 21:17:34 +00:00
Michael Ilseman be6871db58 Fast-math: Extend IRBuilder to have settable FastMathFlags to create instructions with
Also extended IRBuilder's documentation to mention the convenience state for DefaultFPMathTag and FastMathFlags that can be set.

llvm-svn: 168812
2012-11-28 21:16:19 +00:00
Michael Ilseman 8e5db2d07a Fast-math comments and convenience method
llvm-svn: 168811
2012-11-28 21:11:25 +00:00
Jyotsna Verma 519b3856dd Define signed const-ext immediate operands and their predicates.
llvm-svn: 168810
2012-11-28 20:58:14 +00:00
Benjamin Kramer b1996da782 ARM: Implement CanLowerReturn so large vectors get expanded into sret.
Fixes 14337.

llvm-svn: 168809
2012-11-28 20:55:10 +00:00
Jakob Stoklund Olesen 26c9d70d28 Make the LiveRegMatrix analysis available to targets.
No functional change, just moved header files.

Targets can inject custom passes between register allocation and
rewriting. This makes it possible to tweak the register allocation
before rewriting, using the full global interference checking available
from LiveRegMatrix.

llvm-svn: 168806
2012-11-28 19:13:06 +00:00
Eli Bendersky 10f22d7054 Add backreference matching capabilities to Support/Regex, with
appropriate unit tests. This change in itself is not expected to
affect any functionality at this point, but it will serve as a
stepping stone to improve FileCheck's variable matching capabilities.

Luckily, our regex implementation already supports backreferences,
although a bit of hacking is required to enable it. It supports both
Basic Regular Expressions (BREs) and Extended Regular Expressions
(EREs), without supporting backrefs for EREs, following POSIX strictly
in this respect. And EREs is what we actually use (rightly). This is
contrary to many implementations (including the default on Linux) of
POSIX regexes, that do allow backrefs in EREs.

Adding backref support to our EREs is a very simple change in the
regcomp parsing code. I fail to think of significant cases where it
would clash with existing things, and can bring more versatility to
the regexes we write. There's always the danger of a backref in a
specially crafted regex causing exponential matching times, but since
we mainly use them for testing purposes I don't think it's a big
problem. [it can also be placed behind a flag specific to FileCheck,
if needed].

For more details, see:

* http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/055840.html
* http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/156878.html

llvm-svn: 168802
2012-11-28 19:00:02 +00:00
Benjamin Kramer 2069bdaab3 MCJIT depends on JIT.
Unbreaks the CMake shared library build. This is nasty and should be fixed
eventually.

llvm-svn: 168800
2012-11-28 18:35:35 +00:00
Ulrich Weigand 9e159fd7a0 Fix initial frame state on powerpc64.
The createPPCMCAsmInfo routine used PPC::R1 as the initial frame
pointer register, but on PPC64 the 32-bit R1 register does not
have a corresponding DWARF number, causing invalid CIE initial
frame state to be emitted.  Fix by using PPC::X1 instead.

llvm-svn: 168799
2012-11-28 18:21:03 +00:00
Patrik Hägglund 504f4783ed Fix warning. [-Wunused-variable]
llvm-svn: 168792
2012-11-28 14:32:52 +00:00
Patrik Hägglund 3eb16c543e Add error handling in getInt.
Accordingly, update a testcase with a broken datalayout string.

Also, we never parse negative numbers, because '-' is used as a
separator. Therefore, use unsigned as result type.

llvm-svn: 168785
2012-11-28 12:13:12 +00:00
Kostya Serebryany dfe9e7933e [asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), LLVM part. This requires a clang part which will follow.
llvm-svn: 168781
2012-11-28 10:31:36 +00:00
Bill Wendling 706d3d66e9 Add back support for reading and parsing 'deplibs'.
This is for backwards compatibility for pre-3.x bc files. The code reads the
code, but does nothing with it.

llvm-svn: 168779
2012-11-28 08:41:48 +00:00
Andrew Trick 48d392e81e misched: Analysis that partitions the DAG into subtrees.
This is a simple, cheap infrastructure for analyzing the shape of a
DAG. It recognizes uniform DAGs that take the shape of bottom-up
subtrees, such as the included matrix multiplication example. This is
useful for heuristics that balance register pressure with ILP. Two
canonical expressions of the heuristic are implemented in scheduling
modes: -misched-ilpmin and -misched-ilpmax.

llvm-svn: 168773
2012-11-28 05:13:28 +00:00
Andrew Trick cd1c2f9fb1 misched: rename ScheduleDAGILP to ScheduleDFS to prepare for other heuristics.
llvm-svn: 168772
2012-11-28 05:13:24 +00:00
Andrew Trick 0be19363d1 misched: better alias analysis.
This fixes a hole in the "cheap" alias analysis logic implemented within
the DAG builder itself, regardless of whether proper alias analysis is
enabled. It now handles this pattern produced by LSR+CodeGenPrepare.

%sunkaddr1 = ptrtoint * %obj to i64
%sunkaddr2 = add i64 %sunkaddr1, %lsr.iv
%sunkaddr3 = inttoptr i64 %sunkaddr2 to i32*
store i32 %v, i32* %sunkaddr3

llvm-svn: 168768
2012-11-28 03:42:49 +00:00
Andrew Trick cf7e6971e8 misched: Debug output fix. Use an always valid iterator.
llvm-svn: 168767
2012-11-28 03:42:47 +00:00
Hal Finkel 88ee6b0082 BBVectorize: Correctly merge SubclassOptionalData
When two instructions are combined into a vector instruction,
the resulting instruction must have the most-conservative flags.

llvm-svn: 168765
2012-11-28 03:04:10 +00:00
Eric Christopher c3b434b76c Add brief support for the fission .debug_info.dwo section for
ELF output.

llvm-svn: 168764
2012-11-28 02:49:38 +00:00
Eric Christopher 27ed8ec126 Add comments.
llvm-svn: 168763
2012-11-28 02:49:34 +00:00
Eric Christopher 038e22ca3f Rearrange ordering of sections.
llvm-svn: 168762
2012-11-28 02:49:32 +00:00
Eric Christopher 4d33f67217 Move and comment accessor routines.
llvm-svn: 168761
2012-11-28 02:49:28 +00:00
Jakob Stoklund Olesen 9de596e650 Remove all references to TargetInstrInfoImpl.
This class has been merged into its super-class TargetInstrInfo.

llvm-svn: 168760
2012-11-28 02:35:17 +00:00
Jakob Stoklund Olesen c351aed4b1 Move the guts of TargetInstrInfoImpl into the TargetInstrInfo class.
The *Impl class no longer serves a purpose now that the super-class
implementation is in CodeGen.

llvm-svn: 168759
2012-11-28 02:35:13 +00:00
Jakob Stoklund Olesen fcf14e8436 Move Target{Instr,Register}Info.cpp into lib/CodeGen.
The Target library is not allowed to depend on the large CodeGen
library, but the TRI and TII classes provide abstract interfaces that
require both caller and callee to link to CodeGen.

The implementation files for these classes provide default
implementations of some of the hooks. These methods may need to
reference CodeGen, so they belong in that library.

We already have a number of methods implemented in the
TargetInstrInfoImpl sub-class because of that. I will merge that class
into the parent next.

llvm-svn: 168758
2012-11-28 02:35:09 +00:00
Andrew Kaylor 0a2d4e2dea Moving SectionMemoryManager to MCJIT to avoid cross dependency between JIT and RuntimeDyld
llvm-svn: 168755
2012-11-28 01:02:06 +00:00
Eli Bendersky 7875088078 Some grammar fixes
llvm-svn: 168752
2012-11-28 00:27:25 +00:00
Chad Rosier ed119d542b Revert r168630, r168631, and r168633 as these are causing nightly test failures.
llvm-svn: 168751
2012-11-28 00:21:29 +00:00
Daniel Dunbar 93a39dfdf3 lit: Bump the version to .3.
llvm-svn: 168750
2012-11-28 00:06:11 +00:00
Bill Schmidt e0a68a562b This patch makes medium code model the default for 64-bit PowerPC ELF.
When the CodeGenInfo is to be created for the PPC64 target machine,
a default code-model selection is converted to CodeModel::Medium
provided we are not targeting the Darwin OS.  Defaults for Darwin
are unaffected.

llvm-svn: 168747
2012-11-27 23:36:26 +00:00
NAKAMURA Takumi 5e74510398 docs: [CMake] Add Xcode to the list of project formats CMake can generate.
Suggested by Sean McBride, thanks!

llvm-svn: 168745
2012-11-27 23:34:28 +00:00
Andrew Kaylor 41fadd56b8 Fix comment formatting in RuntimeDyld.h
llvm-svn: 168739
2012-11-27 22:53:57 +00:00
Eric Christopher acdcbdb17d Attempt to make the comments for dwarf debug look more like
the coding standard would like.

llvm-svn: 168737
2012-11-27 22:43:45 +00:00
Eric Christopher 95198f5035 Reapply section moving, make sure string section is output last.
llvm-svn: 168736
2012-11-27 22:43:42 +00:00
Chad Rosier b4ac423ed4 [arm fast-isel] Appease the machine verifier by using the proper register
classes.  The vast majority of the remaining issues are due to uses of
invalid registers, which are defined by getRegForValue().  Those will be
a little more challenging to cleanup.
rdar://12719844

llvm-svn: 168735
2012-11-27 22:29:43 +00:00
Chad Rosier 0c00758065 [arm fast-isel] Appease the machine verifier by using the proper register
classes.
rdar://12719844

llvm-svn: 168733
2012-11-27 22:12:11 +00:00
Richard Smith 3430c25ccc Remove unused internal linkage variable.
llvm-svn: 168729
2012-11-27 21:51:36 +00:00
Chad Rosier 2ec7db0968 [arm fast-isel] Appease the machine verifier by using the proper register
classes.  Also a bit of cleanup.
rdar://12719844

llvm-svn: 168728
2012-11-27 21:46:46 +00:00
Chad Rosier 45c33c985c Add -verify-machineinstrs to these fast-isel test cases.
llvm-svn: 168723
2012-11-27 20:49:56 +00:00
Andrew Kaylor 58365b9cc9 Modifying lli to use the SectionMemoryManager.
The functionality of SectionMemoryManager is equivalent to the LLIMCJITMemoryManager being replaced except that it allocates memory as RW and later changes it to RX or R as needed.  The page permissions are set in the call to MCJIT::finalizeObject.

llvm-svn: 168722
2012-11-27 19:49:00 +00:00
Andrew Kaylor ab5ba51a6e Moving SectionMemoryManager into RuntimeDyld and adding unit tests for it.
The SectionMemoryManager now supports (and requires) applying section-specific page permissions.  Clients using this memory manager must call either MCJIT::finalizeObject() or SectionMemoryManager::applyPermissions() before executing JITed code.

See r168718 for changes from the previous implementation.

llvm-svn: 168721
2012-11-27 19:42:02 +00:00
Preston Briggs 5cb8cfae1e Modified depends() to recognize that when all levels are "=" and
there's no possible loo-independent dependence, then there's no
dependence.

Updated all test result appropriately.

llvm-svn: 168719
2012-11-27 19:12:26 +00:00
Andrew Kaylor 3e0f1fb7b2 Implementing page permission setting in MCJIT unit test SectionMemoryManager.cpp
This commit is primarily here for the revision history.  I'm about to move the SectionMemoryManager into the RuntimeDyld library, but I wanted to check the changes in here so people could see the differences in the updated implementation.

llvm-svn: 168718
2012-11-27 19:00:17 +00:00
Manman Ren f89406ac78 CSE: allow PerformTrivialCoalescing to check copies across basic block
boundaries.

Given the following case:
BB0
  %vreg1<def> = SUBrr %vreg0, %vreg7
  %vreg2<def> = COPY %vreg7
BB1
  %vreg10<def> = SUBrr %vreg0, %vreg2
We should be able to CSE between SUBrr in BB0 and SUBrr in BB1.

rdar://12462006

llvm-svn: 168717
2012-11-27 18:58:41 +00:00
Meador Inge f1bc9e7431 instcombine: Don't replace all uses for instructions with no uses
My commit to migrate the printf simplifiers from the simplify-libcalls
in r168604 introduced a regression reported by Duncan [1].  The problem
is that in some cases the library call simplifier can return a new value
that has no uses and the new value's type is different than the old value's
type (which is fine because there are no uses).  The specific case that
triggered the bug looked something like:

   declare void @printf(i8*, ...)
   ...
   call void (i8*, ...)* @printf(i8* %fmt)

Which we want to optimized into:

   call i32 @putchar(i32 104)

However, the code was attempting to replace all uses of the printf with
the putchar and the types differ, hence a crash.  This is fixed by *just*
deleting the original instruction when there are no uses.  The old
simplify-libcalls pass is already doing something similar.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/056338.html

llvm-svn: 168716
2012-11-27 18:52:49 +00:00
Jakub Staszak 38e2f52e85 Remove duplicated #includes.
llvm-svn: 168712
2012-11-27 18:27:14 +00:00
Benjamin Kramer e20e124280 SCEV: Even if the latch terminator is foldable we can't deduce the result of an unrelated condition with it.
Fixes PR14432.

llvm-svn: 168711
2012-11-27 18:16:32 +00:00
Manman Ren 5b4628201f X86: do not fold load instructions such as [V]MOVS[S|D] to other instructions
when the destination register is wider than the memory load.

These load instructions load from m32 or m64 and set the upper bits to zero,
while the folded instructions may accept m128.

rdar://12721174

llvm-svn: 168710
2012-11-27 18:09:26 +00:00
Pedro Artigas 0ee1b50949 Test commit only modifying comments
llvm-svn: 168709
2012-11-27 17:39:20 +00:00
Bill Schmidt 34627e3434 This patch implements medium code model support for 64-bit PowerPC.
The default for 64-bit PowerPC is small code model, in which TOC entries
must be addressable using a 16-bit offset from the TOC pointer.  Additionally,
only TOC entries are addressed via the TOC pointer.

With medium code model, TOC entries and data sections can all be addressed
via the TOC pointer using a 32-bit offset.  Cooperation with the linker
allows 16-bit offsets to be used when these are sufficient, reducing the
number of extra instructions that need to be executed.  Medium code model
also does not generate explicit TOC entries in ".section toc" for variables
that are wholly internal to the compilation unit.

Consider a load of an external 4-byte integer.  With small code model, the
compiler generates:

	ld 3, .LC1@toc(2)
	lwz 4, 0(3)

	.section	.toc,"aw",@progbits
.LC1:
	.tc ei[TC],ei

With medium model, it instead generates:

	addis 3, 2, .LC1@toc@ha
	ld 3, .LC1@toc@l(3)
	lwz 4, 0(3)

	.section	.toc,"aw",@progbits
.LC1:
	.tc ei[TC],ei

Here .LC1@toc@ha is a relocation requesting the upper 16 bits of the
32-bit offset of ei's TOC entry from the TOC base pointer.  Similarly,
.LC1@toc@l is a relocation requesting the lower 16 bits.  Note that if
the linker determines that ei's TOC entry is within a 16-bit offset of
the TOC base pointer, it will replace the "addis" with a "nop", and
replace the "ld" with the identical "ld" instruction from the small
code model example.

Consider next a load of a function-scope static integer.  For small code
model, the compiler generates:

	ld 3, .LC1@toc(2)
	lwz 4, 0(3)

	.section	.toc,"aw",@progbits
.LC1:
	.tc test_fn_static.si[TC],test_fn_static.si
	.type	test_fn_static.si,@object
	.local	test_fn_static.si
	.comm	test_fn_static.si,4,4

For medium code model, the compiler generates:

	addis 3, 2, test_fn_static.si@toc@ha
	addi 3, 3, test_fn_static.si@toc@l
	lwz 4, 0(3)

	.type	test_fn_static.si,@object
	.local	test_fn_static.si
	.comm	test_fn_static.si,4,4

Again, the linker may replace the "addis" with a "nop", calculating only
a 16-bit offset when this is sufficient.

Note that it would be more efficient for the compiler to generate:

	addis 3, 2, test_fn_static.si@toc@ha
        lwz 4, test_fn_static.si@toc@l(3)

The current patch does not perform this optimization yet.  This will be
addressed as a peephole optimization in a later patch.

For the moment, the default code model for 64-bit PowerPC will remain the
small code model.  We plan to eventually change the default to medium code
model, which matches current upstream GCC behavior.  Note that the different
code models are ABI-compatible, so code compiled with different models will
be linked and execute correctly.

I've tested the regression suite and the application/benchmark test suite in
two ways:  Once with the patch as submitted here, and once with additional
logic to force medium code model as the default.  The tests all compile
cleanly, with one exception.  The mandel-2 application test fails due to an
unrelated ABI compatibility with passing complex numbers.  It just so happens
that small code model was incredibly lucky, in that temporary values in 
floating-point registers held the expected values needed by the external
library routine that was called incorrectly.  My current thought is to correct
the ABI problems with _Complex before making medium code model the default,
to avoid introducing this "regression."

Here are a few comments on how the patch works, since the selection code
can be difficult to follow:

The existing logic for small code model defines three pseudo-instructions:
LDtoc for most uses, LDtocJTI for jump table addresses, and LDtocCPT for
constant pool addresses.  These are expanded by SelectCodeCommon().  The
pseudo-instruction approach doesn't work for medium code model, because
we need to generate two instructions when we match the same pattern.
Instead, new logic in PPCDAGToDAGISel::Select() intercepts the TOC_ENTRY
node for medium code model, and generates an ADDIStocHA followed by either
a LDtocL or an ADDItocL.  These new node types correspond naturally to
the sequences described above.

The addis/ld sequence is generated for the following cases:
 * Jump table addresses
 * Function addresses
 * External global variables
 * Tentative definitions of global variables (common linkage)

The addis/addi sequence is generated for the following cases:
 * Constant pool entries
 * File-scope static global variables
 * Function-scope static variables

Expanding to the two-instruction sequences at select time exposes the
instructions to subsequent optimization, particularly scheduling.

The rest of the processing occurs at assembly time, in
PPCAsmPrinter::EmitInstruction.  Each of the instructions is converted to
a "real" PowerPC instruction.  When a TOC entry needs to be created, this
is done here in the same manner as for the existing LDtoc, LDtocJTI, and
LDtocCPT pseudo-instructions (I factored out a new routine to handle this).

I had originally thought that if a TOC entry was needed for LDtocL or
ADDItocL, it would already have been generated for the previous ADDIStocHA.
However, at higher optimization levels, the ADDIStocHA may appear in a 
different block, which may be assembled textually following the block
containing the LDtocL or ADDItocL.  So it is necessary to include the
possibility of creating a new TOC entry for those two instructions.

Note that for LDtocL, we generate a new form of LD called LDrs.  This
allows specifying the @toc@l relocation for the offset field of the LD
instruction (i.e., the offset is replaced by a SymbolLo relocation).
When the peephole optimization described above is added, we will need
to do similar things for all immediate-form load and store operations.

The seven "mcm-n.ll" test cases are kept separate because otherwise the
intermingling of various TOC entries and so forth makes the tests fragile
and hard to understand.

The above assumes use of an external assembler.  For use of the
integrated assembler, new relocations are added and used by
PPCELFObjectWriter.  Testing is done with "mcm-obj.ll", which tests for
proper generation of the various relocations for the same sequences
tested with the external assembler.

llvm-svn: 168708
2012-11-27 17:35:46 +00:00
Ulrich Weigand e5f9405842 Never use .lcomm on platforms where it does not accept an alignment
argument.  Instead, use a pair of .local and .comm directives.

This avoids spurious differences between binaries built by the
integrated assembler vs. those built by the external assembler,
since the external assembler may impose alignment requirements
on .lcomm symbols where the integrated assembler does not.

llvm-svn: 168704
2012-11-27 16:11:16 +00:00
Meador Inge 4ae8b684f5 Move sprintf simplifier tests to test/Transforms/InstCombine
The tests from SPrintF.ll should have been migrated to sprintf-1.ll in
r168677, but I forgot to do it.

llvm-svn: 168702
2012-11-27 15:35:58 +00:00
Bill Wendling ee5984df39 Remove the dependent libraries feature.
The dependent libraries feature was never used and has bit-rotted. Remove it.

llvm-svn: 168694
2012-11-27 09:55:56 +00:00
NAKAMURA Takumi 96c39f733f llvm/test/Transforms/SimplifyLibCalls: FileCheck-ize 3 tests.
llvm-svn: 168691
2012-11-27 08:18:23 +00:00
NAKAMURA Takumi 62be55783d llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll: Handle @sprintf() with -instcombine, not -simplify-libcalls.
llvm-svn: 168690
2012-11-27 08:18:15 +00:00
NAKAMURA Takumi eb42eebee8 llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll: Fix datalayout since r168516.
llvm-svn: 168689
2012-11-27 08:18:08 +00:00
NAKAMURA Takumi fc2bdccfcd Trailing linefeeds.
llvm-svn: 168688
2012-11-27 08:17:58 +00:00
Craig Topper 32313da57c Revert accidental commit.
llvm-svn: 168687
2012-11-27 08:17:04 +00:00
Craig Topper b9773650ec Make PrintReg constructor explicit to prevent weird implicit conversions from accidentally being triggered.
llvm-svn: 168686
2012-11-27 08:14:24 +00:00
Craig Topper c04bc07ad5 Add ENABLE_CXX11 and ENABLE_WERROR to Makefile.llvm.rules for sample project. They were previously added to Makefile.llvm.config.in but the consumption was missing
llvm-svn: 168685
2012-11-27 08:12:24 +00:00
Dmitry Vyukov a878e74351 tsan: instrument atomic nand operation
llvm-svn: 168684
2012-11-27 08:09:25 +00:00
Craig Topper 7c0f9a6461 Add test cases for r168417.
llvm-svn: 168681
2012-11-27 07:19:54 +00:00
Eric Christopher 6e20a16829 Revert rearrangement of debug info sections to unblock the bots
and O0 + debug codegen.

llvm-svn: 168680
2012-11-27 06:49:23 +00:00
NAKAMURA Takumi 5f7c2d80d8 test/Transforms/SimplifyLibCalls/SPrintF.ll: Suppress this for now. r168677 unveiled another failure.
FYI, this test makes no sense with "not grep"... I saw "assertion failure" in stderr.

llvm-svn: 168679
2012-11-27 06:42:48 +00:00
Preston Briggs 1084fa2ef2 Modify depends(Src, Dst, PossiblyLoopIndependent).
If the Src and Dst are the same instruction,
no loop-independent dependence is possible,
so we force the PossiblyLoopIndependent flag to false.

The test case results are updated appropriately.

llvm-svn: 168678
2012-11-27 06:41:46 +00:00
Meador Inge 25c9b3b6e4 instcombine: Migrate sprintf optimizations
This patch migrates the sprintf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168677
2012-11-27 05:57:54 +00:00
Jakub Staszak 8262b885da Remove unneeded #include.
llvm-svn: 168670
2012-11-27 02:00:27 +00:00
Eric Christopher 710c374dfe The section is .debug_line.
llvm-svn: 168666
2012-11-27 01:40:36 +00:00
Andrew Kaylor c5feb5109e Make building of llvm-jitlistener conditional on the USE_INTEL_JITEVENTS setting.
llvm-svn: 168665
2012-11-27 01:24:25 +00:00
Jakub Staszak 508888e446 Remove unneeded #include.
llvm-svn: 168664
2012-11-27 01:22:15 +00:00
NAKAMURA Takumi 2e4a30709d llvm/CodeGen: Remove empty files in r168659.
llvm-svn: 168663
2012-11-27 01:21:50 +00:00
Joe Abbey ac997e963f Code pretification
llvm-svn: 168661
2012-11-27 01:20:22 +00:00
Jakub Staszak 08a28d248f Remove unused forward declaration.
llvm-svn: 168660
2012-11-27 01:16:37 +00:00
Jakub Staszak 0820b2a360 Remove unused MachineLoopRanges analysis.
llvm-svn: 168659
2012-11-27 01:14:34 +00:00
Chad Rosier 69fb6ddc6e Extend test case for r168657.
llvm-svn: 168658
2012-11-27 01:10:48 +00:00
Chad Rosier 2e82ad12a6 [arm fast-isel] Appease the machine verifier by using the proper register
classes.  The associated test case still doesn't pass, but it does have far
fewer issues.
rdar://12719844

llvm-svn: 168657
2012-11-27 01:06:49 +00:00
Michael Ilseman 6cdacff2d0 Fast-math test for SimplifyInstruction: fold multiply by 0
Applied the patch, rather than committing it.

llvm-svn: 168656
2012-11-27 01:00:22 +00:00
Owen Anderson 1db12f5135 Revert r168635 "Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model".
It appears to have broken at least one buildbot.

llvm-svn: 168654
2012-11-27 00:53:24 +00:00
Richard Smith 8ec03f5b54 Remove some Clang-specific ownership roles.
llvm-svn: 168653
2012-11-27 00:48:36 +00:00
Michael Ilseman f7512cfc25 Fast-math flags documentation added to LangRef
llvm-svn: 168652
2012-11-27 00:48:29 +00:00
NAKAMURA Takumi ec844dab8f llvm/test/CodeGen/X86/2012-07-15-broadcastfold.ll: Loosen expression corresponding to r168627. Win32 and *bsd were affected.
llvm-svn: 168651
2012-11-27 00:48:27 +00:00
Michael Ilseman 16db61238d Fast-math test for SimplifyInstruction: fold multiply by 0
llvm-svn: 168649
2012-11-27 00:47:20 +00:00
Michael Ilseman be9137a5c5 Fast-math optimization: fold multiply by zero
Added in first optimization using fast-math flags to serve as an example for following optimizations. SimplifyInstruction will now try to optimize an fmul observing its FastMathFlags to see if it can fold multiply by zero when 'nnan' and 'nsz' flags are set.

llvm-svn: 168648
2012-11-27 00:46:26 +00:00
Michael Ilseman c537743984 Fast-math test case for bitcode and textual reading/writing
llvm-svn: 168647
2012-11-27 00:45:08 +00:00
Michael Ilseman 9978d7e9e5 Fast-math flags for the bitcode
Added in bitcode enum for the serializing of fast-math flags. Added in the reading/writing of fast-math flags from the OptimizationFlags record for BinaryOps.

llvm-svn: 168646
2012-11-27 00:43:38 +00:00
Michael Ilseman 9205317bc3 Fast-math flags for LLVM IR parsing and printing
Added in the ability to read LLVM IR text that contains fast-math flags as a sequence of capital letters separated by spaces in any order. Added in the printing of the fast-math flags in a canonical order, and don't print the other flags when 'fast' is specified, as 'fast' implies all the others.

llvm-svn: 168645
2012-11-27 00:42:44 +00:00
Eric Christopher 69e328e5bd Make comment names match function names.
llvm-svn: 168644
2012-11-27 00:41:57 +00:00
Eric Christopher 4c9b119d64 Add in sections for the fission case (no change so incorrect) and
add a TODO for starting.

llvm-svn: 168643
2012-11-27 00:41:54 +00:00
Michael Ilseman 149209ec4c Fast-math interfaces for Instructions
Add in getter/setter methods for Instructions, allowing them to be the interface to FPMathOperator similarly to now NUS/NSW is handled.

llvm-svn: 168642
2012-11-27 00:41:22 +00:00
Michael Ilseman 8cba20502b Fast-math flags added to FPMathOperator.
Created FastMathFlags convenience struct for the getting and setting of fast-math flags en masse. Added SubclassOptionalData bitfields and corresponding getters/setters to FPMathOperator for the various fast-math flags.

llvm-svn: 168641
2012-11-27 00:40:00 +00:00
Richard Smith 92de14b86c Move Clang code owners list from llvm/ to cfe/.
llvm-svn: 168640
2012-11-27 00:39:52 +00:00
Eric Christopher c800b12bae Reorder section output ordering.
llvm-svn: 168638
2012-11-27 00:13:58 +00:00
Eric Christopher 735401cf29 Whitespace cleanup.
llvm-svn: 168637
2012-11-27 00:13:51 +00:00
Owen Anderson 336368c4fd Step towards implementation of pass manager with doInitialization and doFinalization per module detangled from runOn?? calls, still has temporary code not to break ASAN to be removed when that pass conforms to the proposed model
Patch by Pedro Artigas, with feedback from by Chandler Carruth.

llvm-svn: 168635
2012-11-26 23:54:47 +00:00
Chad Rosier 110b73e0e5 Add an assertion to ensure freezeReservedRegs() is only ever called once.
llvm-svn: 168633
2012-11-26 23:37:07 +00:00
Eli Bendersky e66c51d111 Make this test less sensitive.
It currently assumes register numbering and any harmless change in the X86
register naming makes it fail. It's enough to match the register names.

llvm-svn: 168632
2012-11-26 23:27:09 +00:00
Chad Rosier f8a3a62cdb Now that the X86 Maximal Stack Alignment Check pass has been removed (i.e.,
r168627), we no longer need to call the freezeReservedRegs() function a second
time.  Previously, this pass was conservatively adding the FP to the set of
reserved registers, requiring the second update to the reserved registers.
rdar://12719844

llvm-svn: 168631
2012-11-26 23:25:41 +00:00
Chad Rosier a44e1825a3 Now that the X86 Maximal Stack Alignment Check pass has been removed (i.e.,
r168627), we no longer need to call the freezeReservedRegs() function a second
time.  Previously, this pass was conservatively adding the FP to the set of
reserved registers, requiring the second update to the reserved registers.
rdar://12719844

llvm-svn: 168630
2012-11-26 23:14:37 +00:00
Eli Friedman b14873c4f1 Get rid of the getPointeeAlignment helper function from
InstCombineLoadStoreAlloca.cpp, which had many issues.
(At least two bugs were noted on llvm-commits, and it was overly conservative.)
Instead, use getOrEnforceKnownAlignment.

llvm-svn: 168629
2012-11-26 23:04:53 +00:00
Chad Rosier 4179e3f513 Remove the X86 Maximal Stack Alignment Check pass as it is no longer necessary.
This pass was conservative in that it always reserved the FP to enable dynamic
stack realignment, which allowed the RA to use aligned spills for vector
registers.  This happens even when spills were not necessary.  The RA has 
since been improved to use unaligned spills when necessary.

The new behavior is to realign the stack if the frame pointer was already
reserved for some other reason, but don't reserve the frame pointer just
because a function contains vector virtual registers.

Part of rdar://12719844

llvm-svn: 168627
2012-11-26 22:55:05 +00:00
Jakub Staszak f18753b8d0 Don't use iterator after being erased.
llvm-svn: 168622
2012-11-26 22:14:19 +00:00
Bill Wendling 8fd23aba48 Correct copy-pasto where we're talking about function attributes and not parameter attributes.
llvm-svn: 168619
2012-11-26 22:04:13 +00:00
Jyotsna Verma b5bb659d50 Fix comments in HexagonOperands.td.
llvm-svn: 168617
2012-11-26 21:56:51 +00:00
Shuxin Yang 6ea79e864d rdar://12329730 (defect 2)
Enhancement to InstCombine. Try to catch this opportunity:
  
 ---------------------------------------------------------------
 ((X^C1) >> C2) ^ C3  => (X>>C2) ^ ((C1>>C2)^C3)
  where the subexpression "X ^ C1" has more than one uses, and
  "(X^C1) >> C2" has single use. 
 ---------------------------------------------------------------- 

 Reviewed by Nadav (with minor change per his request).

llvm-svn: 168615
2012-11-26 21:44:25 +00:00
Jakub Staszak e25344225d Remove unneeded #includes.
llvm-svn: 168608
2012-11-26 21:04:19 +00:00
Meador Inge efe2393113 Fix a comment bug in toascii simplifier
When I migrated the toascii simplifier in r168580 Benjamin Kramer noticed
a bug in one of the comments that I migrated.

llvm-svn: 168605
2012-11-26 20:37:23 +00:00
Meador Inge 08ca115abd instcombine: Migrate printf optimizations
This patch migrates the printf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168604
2012-11-26 20:37:20 +00:00
Nadav Rotem caf5acfd14 Move the code that uses SCEVs prior to creating the new loops.
llvm-svn: 168601
2012-11-26 19:51:46 +00:00
Jakub Staszak a17f3f8c30 Normalize splat 256bit vectors with 8 elements.
llvm-svn: 168600
2012-11-26 19:24:31 +00:00
Benjamin Kramer ebf576d31d Decouple MCInstBuilder from the streamer per Eli's request.
llvm-svn: 168597
2012-11-26 18:05:52 +00:00
Matt Beaumont-Gay 000a3958e9 Remove stray trailing backslash
llvm-svn: 168592
2012-11-26 16:27:22 +00:00
Dmitry Vyukov 93e67b6c06 tsan: fix lint warnings
llvm-svn: 168590
2012-11-26 14:55:26 +00:00
Eli Bendersky eaf1a28594 Rewrite test to not use a FileCheck variable and redefine it on the same line.
In preparation for the FileCheck functionality change which will allow using
a variable later on the same line.

No functionality change.

llvm-svn: 168588
2012-11-26 14:09:46 +00:00
Benjamin Kramer 4e629f7964 Add MCInstBuilder, a utility class to simplify MCInst creation similar to MachineInstrBuilder.
Simplify some repetitive code with it. No functionality change.

llvm-svn: 168587
2012-11-26 13:34:22 +00:00
Dmitry Vyukov 12b5cb9a0a [tsan] add fail order to compare_exchange
llvm-svn: 168586
2012-11-26 11:36:19 +00:00
Zhou Sheng c1cf629e41 Fix a PassManager pointer use-after-free bug.
The bug can be triggered when we require LoopInfo analysis ahead of DominatorTree construction in a Module Pass. The cause is that the LoopInfo analysis itself also invokes DominatorTree construction, therefore, when PassManager schedules LoopInfo, it will add DominatorTree first. Then after that, when the PassManger turns to schedule DominatorTree invoked by the above ModulePass, it finds there is already a DominatorTree, so it delete the redundant one. However, somehow it still try to access that pass pointer after free as code pasted below, which results in segment fault.

llvm-svn: 168581
2012-11-26 05:45:53 +00:00
Meador Inge 604937d1cc instcombine: Migrate toascii optimizations
This patch migrates the toascii optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168580
2012-11-26 03:38:52 +00:00
Meador Inge a62a39e0e9 instcombine: Migrate isascii optimizations
This patch migrates the isascii optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168579
2012-11-26 03:10:07 +00:00
Meador Inge 9a59ab6133 instcombine: Migrate isdigit optimizations
This patch migrates the isdigit optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168578
2012-11-26 02:31:59 +00:00
Joe Abbey 15d9834df9 Removing SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
Adding CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG
       C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG

This is to handle the wackiness on a Mac host where cmake detects:

CMAKE_CXX_COMPILER == "/usr/bin/c++"
CMAKE_C_COMPILER == "/usr/bin/gcc"

llvm-svn: 168577
2012-11-26 02:02:08 +00:00
Rafael Espindola e42945c033 Fix gcc's -Wunused-but-set-variable warnings.
llvm-svn: 168576
2012-11-26 00:56:44 +00:00
Meador Inge 24d134c375 Fix bogus comment; no functional change.
llvm-svn: 168575
2012-11-26 00:25:33 +00:00
Meador Inge a0b6d87879 instcombine: Migrate *abs optimizations
This patch migrates the *abs optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168574
2012-11-26 00:24:07 +00:00
Meador Inge 7415f8403d instcombine: Migrate ffs* optimizations
This patch migrates the ffs* optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

llvm-svn: 168571
2012-11-25 20:45:27 +00:00
Nadav Rotem ee7ede76f4 Move the max vector width to a constant parameter. No functionality change.
llvm-svn: 168570
2012-11-25 16:48:08 +00:00
Nadav Rotem ef33b5076c Fix the document style.
llvm-svn: 168569
2012-11-25 16:39:01 +00:00
Nadav Rotem 12192f19eb Refactor the ptr runtime check generation code. No functionality change.
llvm-svn: 168568
2012-11-25 16:27:16 +00:00
Joe Abbey 2ad8df24ec Code Custodian:
- Widespread trailing space removal
  - A dash of OCD spacing to block align enums
  - joined a line that probably needed 80 cols a while back

llvm-svn: 168566
2012-11-25 15:23:39 +00:00
Rafael Espindola cdb9a538d6 Add support for .cfi_register now that it is easy to extent the representation
to support it. Original patch with the parsing and plumbing by the PaX team and
Roman Divacky. I added the bits in MCDwarf.cpp and the test.

llvm-svn: 168565
2012-11-25 15:14:49 +00:00
Benjamin Kramer 18907acb3f Move semantics are great, don't destroy the optimization opportunity with trivial copy ctors.
No functionality change.

llvm-svn: 168561
2012-11-25 11:52:03 +00:00
Nadav Rotem b15d9fe24d Rename method. No functionality change.
llvm-svn: 168560
2012-11-25 09:13:57 +00:00
Nadav Rotem bf5173460f The induction-pointer work is inspired by a research paper. This commit adds a reference.
llvm-svn: 168559
2012-11-25 09:09:26 +00:00
Nadav Rotem ea3824f160 Add support for pointer induction variables even when there is no integer induction variable.
llvm-svn: 168558
2012-11-25 08:41:35 +00:00
Craig Topper 79bd205d8c Refactor to make helper method static.
llvm-svn: 168557
2012-11-25 08:08:58 +00:00
Rafael Espindola fa4acf5704 Further cleanups. Thanks for Sean Silva for noticing it.
llvm-svn: 168556
2012-11-25 02:50:32 +00:00
Craig Topper 12cf860d4f Add an extra slash so doxygen comments will be properly recognized.
llvm-svn: 168554
2012-11-25 00:59:59 +00:00
Craig Topper 268b62288e Remove duplicate check of LimitFloatPrecision. It was already checked earlier before IsExp10 could be set to true.
llvm-svn: 168553
2012-11-25 00:48:58 +00:00
Craig Topper 8571944cf1 Factor common code out of individual if blocks into common tail.
llvm-svn: 168551
2012-11-25 00:15:07 +00:00