Eli Bendersky [Wed, 28 Nov 2012 19:00:02 +0000 (19:00 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168802
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 28 Nov 2012 18:35:35 +0000 (18:35 +0000)]
MCJIT depends on JIT.
Unbreaks the CMake shared library build. This is nasty and should be fixed
eventually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168800
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Wed, 28 Nov 2012 18:21:03 +0000 (18:21 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168799
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hägglund [Wed, 28 Nov 2012 14:32:52 +0000 (14:32 +0000)]
Fix warning. [-Wunused-variable]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168792
91177308-0d34-0410-b5e6-
96231b3b80d8
Patrik Hägglund [Wed, 28 Nov 2012 12:13:12 +0000 (12:13 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168785
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 28 Nov 2012 10:31:36 +0000 (10:31 +0000)]
[asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), LLVM part. This requires a clang part which will follow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168781
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 28 Nov 2012 08:41:48 +0000 (08:41 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168779
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 28 Nov 2012 05:13:28 +0000 (05:13 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168773
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 28 Nov 2012 05:13:24 +0000 (05:13 +0000)]
misched: rename ScheduleDAGILP to ScheduleDFS to prepare for other heuristics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168772
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 28 Nov 2012 03:42:49 +0000 (03:42 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168768
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 28 Nov 2012 03:42:47 +0000 (03:42 +0000)]
misched: Debug output fix. Use an always valid iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168767
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Wed, 28 Nov 2012 03:04:10 +0000 (03:04 +0000)]
BBVectorize: Correctly merge SubclassOptionalData
When two instructions are combined into a vector instruction,
the resulting instruction must have the most-conservative flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168765
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 28 Nov 2012 02:49:38 +0000 (02:49 +0000)]
Add brief support for the fission .debug_info.dwo section for
ELF output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168764
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 28 Nov 2012 02:49:34 +0000 (02:49 +0000)]
Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168763
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 28 Nov 2012 02:49:32 +0000 (02:49 +0000)]
Rearrange ordering of sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168762
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 28 Nov 2012 02:49:28 +0000 (02:49 +0000)]
Move and comment accessor routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168761
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 28 Nov 2012 02:35:17 +0000 (02:35 +0000)]
Remove all references to TargetInstrInfoImpl.
This class has been merged into its super-class TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168760
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 28 Nov 2012 02:35:13 +0000 (02:35 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168759
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 28 Nov 2012 02:35:09 +0000 (02:35 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168758
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Wed, 28 Nov 2012 01:02:06 +0000 (01:02 +0000)]
Moving SectionMemoryManager to MCJIT to avoid cross dependency between JIT and RuntimeDyld
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168755
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Wed, 28 Nov 2012 00:27:25 +0000 (00:27 +0000)]
Some grammar fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168752
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 28 Nov 2012 00:21:29 +0000 (00:21 +0000)]
Revert r168630, r168631, and r168633 as these are causing nightly test failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168751
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Wed, 28 Nov 2012 00:06:11 +0000 (00:06 +0000)]
lit: Bump the version to .3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168750
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Tue, 27 Nov 2012 23:36:26 +0000 (23:36 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168747
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 23:34:28 +0000 (23:34 +0000)]
docs: [CMake] Add Xcode to the list of project formats CMake can generate.
Suggested by Sean McBride, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168745
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Tue, 27 Nov 2012 22:53:57 +0000 (22:53 +0000)]
Fix comment formatting in RuntimeDyld.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168739
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 22:43:45 +0000 (22:43 +0000)]
Attempt to make the comments for dwarf debug look more like
the coding standard would like.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168737
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 22:43:42 +0000 (22:43 +0000)]
Reapply section moving, make sure string section is output last.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168736
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 27 Nov 2012 22:29:43 +0000 (22:29 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168735
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 27 Nov 2012 22:12:11 +0000 (22:12 +0000)]
[arm fast-isel] Appease the machine verifier by using the proper register
classes.
rdar://
12719844
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168733
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 27 Nov 2012 21:51:36 +0000 (21:51 +0000)]
Remove unused internal linkage variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168729
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 27 Nov 2012 21:46:46 +0000 (21:46 +0000)]
[arm fast-isel] Appease the machine verifier by using the proper register
classes. Also a bit of cleanup.
rdar://
12719844
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168728
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 27 Nov 2012 20:49:56 +0000 (20:49 +0000)]
Add -verify-machineinstrs to these fast-isel test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168723
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Tue, 27 Nov 2012 19:49:00 +0000 (19:49 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168722
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Tue, 27 Nov 2012 19:42:02 +0000 (19:42 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168721
91177308-0d34-0410-b5e6-
96231b3b80d8
Preston Briggs [Tue, 27 Nov 2012 19:12:26 +0000 (19:12 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168719
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Tue, 27 Nov 2012 19:00:17 +0000 (19:00 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168718
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 27 Nov 2012 18:58:41 +0000 (18:58 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168717
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Tue, 27 Nov 2012 18:52:49 +0000 (18:52 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168716
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Tue, 27 Nov 2012 18:27:14 +0000 (18:27 +0000)]
Remove duplicated #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168712
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 27 Nov 2012 18:16:32 +0000 (18:16 +0000)]
SCEV: Even if the latch terminator is foldable we can't deduce the result of an unrelated condition with it.
Fixes PR14432.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168711
91177308-0d34-0410-b5e6-
96231b3b80d8
Manman Ren [Tue, 27 Nov 2012 18:09:26 +0000 (18:09 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168710
91177308-0d34-0410-b5e6-
96231b3b80d8
Pedro Artigas [Tue, 27 Nov 2012 17:39:20 +0000 (17:39 +0000)]
Test commit only modifying comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168709
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Tue, 27 Nov 2012 17:35:46 +0000 (17:35 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168708
91177308-0d34-0410-b5e6-
96231b3b80d8
Ulrich Weigand [Tue, 27 Nov 2012 16:11:16 +0000 (16:11 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168704
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Tue, 27 Nov 2012 15:35:58 +0000 (15:35 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168702
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Tue, 27 Nov 2012 09:55:56 +0000 (09:55 +0000)]
Remove the dependent libraries feature.
The dependent libraries feature was never used and has bit-rotted. Remove it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168694
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 08:18:23 +0000 (08:18 +0000)]
llvm/test/Transforms/SimplifyLibCalls: FileCheck-ize 3 tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168691
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 08:18:15 +0000 (08:18 +0000)]
llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll: Handle @sprintf() with -instcombine, not -simplify-libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168690
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 08:18:08 +0000 (08:18 +0000)]
llvm/test/Transforms/SimplifyLibCalls/SPrintF.ll: Fix datalayout since r168516.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168689
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 08:17:58 +0000 (08:17 +0000)]
Trailing linefeeds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168688
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 Nov 2012 08:17:04 +0000 (08:17 +0000)]
Revert accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168687
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 Nov 2012 08:14:24 +0000 (08:14 +0000)]
Make PrintReg constructor explicit to prevent weird implicit conversions from accidentally being triggered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168686
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 Nov 2012 08:12:24 +0000 (08:12 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168685
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Vyukov [Tue, 27 Nov 2012 08:09:25 +0000 (08:09 +0000)]
tsan: instrument atomic nand operation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168684
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Tue, 27 Nov 2012 07:19:54 +0000 (07:19 +0000)]
Add test cases for r168417.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168681
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 06:49:23 +0000 (06:49 +0000)]
Revert rearrangement of debug info sections to unblock the bots
and O0 + debug codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168680
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 06:42:48 +0000 (06:42 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168679
91177308-0d34-0410-b5e6-
96231b3b80d8
Preston Briggs [Tue, 27 Nov 2012 06:41:46 +0000 (06:41 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168678
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Tue, 27 Nov 2012 05:57:54 +0000 (05:57 +0000)]
instcombine: Migrate sprintf optimizations
This patch migrates the sprintf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168677
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Tue, 27 Nov 2012 02:00:27 +0000 (02:00 +0000)]
Remove unneeded #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168670
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 01:40:36 +0000 (01:40 +0000)]
The section is .debug_line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168666
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Tue, 27 Nov 2012 01:24:25 +0000 (01:24 +0000)]
Make building of llvm-jitlistener conditional on the USE_INTEL_JITEVENTS setting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168665
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Tue, 27 Nov 2012 01:22:15 +0000 (01:22 +0000)]
Remove unneeded #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168664
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 01:21:50 +0000 (01:21 +0000)]
llvm/CodeGen: Remove empty files in r168659.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168663
91177308-0d34-0410-b5e6-
96231b3b80d8
Joe Abbey [Tue, 27 Nov 2012 01:20:22 +0000 (01:20 +0000)]
Code pretification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168661
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Tue, 27 Nov 2012 01:16:37 +0000 (01:16 +0000)]
Remove unused forward declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168660
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Tue, 27 Nov 2012 01:14:34 +0000 (01:14 +0000)]
Remove unused MachineLoopRanges analysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168659
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 27 Nov 2012 01:10:48 +0000 (01:10 +0000)]
Extend test case for r168657.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168658
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 27 Nov 2012 01:06:49 +0000 (01:06 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168657
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 01:00:22 +0000 (01:00 +0000)]
Fast-math test for SimplifyInstruction: fold multiply by 0
Applied the patch, rather than committing it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168656
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Tue, 27 Nov 2012 00:53:24 +0000 (00:53 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168654
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 27 Nov 2012 00:48:36 +0000 (00:48 +0000)]
Remove some Clang-specific ownership roles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168653
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:48:29 +0000 (00:48 +0000)]
Fast-math flags documentation added to LangRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168652
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Tue, 27 Nov 2012 00:48:27 +0000 (00:48 +0000)]
llvm/test/CodeGen/X86/2012-07-15-broadcastfold.ll: Loosen expression corresponding to r168627. Win32 and *bsd were affected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168651
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:47:20 +0000 (00:47 +0000)]
Fast-math test for SimplifyInstruction: fold multiply by 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168649
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:46:26 +0000 (00:46 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168648
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:45:08 +0000 (00:45 +0000)]
Fast-math test case for bitcode and textual reading/writing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168647
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:43:38 +0000 (00:43 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168646
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:42:44 +0000 (00:42 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168645
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 00:41:57 +0000 (00:41 +0000)]
Make comment names match function names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168644
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 00:41:54 +0000 (00:41 +0000)]
Add in sections for the fission case (no change so incorrect) and
add a TODO for starting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168643
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:41:22 +0000 (00:41 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168642
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Ilseman [Tue, 27 Nov 2012 00:40:00 +0000 (00:40 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168641
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 27 Nov 2012 00:39:52 +0000 (00:39 +0000)]
Move Clang code owners list from llvm/ to cfe/.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168640
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 00:13:58 +0000 (00:13 +0000)]
Reorder section output ordering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168638
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 27 Nov 2012 00:13:51 +0000 (00:13 +0000)]
Whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168637
91177308-0d34-0410-b5e6-
96231b3b80d8
Owen Anderson [Mon, 26 Nov 2012 23:54:47 +0000 (23:54 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168635
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 26 Nov 2012 23:37:07 +0000 (23:37 +0000)]
Add an assertion to ensure freezeReservedRegs() is only ever called once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168633
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Mon, 26 Nov 2012 23:27:09 +0000 (23:27 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168632
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 26 Nov 2012 23:25:41 +0000 (23:25 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168631
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 26 Nov 2012 23:14:37 +0000 (23:14 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168630
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Friedman [Mon, 26 Nov 2012 23:04:53 +0000 (23:04 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168629
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 26 Nov 2012 22:55:05 +0000 (22:55 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168627
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Mon, 26 Nov 2012 22:14:19 +0000 (22:14 +0000)]
Don't use iterator after being erased.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168622
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Mon, 26 Nov 2012 22:04:13 +0000 (22:04 +0000)]
Correct copy-pasto where we're talking about function attributes and not parameter attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168619
91177308-0d34-0410-b5e6-
96231b3b80d8
Jyotsna Verma [Mon, 26 Nov 2012 21:56:51 +0000 (21:56 +0000)]
Fix comments in HexagonOperands.td.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168617
91177308-0d34-0410-b5e6-
96231b3b80d8
Shuxin Yang [Mon, 26 Nov 2012 21:44:25 +0000 (21:44 +0000)]
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).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168615
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Mon, 26 Nov 2012 21:04:19 +0000 (21:04 +0000)]
Remove unneeded #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168608
91177308-0d34-0410-b5e6-
96231b3b80d8
Meador Inge [Mon, 26 Nov 2012 20:37:23 +0000 (20:37 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168605
91177308-0d34-0410-b5e6-
96231b3b80d8