Evan Cheng [Fri, 5 Oct 2012 01:48:22 +0000 (01:48 +0000)]
Follow up to r165072. Try a different approach: only move the load when it's going to be folded into the call. rdar://
12437604
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165287
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 5 Oct 2012 01:29:09 +0000 (01:29 +0000)]
Teach the new SROA a new trick. Now we zap any memcpy or memmoves which
are in fact identity operations. We detect these and kill their
partitions so that even splitting is unaffected by them. This is
particularly important because Clang relies on emitting identity memcpy
operations for struct copies, and these fold away to constants very
often after inlining.
Fixes the last big performance FIXME I have on my plate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165285
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 5 Oct 2012 01:29:06 +0000 (01:29 +0000)]
Lift the speculation visitor above all the helpers that are targeted at
the rewrite visitor to make the fact that the speculation is completely
independent a bit more clear.
I promise that this is just a cut/paste of the one visitor and adding
the annonymous namespace wrappings. The diff may look completely
preposterous, it does in git for some reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165284
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Fri, 5 Oct 2012 00:22:46 +0000 (00:22 +0000)]
Use -object_path_lto when linking executables if building Apple style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165282
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 4 Oct 2012 23:59:38 +0000 (23:59 +0000)]
[ms-inline asm] Add support for parsing [Intel dialect] memory operands that use
segmented registers. Test case to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165275
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 23:01:22 +0000 (23:01 +0000)]
Rename the Target specific passes in the DataLayout class to be Target agnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165270
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Thu, 4 Oct 2012 22:35:15 +0000 (22:35 +0000)]
When merging connsecutive stores, use vectors to store the constant zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165267
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 22:08:14 +0000 (22:08 +0000)]
Resubmit the copying of TargetData to DataLayout without any changes to the files, this should fix the problems and the changes to rename to DataLayout will come next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165262
91177308-0d34-0410-b5e6-
96231b3b80d8
Preston Gurd [Thu, 4 Oct 2012 21:33:40 +0000 (21:33 +0000)]
This patch corrects commit 165126 by using an integer bit width instead of
a pointer to a type, in order to remove the uses of getGlobalContext().
Patch by Tyler Nowicki.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165255
91177308-0d34-0410-b5e6-
96231b3b80d8
Jim Grosbach [Thu, 4 Oct 2012 21:33:24 +0000 (21:33 +0000)]
ARM: locate user-defined text sections next to default text.
Make sure functions located in user specified text sections (via the
section attribute) are located together with the default text sections.
Otherwise, for large object files, the relocations for call instructions
are more likely to be out of range. This becomes even more likely in the
presence of LTO.
rdar://
12402636
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165254
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 21:08:50 +0000 (21:08 +0000)]
Backing out my changes, something screwed up from my patches, starting over.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165253
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 20:49:16 +0000 (20:49 +0000)]
Rename TargetData to DataLayout in DataLayout.cpp. This should fix a build failure from r165249 where the wrong version of the file was submitted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165251
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 4 Oct 2012 20:46:14 +0000 (20:46 +0000)]
Update this a bit more to represent how the prologue should work:
a) frame setup instructions define the prologue
b) we shouldn't change our location mid-stream
Add a test to make sure that the stack adjustment stays within
the prologue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165250
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 20:44:22 +0000 (20:44 +0000)]
Create the DataLayout class, as a direct copy of TargetData.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165249
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Thu, 4 Oct 2012 20:29:44 +0000 (20:29 +0000)]
Adding MCJIT and MemoryBuffer unit tests
Patch by Daniel Malea.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165246
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 20:08:28 +0000 (20:08 +0000)]
Accidently checked in the files, only wanted to copy them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165244
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 20:06:07 +0000 (20:06 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165243
91177308-0d34-0410-b5e6-
96231b3b80d8
Micah Villmow [Thu, 4 Oct 2012 20:05:12 +0000 (20:05 +0000)]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165242
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 4 Oct 2012 19:50:43 +0000 (19:50 +0000)]
Add register encoding support in X86 backend
- Add 'HwEncoding' for X86 registers and call getEncodingValue() to
retrieve their encoding values.
- This's the first step to adopt new scheme. Furthur revising is onging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165241
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Thu, 4 Oct 2012 19:10:44 +0000 (19:10 +0000)]
Fix doxygen comment to match parameters' names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165239
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Thu, 4 Oct 2012 19:08:30 +0000 (19:08 +0000)]
Add a comment to the commit r165187.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165238
91177308-0d34-0410-b5e6-
96231b3b80d8
Will Schmidt [Thu, 4 Oct 2012 18:14:28 +0000 (18:14 +0000)]
- add tokens to PPCInstrInfo.td and PPCInstr64Bit.td to resolve
"Instruction 'foo' has no tokens" errors during llvm-tblgen
-gen-asm-matcher attempts. At this time, the added
tokens are "#comment" style rather than the actual mnemonic. This will
be revisited once the rest of the base asmparser bits get straightened
out for ppc64-elf-linux.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165237
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Oct 2012 17:30:43 +0000 (17:30 +0000)]
Get MCSchedModel directly from the subtarget.
Not all targets have itineraries, but the subtarget always has an
MCSchedModel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165236
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Thu, 4 Oct 2012 17:30:40 +0000 (17:30 +0000)]
Switch MachineTraceMetrics to the new TargetSchedModel interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165235
91177308-0d34-0410-b5e6-
96231b3b80d8
Will Schmidt [Thu, 4 Oct 2012 16:20:24 +0000 (16:20 +0000)]
test commit / whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165233
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 4 Oct 2012 16:11:49 +0000 (16:11 +0000)]
SimplifyCFG: Enhance the "remove CFG edge that leads to null pointer dereference" optimization to also handle instructions with multiple uses.
We conservatively only check the first use to avoid walking long use chains.
This catches the common case of having both a load and a store to a pointer
supplied by a PHI node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165232
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 4 Oct 2012 13:53:21 +0000 (13:53 +0000)]
In my recent change to avoid use of underaligned memory I didn't notice that
cpyDest can be mutated in some cases, which would then cause a crash later if
indeed the memory was underaligned. This brought down several buildbots, so
I guess the underaligned case is much more common than I thought!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165228
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 4 Oct 2012 13:36:31 +0000 (13:36 +0000)]
The alignment of an sret parameter is known: it must be at least the
alignment of the return type. Teach the optimizers this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165226
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 4 Oct 2012 13:12:43 +0000 (13:12 +0000)]
Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165225
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 4 Oct 2012 13:07:26 +0000 (13:07 +0000)]
Fix wrong name in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165224
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 4 Oct 2012 12:33:50 +0000 (12:33 +0000)]
Fix PR13969, a mini-phase-ordering issue with the new SROA pass.
Currently, we re-visit allocas when something changes about the way they
might be *split* to allow better scalarization to take place. However,
we weren't handling the case when the *promotion* is what would change
the behavior of SROA. When an address derived from an alloca is stored
into another alloca, we consider the first to have escaped. If the
second is ever promoted to an SSA value, we will suddenly be able to run
the SROA pass on the first alloca.
This patch adds explicit support for this form if iteration. When we
detect a store of a pointer derived from an alloca, we flag the
underlying alloca for reprocessing after promotion. The logic works hard
to only do this when there is definitely going to be promotion and it
might remove impediments to the analysis of the alloca.
Thanks to Nick for the great test case and Benjamin for some sanity
check review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165223
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Thu, 4 Oct 2012 10:54:40 +0000 (10:54 +0000)]
The memcpy optimizer was happily doing call slot forwarding when the new memory
was less aligned than the old. In the testcase this results in an overaligned
memset: the memset alignment was correct for the original memory but is too much
for the new memory. Fix this by either increasing the alignment of the new
memory or bailing out if that isn't possible. Should fix the gcc-4.7 self-host
buildbot failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165220
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 4 Oct 2012 10:39:28 +0000 (10:39 +0000)]
Teach the integer-promotion rewrite strategy to be endianness aware.
Sorry for this being broken so long. =/
As part of this, switch all of the existing tests to be Little Endian,
which is the behavior I was asserting in them anyways! Add in a new
big-endian test that checks the interesting behavior there.
Another part of this is to tighten the rules abotu when we perform the
full-integer promotion. This logic now rejects cases where there fully
promoted integer is a non-multiple-of-8 bitwidth or cases where the
loads or stores touch bits which are in the allocated space of the
alloca but are not loaded or stored when accessing the integer. Sadly,
these aren't really observable today as the rest of the pass will
already ensure the invariants hold. However, the latter situation is
likely to become a potential concern in the future.
Thanks to Benjamin and Duncan for early review of this patch. I'm still
looking into whether there are further endianness issues, please let me
know if anyone sees BE failures persisting past this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165219
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 07:19:46 +0000 (07:19 +0000)]
Use method to query if there are attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165213
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 07:18:12 +0000 (07:18 +0000)]
Add method to query for NoCapture attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165212
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 07:17:46 +0000 (07:17 +0000)]
Use method to query for NoAlias attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165211
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 07:08:30 +0000 (07:08 +0000)]
Use attribute query methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165210
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 06:58:52 +0000 (06:58 +0000)]
Use method to query for attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165209
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 06:52:09 +0000 (06:52 +0000)]
Add method to query for 'NoAlias' attribute on call/invoke instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165208
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 06:49:41 +0000 (06:49 +0000)]
Use method to query for attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165207
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 06:48:57 +0000 (06:48 +0000)]
Query for attributes via the correct method call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165206
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Thu, 4 Oct 2012 06:43:21 +0000 (06:43 +0000)]
Use new accessor methods to query for attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165205
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 4 Oct 2012 05:28:50 +0000 (05:28 +0000)]
[tsan] add 3 internal flags for fine-grain control of what is instrumented and what is not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165204
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Thu, 4 Oct 2012 05:18:31 +0000 (05:18 +0000)]
Remove template from function that is only used with one type after r165092.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165203
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 4 Oct 2012 04:50:53 +0000 (04:50 +0000)]
Fix reg mask slot test, and preserve LiveIntervals and VirtRegMap in the PBQP
allocator. Fixes PR13945.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165201
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 4 Oct 2012 04:41:27 +0000 (04:41 +0000)]
docs: Fix typo on front page
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165200
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Thu, 4 Oct 2012 04:03:53 +0000 (04:03 +0000)]
Implement methods that enable expansion of load immediate
macro instruction (li) in the assembler.
We have identified three possible expansions depending on
the size of immediate operand:
1) for 0 ≤ j ≤ 65535.
li d,j =>
ori d,$zero,j
2) for −32768 ≤ j < 0.
li d,j =>
addiu d,$zero,j
3) for any other value of j that is representable as a 32-bit integer.
li d,j =>
lui d,hi16(j)
ori d,d,lo16(j)
All of the above have been implemented in ths patch.
Contributer: Vladimir Medic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165199
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 4 Oct 2012 03:56:23 +0000 (03:56 +0000)]
docs: Sphinxify GoldPlugin document.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165198
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Thu, 4 Oct 2012 02:29:46 +0000 (02:29 +0000)]
This patch is a partial implementation of mips .set assembler directive. Directive is defined as follows:
.set option
The patch implements following options
at - lets the assembler use the $at register for macros,
but generates warnings if the source program uses $at
noat - let source programs use $at without issuingwarnings.
noreorder - prevents the assembler from reordering machine
language instructions.
nomacro - causes the assembler to print a warning whenever
an assembler operation generates more than one
machine language instruction.
macro - lets the assembler generate multiple machine instructions
from a single assembler instruction
reorder - lets the assembler reorder machine language
instructions to improve performance
The above variants are parsed and their boolean values set or unset.
The code to actually use them will come later.
Following options are not implemented yet:
nomips16
nomicromips
move
nomove
Contributer: Vladimir Medic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165194
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Thu, 4 Oct 2012 00:54:27 +0000 (00:54 +0000)]
tblgen: Whitespace and 80-col cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165190
91177308-0d34-0410-b5e6-
96231b3b80d8
Jordan Rose [Thu, 4 Oct 2012 00:47:59 +0000 (00:47 +0000)]
Make sure 'prefix-clang++' is aliased to 'prefix-clang', not 'clang'.
When aliasing tools, rather than using the base TOOLEXENAME, we should
instead use the built tool's basename (for 'make') or the installed
tool's basename (for 'make install').
This should not cause any changes for anyone building unprefixed 'clang'
and 'clang++' tools.
Patch by Rick Foos!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165189
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Thu, 4 Oct 2012 00:24:34 +0000 (00:24 +0000)]
Enable -schedmodel, but prefer itineraries until we have more benchmark data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165188
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Wed, 3 Oct 2012 23:59:47 +0000 (23:59 +0000)]
Fix PR13967.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165187
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 3 Oct 2012 23:52:10 +0000 (23:52 +0000)]
Add an explicit -object_path_lto flag during linking with a uniquified temporary
file name if building Apple-style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165185
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Wed, 3 Oct 2012 23:43:52 +0000 (23:43 +0000)]
Clean up tailing whitespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165182
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 3 Oct 2012 23:06:32 +0000 (23:06 +0000)]
Added instregex support to TableGen subtarget emitter.
This allows the processor-specific machine model to override selected
base opcodes without any fanciness.
e.g. InstRW<[CoreXWriteVANDP], (instregex "VANDP")>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165180
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 3 Oct 2012 23:06:28 +0000 (23:06 +0000)]
TableGen subtarget emitter, nearly first class support for SchedAlias.
A processor can now arbitrarily alias one SchedWrite onto
another. Only the SchedAlias definition need be within the processor
model. The aliased SchedWrite may be a SchedVariant, WriteSequence, or
transitively refer to another alias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165179
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Wed, 3 Oct 2012 23:06:25 +0000 (23:06 +0000)]
Cleanup TableGen subtarget emitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165178
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 3 Oct 2012 22:18:38 +0000 (22:18 +0000)]
[ms-inline asm] Default to the 'm' constraint. This matches the behavior of the
MSVC compiler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165174
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 3 Oct 2012 22:06:44 +0000 (22:06 +0000)]
[ms-inline asm] Add support in the X86AsmPrinter for printing memory references
in the Intel syntax.
The MC layer supports emitting in the Intel syntax, but this would require the
inline assembly MachineInstr to be lowered to an MCInst before emission. This
is potential future work, but for now emitting directly from the MachineInstr
suffices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165173
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Wed, 3 Oct 2012 21:58:54 +0000 (21:58 +0000)]
This patch moves from using a hard coded number (4)
for the number of bytes in a particular instruction
to using
const MCInstrDesc &Desc = MCII.get(TmpInst.getOpcode());
Desc.getSize()
This is necessary with the advent of 16 bit instructions with
mips16 and micromips. It is also puts Mips in compliance with
the other targets for getting instruction size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165171
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 3 Oct 2012 21:31:08 +0000 (21:31 +0000)]
tblgen: Remove last traces of old TableGenMain API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165168
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 3 Oct 2012 21:29:19 +0000 (21:29 +0000)]
tblgen: Migrate llvm-tblgen to new TableGenMain API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165166
91177308-0d34-0410-b5e6-
96231b3b80d8
Sean Silva [Wed, 3 Oct 2012 21:29:18 +0000 (21:29 +0000)]
tblgen: Put new TableGenMain API in place.
In order to avoid rev-lock with Clang when moving to the new API, also
preserve the current API temporarily and insert a shim to implement the
new API in terms of the old.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165165
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 3 Oct 2012 21:19:35 +0000 (21:19 +0000)]
Add function to return return attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165164
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 3 Oct 2012 21:17:09 +0000 (21:17 +0000)]
Update to use the predicate methods to query if an attribute exists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165163
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 3 Oct 2012 19:30:31 +0000 (19:30 +0000)]
Fix a cycle in the DAG. In this code we replace multiple loads with a single load and
multiple stores with a single load. We create the wide loads and stores (and their chains)
before we remove the scalar loads and stores and fix the DAG chain. We attempted to merge
loads with a different chain. When that happened, the assumption that it is safe to RAUW
broke and a cycle was introduced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165148
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Kledzik [Wed, 3 Oct 2012 19:27:25 +0000 (19:27 +0000)]
Use unsigned long long instead of uin64_t for OS where that matters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165147
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Wed, 3 Oct 2012 19:00:20 +0000 (19:00 +0000)]
Typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165141
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Wed, 3 Oct 2012 18:54:36 +0000 (18:54 +0000)]
Don't call getAsUnsignedInteger directly, it fails to compile if uint64_t is not "unsigned long long".
while there add more test cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165140
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Kledzik [Wed, 3 Oct 2012 18:15:27 +0000 (18:15 +0000)]
Add getAsUnsignedInteger test case that checks that known bad values are rejected
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165136
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 3 Oct 2012 18:10:49 +0000 (18:10 +0000)]
No need to call functions which do the same thing as the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165135
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 3 Oct 2012 18:08:57 +0000 (18:08 +0000)]
Remove assert that's too restrictive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165134
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Wendling [Wed, 3 Oct 2012 17:54:26 +0000 (17:54 +0000)]
Add methods which query for the specific attribute instead of using the
enums. This allows for better encapsulation of the Attributes class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165132
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Wed, 3 Oct 2012 16:29:42 +0000 (16:29 +0000)]
Implement .rel relocation for R_ARM_ABS32 in MCJIT.
Patch by Amara Emerson.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165128
91177308-0d34-0410-b5e6-
96231b3b80d8
Preston Gurd [Wed, 3 Oct 2012 16:11:44 +0000 (16:11 +0000)]
This Patch corrects a problem whereby the optimization to use a faster divide
instruction (for Intel Atom) was not being done by Clang, because
the type context used by Clang is not the default context.
It fixes the problem by getting the global context types for each div/rem
instruction in order to compare them against the types in the BypassTypeMap.
Tests for this will be done as a separate patch to Clang.
Patch by Tyler Nowicki.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165126
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Wed, 3 Oct 2012 16:11:15 +0000 (16:11 +0000)]
A DAGCombine optimization for mergeing consecutive stores to memory. The optimization
is not profitable in many cases because modern processors perform multiple stores
in parallel and merging stores prior to merging requires extra work. We handle two main cases:
1. Store of multiple consecutive constants:
q->a = 3;
q->4 = 5;
In this case we store a single legal wide integer.
2. Store of multiple consecutive loads:
int a = p->a;
int b = p->b;
q->a = a;
q->b = b;
In this case we load/store either ilegal vector registers or legal wide integer registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165125
91177308-0d34-0410-b5e6-
96231b3b80d8
Preston Gurd [Wed, 3 Oct 2012 15:55:13 +0000 (15:55 +0000)]
Set up MCSchedModel after detecting the CPU type in X86SubTarget.
Corrects a problem whereby MCSchedModel was not being set up when
the CPU type was auto-detected.
Patch by Andy Zhang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165122
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Vyukov [Wed, 3 Oct 2012 13:19:20 +0000 (13:19 +0000)]
tsan: update the test for new atomic enums
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165109
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Vyukov [Wed, 3 Oct 2012 13:13:54 +0000 (13:13 +0000)]
tsan: update the test for new atomic enums
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165108
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitry Vyukov [Wed, 3 Oct 2012 13:00:57 +0000 (13:00 +0000)]
tsan: prepare for migration to new memory_order enum values (ABI compatible)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165107
91177308-0d34-0410-b5e6-
96231b3b80d8
Silviu Baranga [Wed, 3 Oct 2012 08:29:36 +0000 (08:29 +0000)]
Fixed a bug in the ExecutionDependencyFix pass that caused dependencies to not propagate through implicit defs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165102
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 3 Oct 2012 08:26:28 +0000 (08:26 +0000)]
Fix an issue where we failed to adjust the alignment constraint on
a memcpy to reflect that '0' has a different meaning when applied to
a load or store. Now we correctly use underaligned loads and stores for
the test case added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165101
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 3 Oct 2012 08:14:02 +0000 (08:14 +0000)]
Try to use a better set of abstractions for computing the alignment
necessary during rewriting. As part of this, fix a real think-o here
where we might have left off an alignment specification when the address
is in fact underaligned. I haven't come up with any way to trigger this,
as there is always some other factor that reduces the alignment, but it
certainly might have been an observable bug in some way I can't think
of. This also slightly changes the strategy for placing explicit
alignments on loads and stores to only do so when the alignment does not
match that required by the ABI. This causes a few redundant alignments
to go away from test cases.
I've also added a couple of tests that really push on the alignment that
we end up with on loads and stores. More to come here as I try to fix an
underlying bug I have conjectured and produced test cases for, although
it's not clear if this bug is the one currently hitting dragonegg's
gcc47 bootstrap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165100
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 3 Oct 2012 08:10:01 +0000 (08:10 +0000)]
Revert 165051-165049 while looking into the foreach.m failure in
more detail.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165099
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 3 Oct 2012 06:47:18 +0000 (06:47 +0000)]
Fix doxygen comment to match function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165094
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 3 Oct 2012 06:26:11 +0000 (06:26 +0000)]
Remove unused function that used to get itineraries from SubTargetFeatures. This is done from MCSubTargetInfo these days.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165092
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Wed, 3 Oct 2012 03:56:12 +0000 (03:56 +0000)]
Fix 80-column violation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165089
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Wed, 3 Oct 2012 01:42:37 +0000 (01:42 +0000)]
test/ExecutionEngine/MCJIT: MCJIT should work also on mingw.
FIXME: Also cygwin?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165081
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 3 Oct 2012 01:04:07 +0000 (01:04 +0000)]
Third try at fixing this. ;] Go back to using std::remove_if, which has
most of the behavior we want, but wrap the predicate in one which erases
elements from the set if they pass the predicate. Oh what I wouldn't
give for a lambda here.
Let me know if the predicate wrapping is too much magic. ;]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165076
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Wed, 3 Oct 2012 00:51:32 +0000 (00:51 +0000)]
The early if conversion pass is ready to be used as an opt-in.
Enable the pass by default for targets that request it, and change the
-enable-early-ifcvt to the opposite -disable-early-ifcvt.
There are still some x86 regressions when enabling early if-conversion
because of the missing machine models. Disable the pass for x86 until
machine models are added.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165075
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 3 Oct 2012 00:03:00 +0000 (00:03 +0000)]
Switch the SetVector::remove_if implementation to use partition which
preserves the values of the relocated entries, unlikely remove_if. This
allows walking them and erasing them.
Also flesh out the predicate we are using for this to support the
various constraints actually imposed on a UnaryPredicate -- without this
we can't compose it with std::not1.
Thanks to Sean Silva for the review here and noticing the issue with
std::remove_if.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165073
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Tue, 2 Oct 2012 23:49:13 +0000 (23:49 +0000)]
Fix a serious X86 instruction selection bug. In
X86DAGToDAGISel::PreprocessISelDAG(), isel is moving load inside
callseq_start / callseq_end so it can be folded into a call. This can
create a cycle in the DAG when the call is glued to a copytoreg. We
have been lucky this hasn't caused too many issues because the pre-ra
scheduler has special handling of call sequences. However, it has
caused a crash in a specific tailcall case.
rdar://
12393897
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165072
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Tue, 2 Oct 2012 23:43:11 +0000 (23:43 +0000)]
Revert "Don't use a debug location for frame setup instructions in the"
This reverts 165055 and 165052 temporarily while I look at debugger
failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165071
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 2 Oct 2012 23:38:50 +0000 (23:38 +0000)]
Revert 165057, per Jim's request. This requires further discussion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165069
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Tue, 2 Oct 2012 23:09:40 +0000 (23:09 +0000)]
The mips 64bit instructions DSLL, DSRA, DSRL, DEXT and DINS get transformed by the assembler or through codegen direct object output to other variants based on the value of the immediate values of the operands.
If the code is generated as assembler, this transformation does not occur assuming that it will occur later in the assembler.
This code was originally called from MipsAsmPrinter.cpp and we needed to check for OutStreamer.hasRawTextSupport(). This was not a good place for it and has been moved to MCTargetDesc/MipsMCCodeEmitter.cpp where both direct object and the assembler use it it automagically.
The test cases have been checked in for a number of weeks now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165067
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 2 Oct 2012 22:46:45 +0000 (22:46 +0000)]
Teach the new SROA to handle cases where an alloca that has already been
scheduled for processing on the worklist eventually gets deleted while
we are processing another alloca, fixing the original test case in
PR13990.
To facilitate this, add a remove_if helper to the SetVector abstraction.
It's not easy to use the standard abstractions for this because of the
specifics of SetVectors types and implementation.
Finally, a nice small test case is included. Thanks to Benjamin for the
fantastic reduced test case here! All I had to do was delete some empty
basic blocks!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165065
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Tue, 2 Oct 2012 22:46:40 +0000 (22:46 +0000)]
Clean up these doxygen comments to follow the proposed new style. This
also makes it more consistent with Clang and several passes' doxygen
style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165064
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Tue, 2 Oct 2012 22:45:06 +0000 (22:45 +0000)]
Make sure to put our sret argument into %rax on x86-64. Fixes PR13563!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165063
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakob Stoklund Olesen [Tue, 2 Oct 2012 22:45:03 +0000 (22:45 +0000)]
Remove the old coalescer algorithm.
The new algorithm has been enabled by default for almost a week now and
seems to be stable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165062
91177308-0d34-0410-b5e6-
96231b3b80d8