Tanya Lattner [Sat, 24 Oct 2009 01:52:47 +0000 (01:52 +0000)]
Merge 80596 from mainline.
Mark test as passing on all x86, which it should,
although I don't think anyone cares about this
feature except Darwin. PR 4825.
Tanya Lattner [Mon, 12 Oct 2009 16:46:55 +0000 (16:46 +0000)]
Merge 83417 from mainline.
r83391 was completely broken since Twines keep references to their inputs, and
some of the inputs were temporaries. Here's a real fix for the miscompilation.
Thanks to sabre for pointing out the problem.
Tanya Lattner [Thu, 1 Oct 2009 15:12:41 +0000 (15:12 +0000)]
Merge from mainline (reg).
Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.
Merge 81888 from mainline.
Change the marker byte for stubs from 0xcd to 0xce (another form of
interrupt instruction, which shouldn't arise any other way). 0xcd is
also used by JITMemoryManager to initialize the buffer to garbage,
which means it could appear following a noreturn call even when
that is not a stub, confusing X86CompilationCallback2. PR 4929.
Merge 81821 from mainline.
Don't pull a load through a callseq_start if the load's chain
has multiple uses, as one of the other uses may be on a path
to a different node above the callseq_start, because that
leads to a cyclic graph. This problem is exposed when
-combiner-global-alias-analysis is used. This fixes PR4880.
Merge 81810 from mainline.
When extending a memset range past the front, set the alignment of the
memset region to the alignment of the new start address.
Merge 80960 from mainline.
If we've pushed registers onto the stack, but aren't adjusting the stack pointer
(i.e., there are no local variables and stuff), we still need to output FDE
information for the pushed registers.
Merge 80146 from mainline.
If we're emitting additional CIEs due to personality functions
don't emit the default one. Explicitly check for the NULL
CIE later.
Merge 81316 from mainline.
Make TypeBuilder's result depend on the LLVMContext it's passed.
TypeBuilder was using a local static variable to cache its result. This made it
ignore changes in its LLVMContext argument and always return a type constructed
from the argument to the first call.
Merge 81204 from mainline (with minor tweak).
When remat'ing and destination virtual register has a sub-register index. Make sure the sub-register class matches the register class of the remat'ed instruction definition register class.
Merge 81187 from mainline.
fix PR4767, a crash because fp stackifier visited blocks in
depth first order, so it wouldn't process unreachable blocks.
When compiling at -O0, late dead block elimination isn't done
and the bad instructions got to isel.
Merge 80780 from mainline.
Opaque types didn't work if llvm_is_multithreaded().
AlwaysOpaqueTy is always NULL at this point, and it causes an assertion failure.
Fix it by using the just constructed tmp instead.
Merge 80762 from mainline.
fix PR4848 an infinite loop when indexing down through a recursive gep
and we get the original pointer type. This doesn't mean that we're
at the first pointer being indexed. Correct the predicate.
Merge 80742 from mainline.
Fix PR4845: r77946 completely broke x86_64 Darwin (or any situation where the
desired triplet is a sub-target, e.g. thumbv7 vs. arm host). Reverting the
patch isn't quite right either since the previous behavior does not allow the
triplet to be overridden with -march.
Tanya Lattner [Mon, 31 Aug 2009 06:58:09 +0000 (06:58 +0000)]
Merge 79862 from mainline.
Fix off-by-one in llvm::Format::print.
- This also shortens the Format.h implementation, and uses the print buffer
fully (it was wasting a character).
- This manifested as llvm-test failures, because one side effect was that
raw_ostream would write garbage '\x00' values into the output stream if it
happened that the string was at the end of the buffer. This meant that grep
would report 'Binary file matches', which meant the silly pattern matching
llvm-test eventually does would fail. Cute. :)
Tanya Lattner [Mon, 31 Aug 2009 06:32:45 +0000 (06:32 +0000)]
Merge from mainline.
Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.
This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.
Thanks to Nick Lewycky for reporting this, and for an initial patch!
Tanya Lattner [Mon, 31 Aug 2009 06:29:32 +0000 (06:29 +0000)]
Merge from mainline.
When undoing a reuse in ReuseInfo::GetRegForReload, check if it was only a
sub-register being used. The MachineOperand::getSubReg() method is only valid
for virtual registers, so we have to recover the sub-register index manually.
Tanya Lattner [Mon, 31 Aug 2009 06:28:24 +0000 (06:28 +0000)]
Merge from mainline.
Special-case static allocas in IndVarSimplify's loop invariant
sinking code, since they are special. If the loop preheader happens
to be the entry block of a function, don't sink static allocas
out of it. This fixes PR4775.
Tanya Lattner [Mon, 31 Aug 2009 06:12:11 +0000 (06:12 +0000)]
Merge from mainline.
Fix non-determinism in DAGISel emitter.
- This manifested as non-determinism in the .inc output in rare cases (when two
distinct patterns ended up being equivalent, which is rather rare). That
meant the pattern matching was non-deterministic, which could eventually mean
the code generator selected different instructions based on the arch.
- It's probably worth making the DAGISel ensure a total ordering (or force the
user to), but the simple fix here is to totally order the Record* maps based
on a unique ID.
Tanya Lattner [Sat, 22 Aug 2009 20:41:28 +0000 (20:41 +0000)]
Merge 79741 from mainline.
Some dummy cost model for s390x:
- Prefer short-imm instructions over ext-imm, when possible
- Prefer Z10 instructions over Z9, when possible
This hopefully should fix some dejagnu test fails on solaris
Owen Anderson [Sat, 22 Aug 2009 00:29:12 +0000 (00:29 +0000)]
Ease contention on this lock by noticing that all writes to the VTs array will
be of (dynamically) constant values, so races on it are immaterial. We just need
to ensure that at least one write has completed before return the pointer into it.
With this change, parllc exhibits essentially no overhead on 403.gcc.
Daniel Dunbar [Fri, 21 Aug 2009 23:30:15 +0000 (23:30 +0000)]
llvm-mc: Improve handling of implicit alignment for magic section directives
(e.g., .objc_message_refs).
- Just emit a .align when we see the directive; this isn't exactly what 'as'
does but in practice it should be ok, at least for now. See FIXME.
Bob Wilson [Fri, 21 Aug 2009 21:58:55 +0000 (21:58 +0000)]
Rename ARM "lane_cst" operands to "nohash_imm" since they are used for
several things other than Neon vector lane numbers. For inline assembly
operands with a "c" print code, check that they really are immediates.
Reid Kleckner [Fri, 21 Aug 2009 21:03:57 +0000 (21:03 +0000)]
Fix a bug where the DWARF emitter in the JIT was not initializing alignment
bytes. libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it
doesn't like it.
Also make the JIT memory manager to initialize it's memory to garbage in debug
mode, so that it's easier to find bugs like these in the future.