David Greene
bab5e6ed0e
[AVX] Add INSERT_SUBVECTOR and support it on x86. This provides a
...
default implementation for x86, going through the stack in a similr
fashion to how the codegen implements BUILD_VECTOR. Eventually this
will get matched to VINSERTF128 if AVX is available.
llvm-svn: 124307
2011-01-26 19:13:22 +00:00
Devang Patel
a11210b1b8
While legalizing SDValues do not drop SDDbgValues, trasfer them to new legal nodes.
...
llvm-svn: 124302
2011-01-26 18:55:05 +00:00
Devang Patel
9d4eb2f480
Process valid SDDbgValues even if the node does not have any order assigned.
...
llvm-svn: 124301
2011-01-26 18:42:32 +00:00
Devang Patel
1448e7c8b6
Refactor.
...
llvm-svn: 124300
2011-01-26 18:20:04 +00:00
David Greene
b6f1611928
[AVX] Support EXTRACT_SUBVECTOR on x86. This provides a default
...
implementation of EXTRACT_SUBVECTOR for x86, going through the stack
in a similr fashion to how the codegen implements BUILD_VECTOR.
Eventually this will get matched to VEXTRACTF128 if AVX is available.
llvm-svn: 124292
2011-01-26 15:38:49 +00:00
Bruno Cardoso Lopes
ce0af9c961
Add encoding testcases for ARM vcvtr variations
...
llvm-svn: 124289
2011-01-26 13:53:38 +00:00
Bruno Cardoso Lopes
178c1e0c9b
fix the encoding and add testcases for ARM nop, yield, wfe and wfi instructions
...
llvm-svn: 124288
2011-01-26 13:28:14 +00:00
Duncan Sands
69bdb585b2
Fix PR9039, a use-after-free in reassociate. The issue was that the
...
operand being factorized (and erased) could occur several times in Ops,
resulting in freed memory being used when the next occurrence in Ops was
analyzed.
llvm-svn: 124287
2011-01-26 10:08:38 +00:00
Nick Lewycky
91543447a6
AttrListPtr has an overloaded operator== which does this for us, we should use
...
it. No functionality change!
llvm-svn: 124286
2011-01-26 09:23:19 +00:00
Nick Lewycky
82d4db8662
Teach mergefunc that intptr_t is the same width as a pointer. We still can't
...
merge vector<intptr_t>::push_back() and vector<void*>::push_back() because
Enumerate() doesn't realize that "i64* null" and "i8** null" are equivalent.
llvm-svn: 124285
2011-01-26 09:13:58 +00:00
Nick Lewycky
fb622f9920
There are no vectors of pointer or arrays, so we don't need to check vector
...
elements for type equivalence.
llvm-svn: 124284
2011-01-26 08:50:18 +00:00
Duncan Sands
8a33733228
APInt has a method for determining whether a number is a power of 2
...
which is more efficient than countPopulation - use it.
llvm-svn: 124283
2011-01-26 08:44:16 +00:00
Nick Lewycky
d9e6b4a8ff
Fix memory corruption. If one of the SCEV creation functions calls another but
...
doesn't return immediately after then the insert position in UniqueSCEVs will
be out of date. No test because this is a memory corruption issue. Fixes PR9051!
llvm-svn: 124282
2011-01-26 08:40:22 +00:00
Eric Christopher
078159e310
Separate out the constant bonus from the size reduction metrics. Rework
...
a few loops accordingly. Should be no functional change.
This is a step for more accurate cost/benefit analysis of devirt/inlining
bonuses.
llvm-svn: 124275
2011-01-26 02:58:39 +00:00
Bill Wendling
d13d13496f
Add needed braces.
...
llvm-svn: 124273
2011-01-26 02:06:22 +00:00
NAKAMURA Takumi
0cfdac078e
Target/X86: Tweak win64's tailcall.
...
llvm-svn: 124272
2011-01-26 02:04:09 +00:00
NAKAMURA Takumi
31aafbd501
TableGen: PointerLikeRegClass can be accepted to operand.
...
llvm-svn: 124271
2011-01-26 02:03:48 +00:00
NAKAMURA Takumi
9d29eff198
Fix whitespace.
...
llvm-svn: 124270
2011-01-26 02:03:37 +00:00
NAKAMURA Takumi
c780782560
lib/Target/X86/X86RegisterInfo.cpp: Fix whitespace.
...
llvm-svn: 124268
2011-01-26 01:28:06 +00:00
NAKAMURA Takumi
86278dc3ea
lib/Target/X86/X86RegisterInfo.cpp: Fix a typo in comment.
...
llvm-svn: 124267
2011-01-26 01:27:58 +00:00
Eric Christopher
58f157a677
Coding style formatting changes.
...
llvm-svn: 124260
2011-01-26 01:09:59 +00:00
Jakob Stoklund Olesen
b308902024
Rename member variables to follow the rest of LLVM.
...
No functional change.
llvm-svn: 124257
2011-01-26 00:50:53 +00:00
Devang Patel
efc6b16e4b
Provide an interface to transfer SDDbgValue from one SDNode to another.
...
llvm-svn: 124245
2011-01-25 23:27:42 +00:00
David Greene
78221d4679
[AVX] Fix a typo in the extract subvector type constraints to specify
...
the correct number of operands.
llvm-svn: 124234
2011-01-25 22:05:41 +00:00
Bill Wendling
57990c4910
Revert 124230. It was causing test failures.
...
llvm-svn: 124233
2011-01-25 21:48:36 +00:00
Bill Wendling
624cef696d
The floating point value is encoded in its binary form as an Imm. Convert it
...
appropriately so that it prints out the decimal representation.
llvm-svn: 124230
2011-01-25 21:27:46 +00:00
Bill Wendling
cdbf17b179
Add support for parsing a Real value. It stores the Real value as its binary
...
encoding. It's up to the individual back-ends to convert it to their preferred
representation when printing.
llvm-svn: 124229
2011-01-25 21:26:41 +00:00
Rafael Espindola
563eb4bb6c
Move unnamed_addr after the function arguments on Sabre's request.
...
llvm-svn: 124209
2011-01-25 19:09:56 +00:00
Devang Patel
70f8e5962a
Resolve DanglingDbgValue of PHI nodes where the use follows dbg.value intrinisic.
...
llvm-svn: 124203
2011-01-25 18:09:58 +00:00
Devang Patel
04b649d48a
This assertion is too restrictive, it does not apply for dangling dbg value nodes (nodes where dbg.value intrinsic preceds use of the value).
...
llvm-svn: 124202
2011-01-25 18:09:33 +00:00
David Greene
672a4a297e
[AVX] Add TableGen classes for vector/subvector type constraints.
...
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode and will also be used to check
EXTRACT_SUBVECTOR nodes.
llvm-svn: 124191
2011-01-25 16:16:32 +00:00
Duncan Sands
9e9d5b25e2
In which I discover that zero+zero is zero, d'oh!
...
llvm-svn: 124188
2011-01-25 15:14:15 +00:00
Jay Foad
0c125f9f02
Avoid compiler errors when this header file is included first, by adding
...
a forward declaration of simplify_type<>.
llvm-svn: 124187
2011-01-25 14:33:33 +00:00
Duncan Sands
c78548d791
Turn off this test - the corresponding instsimplify logic has been
...
disabled.
llvm-svn: 124185
2011-01-25 12:31:43 +00:00
Duncan Sands
fced7620f5
See if this fixes llvm-gcc bootstrap.
...
llvm-svn: 124184
2011-01-25 12:15:09 +00:00
Duncan Sands
d395108394
According to my auto-simplifier the most common missed simplifications in
...
optimized code are:
(non-negative number)+(power-of-two) != 0 -> true
and
(x | 1) != 0 -> true
Instcombine knows about the second one of course, but only does it if X|1
has only one use. These fire thousands of times in the testsuite.
llvm-svn: 124183
2011-01-25 09:38:29 +00:00
Nick Lewycky
f1cec164ce
Teach mergefunc how to emit aliases safely again -- but keep it turned it off
...
for now. It's controlled by the HasGlobalAliases variable which is not attached
to any flag yet.
llvm-svn: 124182
2011-01-25 08:56:50 +00:00
Eric Christopher
cd087f2512
Reorganize this so that the early exit and special cases come early
...
rather than interspersed. No functional change.
llvm-svn: 124168
2011-01-25 01:34:31 +00:00
Evan Cheng
d6093ff4cb
Don't merge restore with tail call instruction.
...
llvm-svn: 124167
2011-01-25 01:28:33 +00:00
Daniel Dunbar
83381d001b
tblgen/AsmMatcherEmitter: Fix alias handling to honor -match-prefix.
...
llvm-svn: 124154
2011-01-24 23:26:31 +00:00
Anton Korobeynikov
f3a62314f3
Provide correct registers for EH stuff on ARM
...
llvm-svn: 124151
2011-01-24 22:38:45 +00:00
Anton Korobeynikov
b15beb2ae1
Support printing exception section into the current one. This is the case when LSDASection is blank
...
llvm-svn: 124150
2011-01-24 22:38:40 +00:00
Eric Christopher
6e959a5687
Perhaps a bit too much vertical whitespace.
...
llvm-svn: 124148
2011-01-24 22:19:14 +00:00
David Greene
127fd1d540
[AVX] Add type checking support for vector/subvector type constraints.
...
This will be used to check patterns referencing a forthcoming
INSERT_SUBVECTOR SDNode. INSERT_SUBVECTOR in turn is very useful for
matching to VINSERTF128 instructions and complements the already
existing EXTRACT_SUBVECTOR SDNode.
llvm-svn: 124145
2011-01-24 20:53:18 +00:00
Devang Patel
533479544b
Speculatively revert r124138.
...
llvm-svn: 124142
2011-01-24 20:04:37 +00:00
Rafael Espindola
78c9f78fc9
Jörg Sonnenberger noticed that we were missing this test.
...
llvm-svn: 124139
2011-01-24 19:40:38 +00:00
Devang Patel
8cc5355c90
Resolve DanglingDbgValue of PHI nodes where the use follows dbg.value intrinisic.
...
llvm-svn: 124138
2011-01-24 19:24:37 +00:00
Andrew Trick
a293c49f0d
Temporarily workaround JM/lencod miscompile (SIGSEGV).
...
rdar://problem/8893967
llvm-svn: 124137
2011-01-24 19:08:15 +00:00
Dan Gohman
0f124e1987
Give GetUnderlyingObject a TargetData, to keep it in sync
...
with BasicAA's DecomposeGEPExpression, which recently began
using a TargetData. This fixes PR8968, though the testcase
is awkward to reduce.
Also, update several off GetUnderlyingObject's users
which happen to have a TargetData handy to pass it in.
llvm-svn: 124134
2011-01-24 18:53:32 +00:00
Chris Lattner
f277b5d434
fix PR8928 by clearing a stale map, patch by Jakub Staszak!
...
llvm-svn: 124132
2011-01-24 18:36:51 +00:00
Duncan Sands
f7bde9a192
Testcase for dragonegg commit 124128.
...
llvm-svn: 124129
2011-01-24 18:04:33 +00:00
Rafael Espindola
689939e648
Handle strings in section names the same way as gas:
...
* If the name is a single string, we remove the quotes
* If the name starts without a quote, we include any quotes in the name
llvm-svn: 124127
2011-01-24 18:02:54 +00:00
Dan Gohman
3ac8cd614f
Add a comment.
...
llvm-svn: 124126
2011-01-24 17:54:18 +00:00
Dan Gohman
4deda530c2
Add another rdar number.
...
llvm-svn: 124125
2011-01-24 17:54:01 +00:00
Daniel Dunbar
72d523beab
Support/CommandLine: Fix LookupNearestOption to also search extra option names.
...
llvm-svn: 124124
2011-01-24 17:27:17 +00:00
Chris Lattner
bf638d2a0d
fix a missing shuffle pattern, PR9009. Patch by Artiom Myaskouvskey!
...
llvm-svn: 124102
2011-01-24 03:42:46 +00:00
Chris Lattner
2bcec1297e
merge all the "crash tests" into crash.ll
...
llvm-svn: 124101
2011-01-24 03:37:34 +00:00
Chris Lattner
b4017769ae
fix PR9017, a bug where we'd assert when promoting in unreachable
...
code.
llvm-svn: 124100
2011-01-24 03:29:07 +00:00
Chris Lattner
23289c385a
fix PR9015, a crash linking recursive metadata.
...
llvm-svn: 124099
2011-01-24 03:18:24 +00:00
Chris Lattner
9685603260
this isn't a memset, we do convert dest[i] to one though :)
...
llvm-svn: 124097
2011-01-24 02:32:00 +00:00
Chris Lattner
b830ee5250
with recent work, we now optimize this into:
...
define i32 @foo(i32 %x) nounwind readnone ssp {
entry:
%tobool = icmp eq i32 %x, 0
%tmp5 = select i1 %tobool, i32 2, i32 1
ret i32 %tmp5
}
llvm-svn: 124091
2011-01-24 01:12:18 +00:00
Chris Lattner
d83e7b0ff6
enhance SRoA to promote allocas that are used by PHI nodes. This often
...
occurs because instcombine sinks loads and inserts phis. This kicks in
on such apps as 175.vpr, eon, 403.gcc, xalancbmk and a bunch of times in
spec2006 in some app that uses std::deque.
This resolves the last of rdar://7339113.
llvm-svn: 124090
2011-01-24 01:07:11 +00:00
Chris Lattner
a960725d18
Enhance SRoA to promote allocas that are used by selects in some
...
common cases. This triggers a surprising number of times in SPEC2K6
because min/max idioms end up doing this. For example, code from the
STL ends up looking like this to SRoA:
%202 = load i64* %__old_size, align 8, !tbaa !3
%203 = load i64* %__old_size, align 8, !tbaa !3
%204 = load i64* %__n, align 8, !tbaa !3
%205 = icmp ult i64 %203, %204
%storemerge.i = select i1 %205, i64* %__n, i64* %__old_size
%206 = load i64* %storemerge.i, align 8, !tbaa !3
We can now promote both the __n and the __old_size allocas.
This addresses another chunk of rdar://7339113, poor codegen on
stringswitch.
llvm-svn: 124088
2011-01-23 22:04:55 +00:00
Chris Lattner
9879965f4b
teach Value::isDereferenceablePointer that byval arguments are always
...
dereferencable, noticed by inspection.
llvm-svn: 124085
2011-01-23 21:15:29 +00:00
Anders Carlsson
773bc67eff
Add a memset loop that LoopIdiomRecognize doesn't recognize.
...
llvm-svn: 124082
2011-01-23 20:31:00 +00:00
Nick Lewycky
d4192f71b5
Simplify some code with no functionality change. Make the test a lot more
...
robust against smarter optimizations, using the power of FileCheck.
llvm-svn: 124081
2011-01-23 20:06:05 +00:00
Rafael Espindola
c5efca47fc
Initialize MCNoExecStack.
...
llvm-svn: 124079
2011-01-23 18:50:12 +00:00
Rafael Espindola
b3eca9bb71
Add support for the --noexecstack option.
...
llvm-svn: 124077
2011-01-23 17:55:27 +00:00
Ted Kremenek
3c4408ceb6
Null initialize a few variables flagged by
...
clang's -Wuninitialized-experimental warning.
While these don't look like real bugs, clang's
-Wuninitialized-experimental analysis is stricter
than GCC's, and these fixes have the benefit
of being general nice cleanups.
llvm-svn: 124073
2011-01-23 17:05:06 +00:00
Rafael Espindola
8bac423ddb
Add support for lowercase variants.
...
llvm-svn: 124071
2011-01-23 16:11:25 +00:00
Chris Lattner
9491dee24e
Enhance SRoA to be more aggressive about scalarization of aggregate allocas
...
that have PHI or select uses of their element pointers. This can often happen
when instcombine sinks two loads into a successor, inserting a phi or select.
With this patch, we can scalarize the alloca, but the pinned elements are not
yet promoted. This is still a win for large aggregates where only one element
is used. This fixes rdar://8904039 and part of rdar://7339113 (poor codegen
on stringswitch).
llvm-svn: 124070
2011-01-23 08:27:54 +00:00
Cameron Zwarich
07d6fe34b3
Convert two std::vectors to SmallVectors for a 3.4% speedup running -scalarrepl
...
on test-suite + SPEC2000 & SPEC2006.
llvm-svn: 124068
2011-01-23 08:03:04 +00:00
Chris Lattner
8acbb79506
have AllocaInfo store the alloca being inspected, simplifying callers.
...
No functionality change.
llvm-svn: 124067
2011-01-23 07:29:29 +00:00
Chris Lattner
3e56c29068
Rearrange some code a bit. Change MarkUnsafe to
...
handle the "Transformation preventing inst" printing,
so that -scalarrepl -debug will always print the rejected
instruction. No functionality change.
llvm-svn: 124066
2011-01-23 07:05:44 +00:00
Cameron Zwarich
b5ee5168a3
Convert a std::vector to a SmallVector for another 5.4% speedup on domtree.
...
llvm-svn: 124065
2011-01-23 06:54:22 +00:00
Chris Lattner
a587ab7b94
remove an old hack that avoided creating MMX datatypes. The
...
X86 backend has been fixed.
llvm-svn: 124064
2011-01-23 06:40:33 +00:00
Nick Lewycky
bc98f5b78e
Use value ranges to fold ext(trunc) in SCEV when possible.
...
llvm-svn: 124062
2011-01-23 06:20:19 +00:00
Cameron Zwarich
a9339c6cd0
In the simpler version of the link-eval data structure that we use in dominator
...
computation, the Ancestor field is always set to the Parent, so we can remove
the explicit link entirely and merge the Parent and Ancestor fields. Instead of
checking for whether an ancestor exists for a node or not, we simply check
whether the node has already been processed. This is simpler if Compress is
inlined into Eval, so I did that as well.
This is about a 3% speedup running -domtree on test-suite + SPEC2000 & SPEC2006,
but it also opens up some opportunities for further improvement.
llvm-svn: 124061
2011-01-23 06:16:06 +00:00
Rafael Espindola
4b7b7fba38
Delay the creation of eh_frame so that the user can change the defaults.
...
Add support for SHT_X86_64_UNWIND.
llvm-svn: 124059
2011-01-23 05:43:40 +00:00
Cameron Zwarich
ac5a95b68b
Remove useless struct fields.
...
llvm-svn: 124058
2011-01-23 05:11:18 +00:00
Cameron Zwarich
652696fc13
Remove friend declaration for removed function.
...
llvm-svn: 124057
2011-01-23 04:54:34 +00:00
Rafael Espindola
0e7e34e476
Remove more duplicated code.
...
llvm-svn: 124056
2011-01-23 04:43:11 +00:00
Cameron Zwarich
cfeb0eee06
Convert a std::vector to a SmallVector.
...
llvm-svn: 124055
2011-01-23 04:30:59 +00:00
Rafael Espindola
aea4958ea6
Remove duplicated code.
...
llvm-svn: 124054
2011-01-23 04:28:49 +00:00
Cameron Zwarich
a914bed800
Simplify some code now that we've removed the more optimal (but slower) version
...
of the link-eval data structure from dominator computation.
llvm-svn: 124053
2011-01-23 04:13:53 +00:00
Nick Lewycky
b32c8943e6
Have SCEV turn sext(x) into zext(x) when x is s>= 0. This applies many times in
...
"make check" alone.
llvm-svn: 124046
2011-01-22 22:06:21 +00:00
Eric Christopher
c70e037b73
Add a FIXME explaining the move to a single indirect call bonus per function
...
that we can change from indirect to direct.
llvm-svn: 124045
2011-01-22 21:56:53 +00:00
Eric Christopher
08e8b3b629
Only apply the devirtualization bonus once instead of per-call site in the
...
target function.
Fixes part of rdar://8546196
llvm-svn: 124044
2011-01-22 21:17:33 +00:00
Venkatraman Govindaraju
cc91b7a3f6
Pass sret arguments through the stack instead of through registers in Sparc backend. It makes the code generated more compliant with the sparc32 ABI.
...
llvm-svn: 124030
2011-01-22 13:05:16 +00:00
Benjamin Kramer
54cd042125
Remove dead ivar.
...
llvm-svn: 124028
2011-01-22 12:13:28 +00:00
Venkatraman Govindaraju
7a0c350079
Added ICC, FCC as uses of movcc instruction to generate correct code when -mattr=v9 is used.
...
llvm-svn: 124027
2011-01-22 11:36:24 +00:00
Bill Wendling
a01ea89fb6
ARM uses '.' in their tokens. Give it a name instead of a numeric value.
...
llvm-svn: 124026
2011-01-22 09:44:32 +00:00
Chris Lattner
d5407dd2cd
add DW_TAG for rvalue refs.
...
llvm-svn: 124019
2011-01-22 01:47:25 +00:00
Dan Gohman
19e30d5a7d
Actually check memcpy lengths, instead of just commenting about
...
how they should be checked.
llvm-svn: 123999
2011-01-21 22:07:57 +00:00
Venkatraman Govindaraju
ef8cf45eb1
Sparc backend:
...
Rename FLUSH to FLUSHW.
Output "ta 3" instead of a "flushw" instruction if v8 instruction set is used.
llvm-svn: 123997
2011-01-21 22:00:00 +00:00
Owen Anderson
a834200dbe
Just because we have determined that an (fcmp | fcmp) is true for A < B,
...
A == B, and A > B, does not mean we can fold it to true. We still need to
check for A ? B (A unordered B).
llvm-svn: 123993
2011-01-21 19:39:42 +00:00
Evan Cheng
2f2435d026
Last round of fixes for movw + movt global address codegen.
...
1. Fixed ARM pc adjustment.
2. Fixed dynamic-no-pic codegen
3. CSE of pc-relative load of global addresses.
It's now enabled by default for Darwin.
llvm-svn: 123991
2011-01-21 18:55:51 +00:00
Renato Golin
83758d5cd7
Clang was not parsing target triples involving EABI and was generating wrong IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure.
...
llvm-svn: 123990
2011-01-21 18:25:47 +00:00
Oscar Fuentes
6495595382
Handles libffi on the CMake build.
...
Patch by arrowdodger!
llvm-svn: 123976
2011-01-21 15:42:54 +00:00
Bruno Cardoso Lopes
4bd612384a
Fix the encoding of QADD/SUB, QDADD/SUB. While qadd16, qadd8 use "rd, rn, rm",
...
qadd and qdadd uses "rd, rm, rn", the same applies to the 'sub' variants. This
is described in ARM manuals and matches the encoding used by the gnu assembler.
llvm-svn: 123975
2011-01-21 14:07:40 +00:00