Jingyue Wu [Sun, 16 Nov 2014 16:52:44 +0000 (16:52 +0000)]
[DependenceAnalysis] Allow subscripts of different types
Summary:
Several places in DependenceAnalysis assumes both SCEVs in a subscript pair
share the same integer type. For instance, isKnownPredicate calls
SE->getMinusSCEV(X, Y) which asserts X and Y share the same type. However,
DependenceAnalysis fails to ensure this assumption when producing a subscript
pair, causing tests such as NonCanonicalizedSubscript to crash. With this
patch, DependenceAnalysis runs unifySubscriptType before producing any
subscript pair, ensuring the assumption.
Test Plan:
Added NonCanonicalizedSubscript.ll on which DependenceAnalysis before the fix
crashed because subscripts have different types.
Reviewers: spop, sebpop, jingyue
Reviewed By: jingyue
Subscribers: eliben, meheff, llvm-commits
Differential Revision: http://reviews.llvm.org/D6289
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222100
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 16 Nov 2014 09:24:16 +0000 (09:24 +0000)]
[x86] Remove two redundant isel patterns. They equivalent already exists in the instruction pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222094
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 16 Nov 2014 07:30:35 +0000 (07:30 +0000)]
ScalarEvolution: HowFarToZero was wrongly using signed division
HowFarToZero was supposed to use unsigned division in order to calculate
the backedge taken count. However, SCEVDivision::divide performs signed
division. Unless I am mistaken, no users of SCEVDivision actually want
signed arithmetic: switch to udiv and urem.
This fixes PR21578.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222093
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sun, 16 Nov 2014 02:20:08 +0000 (02:20 +0000)]
InstSimplify: Optimize ICmpInst xform that uses computeKnownBits
A few things:
- computeKnownBits is relatively expensive, let's delay its use as long
as we can.
- Don't create two APInt values just to run computeKnownBits on a
ConstantInt, we already know the exact value!
- Avoid creating a temporary APInt value in order to calculate unary
negation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222092
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Sat, 15 Nov 2014 22:56:25 +0000 (22:56 +0000)]
[DAG] Improved target independent vector shuffle folding logic.
This patch teaches the DAGCombiner how to combine shuffles according to rules:
shuffle(shuffle(A, Undef, M0), B, M1) -> shuffle(B, A, M2)
shuffle(shuffle(A, B, M0), B, M1) -> shuffle(B, A, M2)
shuffle(shuffle(A, B, M0), A, M1) -> shuffle(B, A, M2)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222090
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 15 Nov 2014 21:13:05 +0000 (21:13 +0000)]
[X86][SSE] Improve legal SHUFP and PSHUFD shuffle matching
Updated X86TargetLowering::isShuffleMaskLegal to match SHUFP masks with commuted inputs and PSHUFD masks that reference the second input.
As part of this I've refactored isPSHUFDMask to work in a more general manner and allow it to match against either the first or second input vector.
Differential Revision: http://reviews.llvm.org/D6287
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222087
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 15 Nov 2014 10:53:12 +0000 (10:53 +0000)]
Dispose disassembler after use in unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222083
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Sat, 15 Nov 2014 07:45:31 +0000 (07:45 +0000)]
Provide missing definition of uppercase_CMAKE_BUILD_TYPE in HandleLLVMOptions module
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222082
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 15 Nov 2014 05:02:57 +0000 (05:02 +0000)]
R600: Permute operands when selecting legacy min/max
This gets the correct NaN behavior based on the compare type
the hardware uses. This now passes the new piglit test I have
for this on SI.
Add stricter tests for the operand order.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222079
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Sat, 15 Nov 2014 02:03:59 +0000 (02:03 +0000)]
yaml2obj, COFF: Consider the DOS stub when laying out section headers
While this program worked correctly with small example programs, larger
ones tickled this bug. I'm working on a reduction because my program is
quite large.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222078
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Sat, 15 Nov 2014 02:03:53 +0000 (02:03 +0000)]
Revert "Don't make assumptions about the name of private global variables."
This reverts commit r222061.
It's causing linker errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222077
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 15 Nov 2014 01:07:57 +0000 (01:07 +0000)]
R600: Fix 64-bit integer division
This fixes a failure in one of the oclconform tests.
Patch by: Jan Vesely
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222073
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 15 Nov 2014 01:07:53 +0000 (01:07 +0000)]
R600: Factor i64 UDIVREM lowering into its own fuction
This is so it could potentially be used by SI. However, the current
implementation does not always produce correct results, so the
IntegerDivisionPass is being used instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222072
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 15 Nov 2014 00:23:49 +0000 (00:23 +0000)]
DIBuilder: Use Constant instead of Value
Make explicit the requirement that most IR values in `DIBuilder` are
`Constant`. This requires a follow-up change in clang.
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222070
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Sat, 15 Nov 2014 00:05:04 +0000 (00:05 +0000)]
DIBuilder: Change private helper function to static, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222068
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 23:58:20 +0000 (23:58 +0000)]
IR: Remove MDString logic for Value::hasName()
This isn't necessary after r221960.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222067
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 23:55:52 +0000 (23:55 +0000)]
DIBuilder: Cleanup access control style, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222066
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 23:55:03 +0000 (23:55 +0000)]
DI: Use Metadata for DITypeRef and DIScopeRef
Now that `MDString` and `MDNode` have a common base class, use it. Note
that it's not useful to assume subclasses of `Metadata` must be one or
the other since we'll be adding more subclasses soon enough.
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222064
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 14 Nov 2014 23:31:07 +0000 (23:31 +0000)]
Rename EH related stuff to be more precise
Summary:
The current "WinEH" exception handling type is more about Itanium-style
LSDA tables layered on top of the Windows native unwind info format
instead of .eh_frame tables or EHABI unwind info. Use the name
"ItaniumWinEH" to better reflect the hybrid nature of the design.
Also rename isExceptionHandlingDWARF to usesItaniumLSDAForExceptions,
since the LSDA is part of the Itanium C++ ABI document, and not the
DWARF standard.
Reviewers: echristo
Subscribers: llvm-commits, compnerd
Differential Revision: http://reviews.llvm.org/D6279
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222062
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 14 Nov 2014 23:17:47 +0000 (23:17 +0000)]
Don't make assumptions about the name of private global variables.
Private variables are can be renamed, so it is not reliable to make
decisions on the name.
The name is also dropped by the assembler before getting to the
linker, so using the name causes a disconnect between how llvm makes a
decision (var name) and how the linker makes a decision (section it is
in).
This patch changes one case where we were looking at the variable name to use
the section instead.
Test tuning by Michael Gottesman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222061
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 14 Nov 2014 22:45:33 +0000 (22:45 +0000)]
ARM: refactor .cfi_def_cfa_offset emission.
We use to track quite a few "adjusted" offsets through the FrameLowering code
to account for changes in the prologue instructions as we went and allow the
emission of correct CFA annotations. However, we were missing a couple of cases
and the code was almost impenetrable.
It's easier to just add any stack-adjusting instruction to a list and emit them
together.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222057
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 14 Nov 2014 22:45:31 +0000 (22:45 +0000)]
ARM: correctly calculate the offset of FP in its push.
When we folded the DPR alignment gap into a push, we weren't noting the extra
distance from the beginning of the push to the FP, and so FP ended up pointing
at an incorrect offset.
The .cfi_def_cfa_offset directives are still wrong in this case, but I think
that can be improved by refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222056
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 14 Nov 2014 22:45:23 +0000 (22:45 +0000)]
ARM: simplify test.
The test's DWARF stubs were there just to trigger the emission of .cfi
directives. Fortunately, the NetBSD ABI already demands proper DWARF unwind
info, so it's easier to just use that triple.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222055
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Fri, 14 Nov 2014 22:10:16 +0000 (22:10 +0000)]
Rerun AutoRegen.sh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222050
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 14 Nov 2014 21:53:50 +0000 (21:53 +0000)]
Turn a leaked object into a stack variable instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222046
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Fri, 14 Nov 2014 21:52:18 +0000 (21:52 +0000)]
Add the code and test cases for 64-bit ARM to llvm-objdump’s Mach-O symbolizer.
FYI, removed the unused MCInstrAnalysis as it does not exist for 64-bit ARM and
was causing a “couldn't initialize disassembler for target” error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222045
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 14 Nov 2014 21:23:26 +0000 (21:23 +0000)]
Add a test for r222029 that doesn't rely on the default target being a COFF platform.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222041
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 14 Nov 2014 21:21:15 +0000 (21:21 +0000)]
InstCombine: Fix infinite loop caused by visitFPTrunc
We would attempt to replace a fptrunc of an frem with an identical
fptrunc. This would cause the new fptrunc to be added to the worklist.
Of course, this results in an infinite loop because we will keep
visiting the newly created fptruncs.
This fixes PR21576.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222040
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 14 Nov 2014 21:09:13 +0000 (21:09 +0000)]
Reapply r221924: "[GVN] Perform Scalar PRE on gep indices that feed loads before
doing Load PRE"
This commit updates the failing test in
Analysis/TypeBasedAliasAnalysis/gvn-nonlocal-type-mismatch.ll
The failing test is sensitive to the order in which we process loads. This
version turns on the RPO traversal instead of the while DT traversal in GVN.
The new test code is functionally same just the order of loads that are
eliminated is swapped.
This new version also fixes an issue where GVN splits a critical edge and
potentially invalidate the RPO/DT iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222039
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 14 Nov 2014 21:05:45 +0000 (21:05 +0000)]
Change order of tablegen generated fast-isel instruction code to be
based on instruction complexity
The order that tablegen fast-isel instruction code is generated is
currently based on the text of the predicate (using string
less-than). This patch changes this to instead use the instruction
complexity. Because the complexities are not unique a C++ multimap is
used instead of a map.
This fixes the problem where code with no predicate always comes out
first (the empty string always compares as less than all other
strings) thus making the code with predicates dead code. See the FMUL
code in PPCFastISel.cpp for an example. It also more closely matches
the normal codegen ordering. Some error checking in the tablegen
fast-isel code is fixed as well.
Patch by Bill Seurer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222038
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 14 Nov 2014 20:43:28 +0000 (20:43 +0000)]
R600/SI: Mark s_movk_i32 as rematerializable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222037
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 14 Nov 2014 20:43:26 +0000 (20:43 +0000)]
R600/SI: Fix spilling of m0 register
If we have spilled the value of the m0 register, then we need to restore
it with v_readlane_b32 to a regular sgpr, because v_readlane_b32 can't
write to m0.
v_readlane_b32 can't write to m0, so
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222036
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 14 Nov 2014 20:33:40 +0000 (20:33 +0000)]
COFF: Add support for Dwarf accelerator tables.
This allows COFF targets to emit accelerator tables
when requested by -dwarf-accel-tables=Enable instead
of aborting. The test DebugInfo/cross-cu-inlining.ll
covers this on COFF platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222034
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 14 Nov 2014 20:08:52 +0000 (20:08 +0000)]
R600/SI: Combine min3/max3 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222032
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 14 Nov 2014 19:35:59 +0000 (19:35 +0000)]
yaml2obj, COFF: Correctly calculate SizeOfImage and SizeOfHeaders
SizeOfHeaders must be aligned to the FileAlignment.
SizeOfImage must be at least the SizeOfHeaders aligned to the
SectionAlignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222030
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 14 Nov 2014 19:30:08 +0000 (19:30 +0000)]
[dwarfdump] Handle relocations in Dwarf accelerator tables
ELF targets (and maybe COFF) use relocations when referring
to strings in the .debug_str section. Handle that in the
accelerator table dumper. This commit restores the
test/DebugInfo/cross-cu-inlining.ll test to its expected
platform independant form, validating that the fix works
(this test failed on linux boxes).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222029
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 14 Nov 2014 19:06:36 +0000 (19:06 +0000)]
Remove redundant virtual on overriden functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222023
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:45:40 +0000 (18:45 +0000)]
IR: Make MDString inherit from Metadata
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222022
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 14 Nov 2014 18:43:41 +0000 (18:43 +0000)]
R600/SI: Fix verifier error from a branch on IMPLICIT_DEF
SIILowerI1Copies wasn't correctly handling this case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222020
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:42:09 +0000 (18:42 +0000)]
IR: Take an LLVMContext in Metadata::Metadata()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222019
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 18:42:06 +0000 (18:42 +0000)]
Add a blank line, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222018
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 14 Nov 2014 18:40:49 +0000 (18:40 +0000)]
Fix unused variable warning without asserts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222017
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 14 Nov 2014 18:30:06 +0000 (18:30 +0000)]
R600/SI: Match integer min / max instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222015
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 14 Nov 2014 18:18:16 +0000 (18:18 +0000)]
R600/SI: Use S_BFE_I64 for 64-bit sext_inreg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222012
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 14 Nov 2014 17:09:19 +0000 (17:09 +0000)]
[Reassociate] Canonicalize the operands of all binary operators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222008
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 14 Nov 2014 17:08:18 +0000 (17:08 +0000)]
Tentatively appease the bots.
If this workaround gets the bots green, then we have to find out
why the -dwarf-accel-tables=Enable option doesn't work as
expected on non-darwin platforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222007
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 14 Nov 2014 17:08:15 +0000 (17:08 +0000)]
[Reassociate] Canonicalize operands of vector binary operators.
Prior to this commit fmul and fadd binary operators were being canonicalized for
both scalar and vector versions. We now canonicalize add, mul, and, or, and xor
vector instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222006
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 14 Nov 2014 17:05:59 +0000 (17:05 +0000)]
[Reassociate] Canonicalize constants to RHS operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222005
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 14 Nov 2014 16:15:53 +0000 (16:15 +0000)]
Reapply "[dwarfdump] Add support for dumping accelerator tables."
This reverts commit r221842 which was a revert of r221836 and of the
test parts of r221837.
This new version fixes an UB bug pointed out by David (along with
addressing some other review comments), makes some dumping more
resilient to broken input data and forces the accelerator tables
to be dumped in the tests where we use them (this decision is
platform specific otherwise).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222003
91177308-0d34-0410-b5e6-
96231b3b80d8
Cameron McInally [Fri, 14 Nov 2014 15:43:00 +0000 (15:43 +0000)]
[AVX512] Add 512b masked integer shift by immediate patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222002
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Fri, 14 Nov 2014 15:01:38 +0000 (15:01 +0000)]
[Reassociate] Improve rank debug information. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221999
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 14 Nov 2014 14:08:04 +0000 (14:08 +0000)]
R600/SI: Fix assembly names for exec_hi and exec_lo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221995
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 14 Nov 2014 14:08:00 +0000 (14:08 +0000)]
R600/SI: Start implementing an assembler
This was done using the Sparc and PowerPC AsmParsers as guides. So far it
is very simple and only supports sopp instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221994
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 14 Nov 2014 12:10:40 +0000 (12:10 +0000)]
[PowerPC] Add VSX builtins for vec_div
This patch adds builtin support for xvdivdp and xvdivsp, along with a
test case. Straightforward stuff.
There's a companion patch for Clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221983
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 14 Nov 2014 08:38:17 +0000 (08:38 +0000)]
Calm down build bots
r221975 seemed to trigger an ambiguous conversion that only irritated
clang, not gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221977
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 14 Nov 2014 08:15:42 +0000 (08:15 +0000)]
obj2yaml, yaml2obj: Add support for COFF executables
In support of serializing executables, obj2yaml now records the virtual address
and size of sections. It also serializes whatever we strictly need from
the PE header, it expects that it can reconstitute everything else via
inference.
yaml2obj can reconstitute a fully linked executable.
In order to get executables correctly serialized/deserialized, other
bugs were fixed as a circumstance. We now properly respect file and
section alignments. We also avoid writing out string tables unless they
are strictly necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221975
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 14 Nov 2014 07:02:38 +0000 (07:02 +0000)]
Use size_type for operator[].
This matches std::vector and is more efficient as it avoids
truncations.
With this the text segment of opt goes from
19705442 bytes
to
19703930 bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221973
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Fri, 14 Nov 2014 04:53:55 +0000 (04:53 +0000)]
SearchForAddressOfSymbol(): Disable 3 symbols, copysignf, fminf, and fmaxf, on msc17. *These were added in VS 2013*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221971
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 14 Nov 2014 02:21:58 +0000 (02:21 +0000)]
R600/SI: Make constant array static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221965
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Fri, 14 Nov 2014 01:50:32 +0000 (01:50 +0000)]
llvm-cov: Sink some reporting logic into CoverageMapping
This teaches CoverageMapping::getCoveredFunctions to filter to a
particular file and uses that to replace most of the logic found in
llvm-cov report.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221962
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 14 Nov 2014 01:30:14 +0000 (01:30 +0000)]
X86: use getConstant rather than getTargetConstant behind BUILD_VECTOR.
getTargetConstant should only be used when you can guarantee the instruction
selected will be able to cope with the raw value. BUILD_VECTOR is rather too
generic for this so we should use getConstant instead. In that case, an
instruction can still consume the constant, but if it doesn't it'll be
materialised through its own round of ISel.
Should fix PR21352.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221961
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 14 Nov 2014 01:17:09 +0000 (01:17 +0000)]
IR: Rewrite uniquing and creation of MDString
Stop using `Value::getName()` to get the string behind an `MDString`.
Switch to `StringMapEntry<MDString>` so that we can find the string by
its coallocation.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221960
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 14 Nov 2014 00:41:46 +0000 (00:41 +0000)]
StringMap: Test and finish off supporting perfectly forwarded values in StringMap operations.
Followup to r221946.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221958
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 14 Nov 2014 00:41:42 +0000 (00:41 +0000)]
Fix 80 cols caught by the linter...
We have a linter running in our build now?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221957
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 14 Nov 2014 00:39:33 +0000 (00:39 +0000)]
Fix build of Mips code with MSVC by using our macro instead of __attribute__((unused)) directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221956
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 14 Nov 2014 00:35:50 +0000 (00:35 +0000)]
Allow the use of functions as typeinfo in landingpad clauses
This is one step towards supporting SEH filter functions in LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221954
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 14 Nov 2014 00:34:59 +0000 (00:34 +0000)]
CodeGen: assert an instruction is being inserted with the correct iterator.
When "MBB->Insert(It, ...)" is called, we want It to be pointing inside the
correct basic block. No actual failures at the moment, but it's caused problems
before.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221953
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 13 Nov 2014 23:59:16 +0000 (23:59 +0000)]
IR: Make MDString::getName() private
Hide the fact that `MDString`'s string is stored in `Value::Name` --
that's going to change soon. Update the only in-tree client that was
using it instead of `Value::getString()`.
Part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221951
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 13 Nov 2014 23:45:50 +0000 (23:45 +0000)]
Fix the VS 2012 build
VS 2012 doesn't have fminf or fmaxf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221949
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Thu, 13 Nov 2014 23:37:45 +0000 (23:37 +0000)]
First stage of call lowering for Mips fast-isel
Summary:
This has most of what is needed for mips fast-isel call lowering for O32.
What is missing I will add on the next patch because this patch is already too large.
It should not be doing anything wrong but it will punt on some cases that it is basically
capable of doing.
The mechanism is there for parameters to be passed on the stack but I have not enabled it because it serves as a way for now to prevent some of the strange cases of O32 register passing that I have not fully checked yet and have some issues.
The Mips O32 abi rules are very complicated as far how data is passed in floating and integer registers.
However there is a way to think about this all very simply and this implementation reflects that.
Basically, the ABI rules are written as if everything is passed on the stack and aligned as such.
Once that is conceptually done, it is nearly trivial to reassign those locations to registers and
then all the complexity disappears.
So I have told tablegen that all the data is passed on the stack and during the lowering I fix
this by assigning to registers as per the ABI doc.
This has been my approach and you can line up what I did with the ABI document and see 1 to 1 what
is going on.
Test Plan: callabi.ll
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: jholewinski, echristo, ahatanak, llvm-commits, rfuhler
Differential Revision: http://reviews.llvm.org/D5714
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221948
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 13 Nov 2014 23:32:52 +0000 (23:32 +0000)]
Fix symbol resolution of floating point libc builtins in MCJIT
Fix for LLI failure on Windows\X86: http://llvm.org/PR5053
LLI.exe crashes on Windows\X86 when single precession floating point
intrinsics like the following are used: acos, asin, atan, atan2, ceil,
copysign, cos, cosh, exp, floor, fmin, fmax, fmod, log, pow, sin, sinh,
sqrt, tan, tanh
The above intrinsics are defined as inline-expansions in math.h, and are
not exported by msvcr120.dll (Win32 API GetProcAddress returns null).
For an FREM instruction, the JIT compiler generates a call to a stub for
the fmodf() intrinsic, and adds a relocation to fixup at load time. The
loader searches the libraries for the function, but fails because the
symbol is not exported. So, the call target remains NULL and the
execution crashes.
Since the math functions are loaded at JIT/runtime, the JIT can patch
CALL instruction directly instead of the searching the libraries'
exported symbols. However, this fix caused build failures due to
unresolved symbols like _fmodf at link time.
Therefore, the current fix defines helper functions in the Runtime
link/load library to perform the above operations. The address of these
helper functions are used to patch up the CALL instruction at load time.
Reviewers: lhames, rnk
Reviewed By: rnk
Differential Revision: http://reviews.llvm.org/D5387
Patch by Swaroop Sridhar!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221947
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 13 Nov 2014 23:23:02 +0000 (23:23 +0000)]
ADT: Use perfect forwarding in StringMapEntry::Create()
Now you can pass references into constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221946
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 13 Nov 2014 23:07:55 +0000 (23:07 +0000)]
Relax the gcov version.ll test to check '.' instead of '\*'
The escaping of the '\*' doesn't work with my combination of testing
tools.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221944
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 13 Nov 2014 23:07:22 +0000 (23:07 +0000)]
Silence MSVC warning on missing return after fully covered switch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221943
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 23:03:09 +0000 (23:03 +0000)]
R600/SI: Fix fmin_legacy / fmax_legacy matching for SI
select_cc is expanded on SI, so this was never matched.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221941
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 13 Nov 2014 22:55:19 +0000 (22:55 +0000)]
Use nullptr instead of NULL for variadic sentinels
Windows defines NULL to 0, which when used as an argument to a variadic
function, is not a null pointer constant. As a result, Clang's
-Wsentinel fires on this code. Using '0' would be wrong on most 64-bit
platforms, but both MSVC and Clang make it work on Windows. Sidestep the
issue with nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221940
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 13 Nov 2014 22:54:59 +0000 (22:54 +0000)]
Revert "[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE."
This reverts commit r221924. It appears the commit was a bit premature and is causing
bot failures that need further investigation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221939
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 13 Nov 2014 22:49:44 +0000 (22:49 +0000)]
[x86] Add some tests for specific patterns of lane-flips combined with
in-lane shuffles that aren't always handled well by the current vector
shuffle lowering.
No functionality change yet, that will follow in a subsequent commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221938
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 13 Nov 2014 22:29:02 +0000 (22:29 +0000)]
Move calls to push_back out of readAbbreviated(Literal|Field).
These functions always return a single value and not all callers want to
push them into a SmallVector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221934
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 13 Nov 2014 22:09:56 +0000 (22:09 +0000)]
Avoid usage of char16_t as MSVC "14" doesn't appear to support it
Fixes the MSVC "14" build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221932
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 13 Nov 2014 21:56:57 +0000 (21:56 +0000)]
Fix nested namespace with decltype to hopefully work with MSVC
Build failed here:
http://lab.llvm.org:8011/builders/lld-x86_64-win7/builds/14629/steps/build_Lld/logs/stdio
So I'm taking a shot in the dark that MSVC (whatever version that is)
can't cope with nested name specifiers with a decltype prefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221931
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 13 Nov 2014 21:54:59 +0000 (21:54 +0000)]
Make a few helper functions static. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221930
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 13 Nov 2014 21:40:02 +0000 (21:40 +0000)]
Use unique_ptr to handle ownership of TreePatterns in CodeGenDAGPatterns::PatternFragments
We might be able to use unique_ptr to handle ownership of the
TreePatternNodes too - looking into that next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221928
91177308-0d34-0410-b5e6-
96231b3b80d8
Aditya Nandakumar [Thu, 13 Nov 2014 21:29:21 +0000 (21:29 +0000)]
We can get the TLOF from the TargetMachine - so constructor no longer requires TargetLoweringObjectFile to be passed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221926
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 13 Nov 2014 21:17:58 +0000 (21:17 +0000)]
[GVN] Perform Scalar PRE on gep indices that feed loads before doing Load PRE.
Phabricator Revision: http://reviews.llvm.org/D6103
Patch by "Balaram Makam" <bmakam@codeaurora.org>!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221924
91177308-0d34-0410-b5e6-
96231b3b80d8
Juergen Ributzka [Thu, 13 Nov 2014 20:50:44 +0000 (20:50 +0000)]
[FastISel][AArch64] Don't bail during simple GEP instruction selection.
The generic FastISel code would bail, because it can't emit a sign-extend for
AArch64. This copies the code over and uses AArch64 specific emit functions.
This is not ideal and 'computeAddress' should handles this, so it can fold the
address computation into the memory operation.
I plan to clean up 'computeAddress' anyways, so I will add that in a future
commit.
Related to rdar://problem/
18962471.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221923
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 20:44:23 +0000 (20:44 +0000)]
R600/SI: Use s_movk_i32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221922
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 20:23:36 +0000 (20:23 +0000)]
R600/SI: Fix definition for s_cselect_b32
These were directly using the old base instruction
class, and specifying the wrong register classes
for operands. The operands can be the other special
inputs besides SGPRs. The op name was also being
directly used for the asm string, so this was printed
without any operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221921
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 20:07:40 +0000 (20:07 +0000)]
R600: Fix assert on empty function
If a function is just an unreachable, this would hit a
"this is not a MachO target" assertion because of setting
HasSubsectionViaSymbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221920
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Thu, 13 Nov 2014 20:07:06 +0000 (20:07 +0000)]
Un-break the big-endian buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221919
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 19:56:13 +0000 (19:56 +0000)]
R600: Error on initializer for LDS.
Also give a proper error for other address spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221917
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 19:49:04 +0000 (19:49 +0000)]
R600/SI: Get rid of FCLAMP_SI pseudo
It's not necessary. Also use complex patterns to allow
src modifier usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221916
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 13 Nov 2014 19:48:56 +0000 (19:48 +0000)]
Object, Mach-O: Refactor and clean code up
Don't assert if we can return an error code, reuse existing
functionality like is64Bit().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221915
91177308-0d34-0410-b5e6-
96231b3b80d8
Roman Divacky [Thu, 13 Nov 2014 19:45:27 +0000 (19:45 +0000)]
Use -Wcast-qual in cmake builds, not only autoconfo ones.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221913
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 19:26:50 +0000 (19:26 +0000)]
R600/SI: Allow commuting with src2_modifiers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221911
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 13 Nov 2014 19:26:47 +0000 (19:26 +0000)]
R600/SI: Allow commuting some 3 op instructions
e.g. v_mad_f32 a, b, c -> v_mad_f32 b, a, c
This simplifies matching v_madmk_f32.
This looks somewhat surprising, but it appears to be
OK to do this. We can commute src0 and src1 in all
of these instructions, and that's all that appears
to matter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221910
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 13 Nov 2014 18:44:53 +0000 (18:44 +0000)]
Return word_t from read.
This removes the need for a special Read64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221909
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 13 Nov 2014 17:58:53 +0000 (17:58 +0000)]
ARM: allow constpool entry to be moved to the user's block in all cases.
Normally entries can only move to a lower address, but when that wasn't viable,
the user's block was considered anyway. Unfortunately, it went via
createNewWater which wasn't designed to handle the case where there's already
an island after the block.
Unfortunately, the test we have is slow and fragile, and I couldn't reduce it
to anything sane even with the @llvm.arm.space intrinsic. The test change here
is recreating the previous one after the change.
rdar://problem/
18545506
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221905
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 13 Nov 2014 17:58:51 +0000 (17:58 +0000)]
ARM: avoid duplicating branches during constant islands.
We were using a naive heuristic to determine whether a basic block already had
an unconditional branch at the end. This mostly corresponded to reality
(assuming branches got optimised) because there's not much point in a branch to
the next block, but could go wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221904
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Thu, 13 Nov 2014 17:58:48 +0000 (17:58 +0000)]
ARM: add @llvm.arm.space intrinsic for testing ConstantIslands.
Creating tests for the ConstantIslands pass is very difficult, since it depends
on precise layout details. Having the ability to precisely inject a number of
bytes into the stream helps greatly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221903
91177308-0d34-0410-b5e6-
96231b3b80d8