oota-llvm.git
11 years agoFix a typo 'iff' => 'if'
Sylvestre Ledru [Thu, 27 Sep 2012 09:59:43 +0000 (09:59 +0000)]
Fix a typo 'iff' => 'if'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrefer shuffles to selects. Backends love shuffles!
Nick Lewycky [Thu, 27 Sep 2012 08:33:56 +0000 (08:33 +0000)]
Prefer shuffles to selects. Backends love shuffles!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164763 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd constructors to the attribute builder.
Bill Wendling [Thu, 27 Sep 2012 07:22:30 +0000 (07:22 +0000)]
Add constructors to the attribute builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164762 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd missing function CreateFPCast to the TargetFolder. It's there in the other
Nick Lewycky [Thu, 27 Sep 2012 06:33:40 +0000 (06:33 +0000)]
Add missing function CreateFPCast to the TargetFolder. It's there in the other
folders and not having it here fails to compile if you actually try to use it.

Also, CreatePointerCast was failing to do the part where it does TD-aware
constant folding. Granted there is exactly one case where that it will ever
do anything, but there's no reason to skip it. For reference, that case is a
subtraction between two constant offsets on the same global variable, eg.,
"&A[123] - &A[4].f".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164760 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[arm-fast-isel] Add support for ELF PIC.
Jush Lu [Thu, 27 Sep 2012 05:21:41 +0000 (05:21 +0000)]
[arm-fast-isel] Add support for ELF PIC.

This is a preliminary step towards ELF support; currently ARMFastISel hasn't
been used for ELF object files yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164759 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTest case for r164755 and 164756.
Akira Hatanaka [Thu, 27 Sep 2012 04:12:30 +0000 (04:12 +0000)]
Test case for r164755 and 164756.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164757 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: rddsp (instruction which reads DSPControl register fields to a GPR).
Akira Hatanaka [Thu, 27 Sep 2012 04:08:42 +0000 (04:08 +0000)]
MIPS DSP: rddsp (instruction which reads DSPControl register fields to a GPR).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164756 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: CMPU.EQ.QB instruction sub-class.
Akira Hatanaka [Thu, 27 Sep 2012 03:58:34 +0000 (03:58 +0000)]
MIPS DSP: CMPU.EQ.QB instruction sub-class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164755 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: ADDU.QB instruction sub-class.
Akira Hatanaka [Thu, 27 Sep 2012 03:13:59 +0000 (03:13 +0000)]
MIPS DSP: ADDU.QB instruction sub-class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164754 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: Branch on Greater Than or Equal To Value 32 in DSPControl Pos Field instruc...
Akira Hatanaka [Thu, 27 Sep 2012 02:15:57 +0000 (02:15 +0000)]
MIPS DSP: Branch on Greater Than or Equal To Value 32 in DSPControl Pos Field instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164751 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: all the remaining instructions which read or write accumulators.
Akira Hatanaka [Thu, 27 Sep 2012 02:11:20 +0000 (02:11 +0000)]
MIPS DSP: all the remaining instructions which read or write accumulators.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164750 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: add support for extract-word instructions.
Akira Hatanaka [Thu, 27 Sep 2012 02:05:42 +0000 (02:05 +0000)]
MIPS DSP: add support for extract-word instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164749 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: add functions which decode DSP and accumulator registers.
Akira Hatanaka [Thu, 27 Sep 2012 02:01:10 +0000 (02:01 +0000)]
MIPS DSP: add functions which decode DSP and accumulator registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164748 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: add code necessary for pseudo instruction lowering.
Akira Hatanaka [Thu, 27 Sep 2012 01:59:07 +0000 (01:59 +0000)]
MIPS DSP: add code necessary for pseudo instruction lowering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164747 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: add bitcast patterns between vectors and int.
Akira Hatanaka [Thu, 27 Sep 2012 01:56:38 +0000 (01:56 +0000)]
MIPS DSP: add bitcast patterns between vectors and int.

No test cases. These patterns will get tested along with dsp intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164746 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMIPS DSP: add vector load/store patterns.
Akira Hatanaka [Thu, 27 Sep 2012 01:50:59 +0000 (01:50 +0000)]
MIPS DSP: add vector load/store patterns.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164744 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix of hang during Intel JIT profiling
Andrew Kaylor [Wed, 26 Sep 2012 23:43:56 +0000 (23:43 +0000)]
Fix of hang during Intel JIT profiling
Committed on behalf of Kirill Uhanov

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164736 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoBuildbot Fix.
Bill Wendling [Wed, 26 Sep 2012 23:38:00 +0000 (23:38 +0000)]
Buildbot Fix.

This method can be called with a '0' argument which checks the return
value. However, the method it calls doesn't expect '0' as a valid value. Call the
correct method when it's 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164735 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDisable the new SROA pass to get the tree back in working order. We don't yet
Nick Lewycky [Wed, 26 Sep 2012 22:43:04 +0000 (22:43 +0000)]
Disable the new SROA pass to get the tree back in working order. We don't yet
have testcases for the current problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164731 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.
Dan Gohman [Wed, 26 Sep 2012 22:17:14 +0000 (22:17 +0000)]
Add IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164728 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoQuery the parameter attributes directly instead of using the Attribute symbols.
Bill Wendling [Wed, 26 Sep 2012 22:15:19 +0000 (22:15 +0000)]
Query the parameter attributes directly instead of using the Attribute symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164727 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the `hasFnAttr' method from Function.
Bill Wendling [Wed, 26 Sep 2012 21:48:26 +0000 (21:48 +0000)]
Remove the `hasFnAttr' method from Function.

The hasFnAttr method has been replaced by querying the Attributes explicitly. No
intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164725 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86_32: Large Symbol+Offset relocations.
Jim Grosbach [Wed, 26 Sep 2012 21:27:45 +0000 (21:27 +0000)]
X86_32: Large Symbol+Offset relocations.

If the offset is more than 24-bits, it won't fit in a scattered
relocation offset field, so we fall back to using a non-scattered
relocation.

rdar://12358909

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164724 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInitial commit for the AttributesImpl class.
Bill Wendling [Wed, 26 Sep 2012 21:07:29 +0000 (21:07 +0000)]
Initial commit for the AttributesImpl class.

This opaque class will contain all of the attributes. All attribute queries will
go through this object. This object will also be uniqued in the LLVMContext.
Currently not used, so no implementation change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164722 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd case clauses for returning dsp accumulator encoding values in function
Akira Hatanaka [Wed, 26 Sep 2012 19:27:24 +0000 (19:27 +0000)]
Add case clauses for returning dsp accumulator encoding values in function
getMipsRegisterNumbering.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164720 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd DSP accumulator registers and register class. Remove hi/lo registers.
Akira Hatanaka [Wed, 26 Sep 2012 19:25:21 +0000 (19:25 +0000)]
Add DSP accumulator registers and register class. Remove hi/lo registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164719 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDelete member MipsFunctionInfo::OutArgFIRange and code that accesses it.
Akira Hatanaka [Wed, 26 Sep 2012 19:18:19 +0000 (19:18 +0000)]
Delete member MipsFunctionInfo::OutArgFIRange and code that accesses it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164718 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for detecting some corei7-class Xeons.
Benjamin Kramer [Wed, 26 Sep 2012 18:21:47 +0000 (18:21 +0000)]
Add support for detecting some corei7-class Xeons.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164714 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoNow that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
Duncan Sands [Wed, 26 Sep 2012 17:16:01 +0000 (17:16 +0000)]
Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)
teach the callgraph logic to not create callgraph edges to intrinsics for invoke
instructions; it already skips this for call instructions.  Fixes PR13903.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164707 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoYAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.
Benjamin Kramer [Wed, 26 Sep 2012 15:52:15 +0000 (15:52 +0000)]
YAMLParser: Fix invalid reads when encountering incorrectly quoted scalar.

Fixes PR12632.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164701 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unneeded and invalid SetInsertPoint calls from unittest.
Benjamin Kramer [Wed, 26 Sep 2012 15:16:05 +0000 (15:16 +0000)]
Remove unneeded and invalid SetInsertPoint calls from unittest.

BB->end() returns a sentinel value that is not a legal insert point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164699 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAPFloat::roundToIntegral: Special values don't keep the exponent value up to date...
Benjamin Kramer [Wed, 26 Sep 2012 14:06:58 +0000 (14:06 +0000)]
APFloat::roundToIntegral: Special values don't keep the exponent value up to date, don't rely on it.

Add a couple of unit tests for special floats. Fixes 13929, found by MemorySanitizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164698 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAddress Duncan's comments on r164684:
Hans Wennborg [Wed, 26 Sep 2012 14:01:53 +0000 (14:01 +0000)]
Address Duncan's comments on r164684:

- Put statistics in alphabetical order
- Don't use getZextValue when building TableInt, just use APInts
- Introduce Create{Z,S}ExtOrTrunc in IRBuilder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164696 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAddress Duncan's comments on r164682:
Hans Wennborg [Wed, 26 Sep 2012 11:07:37 +0000 (11:07 +0000)]
Address Duncan's comments on r164682:

- Finish assert messages with exclamation mark
- Move overflow checking into ShouldBuildLookupTable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164692 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAnalogous fix to memset and memcpy rewriting. Don't have a test case
Chandler Carruth [Wed, 26 Sep 2012 10:59:22 +0000 (10:59 +0000)]
Analogous fix to memset and memcpy rewriting. Don't have a test case
contrived for these yet, as I spotted them by inspection and the test
cases are a bit more tricky to phrase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164691 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen rewriting the pointer operand to a load or store which has
Chandler Carruth [Wed, 26 Sep 2012 10:45:28 +0000 (10:45 +0000)]
When rewriting the pointer operand to a load or store which has
alignment guarantees attached, re-compute the alignment so that we
consider offsets which impact alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164690 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach all of the loads, stores, memsets and memcpys created by the
Chandler Carruth [Wed, 26 Sep 2012 10:27:46 +0000 (10:27 +0000)]
Teach all of the loads, stores, memsets and memcpys created by the
rewriter in SROA to carry a proper alignment. This involves
interrogating various sources of alignment, etc. This is a more complete
and principled fix to PR13920 as well as related bugs pointed out by Eli
in review and by inspection in the area.

Also by inspection fix the integer and vector promotion paths to create
aligned loads and stores. I still need to work up test cases for
these... Sorry for the delay, they were found purely by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164689 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd some convenience methods to IRBuilder for constructing aligned loads
Chandler Carruth [Wed, 26 Sep 2012 10:27:40 +0000 (10:27 +0000)]
Add some convenience methods to IRBuilder for constructing aligned loads
and stores. These will be used in subsequnet patches to SROA to more
systematically manage the alignment on loads and stores.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164688 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM/atomicrmw_minmax.ll: Fix RUN line.
NAKAMURA Takumi [Wed, 26 Sep 2012 10:12:20 +0000 (10:12 +0000)]
ARM/atomicrmw_minmax.ll: Fix RUN line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164687 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix tests that didn't test anything.
Benjamin Kramer [Wed, 26 Sep 2012 09:51:39 +0000 (09:51 +0000)]
Fix tests that didn't test anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164686 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix ordering of operands on lowering of atomicrmw min/max nodes on ARM.
James Molloy [Wed, 26 Sep 2012 09:48:32 +0000 (09:48 +0000)]
Fix ordering of operands on lowering of atomicrmw min/max nodes on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164685 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplifyCFG: Make the switch-to-lookup table transformation store the
Hans Wennborg [Wed, 26 Sep 2012 09:44:49 +0000 (09:44 +0000)]
SimplifyCFG: Make the switch-to-lookup table transformation store the
tables in bitmaps when they fit in a target-legal register.

This saves some space, and it also allows for building tables that would
otherwise be deemed too sparse.

One interesting case that this hits is example 7 from
http://blog.regehr.org/archives/320. We currently generate good code
for this when lowering the switch to the selection DAG: we build a
bitmask to decide whether to jump to one block or the other. My patch
will result in the same bitmask, but it removes the need for the jump,
as the return value can just be retrieved from the mask.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164684 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplifyCFG: Refactor the switch-to-lookup table transformation by
Hans Wennborg [Wed, 26 Sep 2012 09:34:53 +0000 (09:34 +0000)]
SimplifyCFG: Refactor the switch-to-lookup table transformation by
breaking out the building of lookup tables into a separate class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164682 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.
NAKAMURA Takumi [Wed, 26 Sep 2012 09:24:12 +0000 (09:24 +0000)]
llvm/test/CodeGen/X86/mulx*.ll: Fix copypasto.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164681 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe assumption that /proc/self/exe always exists is incorrect.
Sylvestre Ledru [Wed, 26 Sep 2012 08:30:35 +0000 (08:30 +0000)]
The assumption that /proc/self/exe always exists is incorrect.
For example, under a Linux chroot, /proc/ might not be mounted.
Therefor, we test if this file exist. If it is the case, use it (the current
behavior). Otherwise, we fall back to the detection used by *BSD.

The issue has been reported initially on the Debian bug tracker:
http://bugs.debian.org/674588

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164676 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd SARX/SHRX/SHLX code generation support
Michael Liao [Wed, 26 Sep 2012 08:26:25 +0000 (08:26 +0000)]
Add SARX/SHRX/SHLX code generation support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164675 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd RORX code generation support
Michael Liao [Wed, 26 Sep 2012 08:24:51 +0000 (08:24 +0000)]
Add RORX code generation support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164674 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd MULX code generation support
Michael Liao [Wed, 26 Sep 2012 08:22:37 +0000 (08:22 +0000)]
Add MULX code generation support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164673 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach the 'lint' sanity checking pass to detect simple buffer overflows.
Duncan Sands [Wed, 26 Sep 2012 07:45:36 +0000 (07:45 +0000)]
Teach the 'lint' sanity checking pass to detect simple buffer overflows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164671 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r164663 due to buildbot failure.
Craig Topper [Wed, 26 Sep 2012 07:43:06 +0000 (07:43 +0000)]
Revert r164663 due to buildbot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164670 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert the business end of r164636 and try again. I'll come in again. ;]
Chandler Carruth [Wed, 26 Sep 2012 07:41:40 +0000 (07:41 +0000)]
Revert the business end of r164636 and try again. I'll come in again. ;]

This should really, really fix PR13916. For real this time. The
underlying bug is... a bit more subtle than I had imagined.

The setup is a code pattern that leads to an @llvm.memcpy call with two
equal pointers to an alloca in the source and dest. Now, not any pattern
will do. The alloca needs to be formed just so, and both pointers should
be wrapped in different bitcasts etc. When this precise pattern hits,
a funny sequence of events transpires. First, we correctly detect the
potential for overlap, and correctly optimize the memcpy. The first
time. However, we do simplify the set of users of the alloca, and that
causes us to run the alloca back through the SROA pass in case there are
knock-on simplifications. At this point, a curious thing has happened.
If we happen to have an i8 alloca, we have direct i8 pointer values. So
we don't bother creating a cast, we rewrite the arguments to the memcpy
to dircetly refer to the alloca.

Now, in an unrelated area of the pass, we have clever logic which
ensures that when visiting each User of a particular pointer derived
from an alloca, we only visit that User once, and directly inspect all
of its operands which refer to that particular pointer value. However,
the mechanism used to detect memcpy's with the potential to overlap
relied upon getting visited once per *Use*, not once per *User*. This is
always true *unless* the same exact value is both source and dest. It
turns out that almost nothing actually produces that pattern though.

We can hand craft test cases that more directly test this behavior of
course, and those are included. Also, note that there is a significant
missed optimization here -- we prove in many cases that there is
a non-volatile memcpy call with identical source and dest addresses. We
shouldn't prevent splitting the alloca in that case, and in fact we
should just remove such memcpy calls eagerly. I'll address that in
a subsequent commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164669 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd is16BitVector and is32BitVector to MVT and call them from EVT. Matches other...
Craig Topper [Wed, 26 Sep 2012 07:17:37 +0000 (07:17 +0000)]
Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164668 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace calls to getSizeInBits with getExtendedSizeInBits since its already known...
Craig Topper [Wed, 26 Sep 2012 07:11:42 +0000 (07:11 +0000)]
Replace calls to getSizeInBits with getExtendedSizeInBits since its already known its an extended type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164667 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename virtual table anchors from Anchor() to anchor() for consistency with the rest...
Craig Topper [Wed, 26 Sep 2012 06:36:36 +0000 (06:36 +0000)]
Rename virtual table anchors from Anchor() to anchor() for consistency with the rest of the tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164666 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove hasNoAVX method. Can just invert hasAVX instead.
Craig Topper [Wed, 26 Sep 2012 06:29:37 +0000 (06:29 +0000)]
Remove hasNoAVX method. Can just invert hasAVX instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164664 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMark extended type querying methods as 'readonly' to reduce compile size.
Craig Topper [Wed, 26 Sep 2012 06:28:26 +0000 (06:28 +0000)]
Mark extended type querying methods as 'readonly' to reduce compile size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164663 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGenerate an error message instead of asserting or segfaulting when we have a
Bill Wendling [Wed, 26 Sep 2012 06:16:18 +0000 (06:16 +0000)]
Generate an error message instead of asserting or segfaulting when we have a
scalar-to-vector conversion that we cannot handle. For instance, when an invalid
constraint is used in an inline asm statement.
<rdar://problem/12284092>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164662 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd 'lock' prefix output support in assembly printer
Michael Liao [Wed, 26 Sep 2012 05:13:44 +0000 (05:13 +0000)]
Add 'lock' prefix output support in assembly printer

- Instead of embedding 'lock' into each mnemonic of atomic
  instructions except 'xchg', we teach X86 assembly printer to output 'lock'
  prefix similar to or consistent with code emitter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164659 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGenerate an error message instead of asserting or segfaulting when we have a
Bill Wendling [Wed, 26 Sep 2012 04:04:19 +0000 (04:04 +0000)]
Generate an error message instead of asserting or segfaulting when we have a
scalar-to-vector conversion that we cannot handle. For instance, when an invalid
constraint is used in an inline asm statement.
<rdar://problem/12284092>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164657 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExpansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
Michael Ilseman [Wed, 26 Sep 2012 01:55:01 +0000 (01:55 +0000)]
Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.

Fixed issue with Release build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164654 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Add --program-prefix support to build"
Jordan Rose [Wed, 26 Sep 2012 00:01:00 +0000 (00:01 +0000)]
Revert "Add --program-prefix support to build"

The Apple buildbots are set up to pass --target to configure for both
cross- and non-cross-compile builds, and the standard autoconf response
to this is to set the program prefix to '<target>-'. Until we can figure
out the proper way to handle this (don't pass --target? pass an explicit
--program-prefix=""? don't auto-populate program_prefix with target_alias?)
it's more important to keep the buildbots running.

This reverts r164633 / ba48ceb1a3802e20e781ef04ea2573ffae2ac414.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164651 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInitialize boolean variables in MipsSubtarget's constructor.
Akira Hatanaka [Tue, 25 Sep 2012 23:07:11 +0000 (23:07 +0000)]
Initialize boolean variables in MipsSubtarget's constructor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164642 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't drop the alignment on a memcpy intrinsic when producing a store. This is
Nick Lewycky [Tue, 25 Sep 2012 22:46:21 +0000 (22:46 +0000)]
Don't drop the alignment on a memcpy intrinsic when producing a store. This is
only a missed optimization opportunity if the store is over-aligned, but a
miscompile if the store's new type has a higher natural alignment than the
memcpy did. Fixes PR13920!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164641 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoblank line for test commit
Reed Kotler [Tue, 25 Sep 2012 22:34:20 +0000 (22:34 +0000)]
blank line for test commit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164640 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert the business end of r164634, and replace it with a different fix. The
Nick Lewycky [Tue, 25 Sep 2012 21:50:37 +0000 (21:50 +0000)]
Revert the business end of r164634, and replace it with a different fix. The
reason we were getting two of the same alloca is because of a memmove/memcpy
which had the same alloca in both the src and dest. Now we detect that case
directly. This has the same testcase as before, but fixes a clang test
CodeGenObjC/exceptions.m which runs clang -O2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164636 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't try to promote the same alloca twice. Fixes PR13916!
Nick Lewycky [Tue, 25 Sep 2012 21:15:50 +0000 (21:15 +0000)]
Don't try to promote the same alloca twice. Fixes PR13916!

Chandler, it's not obvious that it's okay that this alloca gets into the list
twice to begin with. Please review and see whether this is the fix you really
want, but I wanted to get a fix checked in quickly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164634 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd --program-prefix support to build
Sebastian Pop [Tue, 25 Sep 2012 21:15:08 +0000 (21:15 +0000)]
Add --program-prefix support to build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164633 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove remaining methods inside the Attributes class. Merge the 'Attribute' namespaces.
Bill Wendling [Tue, 25 Sep 2012 20:57:48 +0000 (20:57 +0000)]
Move remaining methods inside the Attributes class. Merge the 'Attribute' namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164631 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Sphinxify HowToSubmitABug
Sean Silva [Tue, 25 Sep 2012 20:52:04 +0000 (20:52 +0000)]
docs: Sphinxify HowToSubmitABug

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164630 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove Attribute::typeIncompatible inside of the Attributes class.
Bill Wendling [Tue, 25 Sep 2012 20:38:59 +0000 (20:38 +0000)]
Move Attribute::typeIncompatible inside of the Attributes class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164629 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTargetLowering interface to set/get minimum block entries for jump tables.
Sebastian Pop [Tue, 25 Sep 2012 20:35:36 +0000 (20:35 +0000)]
TargetLowering interface to set/get minimum block entries for jump tables.

Provide interface in TargetLowering to set or get the minimum number of basic
blocks whereby jump tables are generated for switch statements rather than an
if sequence.

    getMinimumJumpTableEntries() defaults to 4.
    setMinimumJumpTableEntries() allows target configuration.

    This patch changes the default for the Hexagon architecture to 5
    as it improves performance on some benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164628 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r164614 to appease the buildbots.
Chad Rosier [Tue, 25 Sep 2012 19:57:20 +0000 (19:57 +0000)]
Revert r164614 to appease the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164627 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake this test check the transforms it's actually doing. Also add a test that it
Nick Lewycky [Tue, 25 Sep 2012 18:17:38 +0000 (18:17 +0000)]
Make this test check the transforms it's actually doing. Also add a test that it
doesn't transform the trivially unsafe case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164617 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd missing i64 max/min/umax/umin on 32-bit target
Michael Liao [Tue, 25 Sep 2012 18:08:13 +0000 (18:08 +0000)]
Add missing i64 max/min/umax/umin on 32-bit target

- Turn on atomic6432.ll and add specific test case as well

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164616 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: Darwin BL/BLX relocations to out-of-range symbols.
Jim Grosbach [Tue, 25 Sep 2012 18:07:17 +0000 (18:07 +0000)]
ARM: Darwin BL/BLX relocations to out-of-range symbols.

When a BL/BLX references a symbol in the same translation unit that is
out of range, use an external relocation. The linker will use this to
generate a branch island rather than a direct reference, allowing the
relocation to resolve correctly.

rdar://12359919

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164615 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExpansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
Michael Ilseman [Tue, 25 Sep 2012 17:56:47 +0000 (17:56 +0000)]
Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164614 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConsistently specify the assembly variant to MatchInstructionImpl.
Bob Wilson [Tue, 25 Sep 2012 17:19:29 +0000 (17:19 +0000)]
Consistently specify the assembly variant to MatchInstructionImpl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164611 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a case where SROA did not correctly detect dead PHI or selects due
Chandler Carruth [Tue, 25 Sep 2012 10:03:40 +0000 (10:03 +0000)]
Fix a case where SROA did not correctly detect dead PHI or selects due
to chains or cycles between PHIs and/or selects. Also add a couple of
really nice test cases reduced from Kostya's reports in PR13905 and
PR13906. Both are fixed by this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164596 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChange the way the lint sanity checking pass detects misaligned memory accesses.
Duncan Sands [Tue, 25 Sep 2012 10:00:49 +0000 (10:00 +0000)]
Change the way the lint sanity checking pass detects misaligned memory accesses.
Previously it was only be able to detect problems if the pointer was a numerical
value (eg inttoptr i32 1 to i32*), but not if it was an alloca or globa.  The
reason was the use of ComputeMaskedBits: imagine you have "alloca i8, align 2",
and ask ComputeMaskedBits what it knows about the bits of the alloca pointer.
It can tell you that the bottom bit is known zero (due to align 2) but it can't
tell you that bit 1 is known one.  That's because the address could be an even
multiple of 2 rather than an odd multiple, eg it might be a multiple of 4.  Thus
trying to use KnownOne is ineffective in the case of an alloca as it will never
have any bits set.  Instead look explicitly for constant offsets from allocas
and globals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164595 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix an illegal tailcall opt where the callee returns a double via xmm while caller...
Evan Cheng [Tue, 25 Sep 2012 05:32:34 +0000 (05:32 +0000)]
Fix an illegal tailcall opt where the callee returns a double via xmm while caller returns x86_fp80 via st0. rdar://12229511

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164588 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a -Wparentheses warning in the mingw build
Nico Weber [Tue, 25 Sep 2012 05:24:16 +0000 (05:24 +0000)]
Fix a -Wparentheses warning in the mingw build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164587 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a crash in SROA. This was reported independently by Takumi and
Chandler Carruth [Tue, 25 Sep 2012 02:42:03 +0000 (02:42 +0000)]
Fix a crash in SROA. This was reported independently by Takumi and
David (I think), but I would appreciate folks verifying that this fixes
the big crasher.

I'm still working on a reduced test case, but because this was causing
problems I wanted to get the fix checked in quickly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164585 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't forget that strcpy and friends return a pointer to the destination, so
Nick Lewycky [Tue, 25 Sep 2012 01:55:59 +0000 (01:55 +0000)]
Don't forget that strcpy and friends return a pointer to the destination, so
it's not a dead store if that pointer is used. Whoops!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164583 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUnit tests for IntegerDivision. Currently, just a basic sanity check to ensure that...
Michael Ilseman [Tue, 25 Sep 2012 01:33:33 +0000 (01:33 +0000)]
Unit tests for IntegerDivision. Currently, just a basic sanity check to ensure that the code was generated properly. Future work would be finding some way to test the actual result that would be computed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164582 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: 'add Rd, pc, #imm' is an alias for 'adr Rd, #imm'.
Jim Grosbach [Tue, 25 Sep 2012 00:08:13 +0000 (00:08 +0000)]
ARM: 'add Rd, pc, #imm' is an alias for 'adr Rd, #imm'.

rdar://9795790

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164577 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused name of variable to quiet a warning. Also canonicalize a
Nick Lewycky [Mon, 24 Sep 2012 23:47:23 +0000 (23:47 +0000)]
Remove unused name of variable to quiet a warning. Also canonicalize a
declaration to use the same form as in the rest of the file. No functionality
change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164576 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMark jump tables in code sections with DataRegion directives.
Jim Grosbach [Mon, 24 Sep 2012 23:06:27 +0000 (23:06 +0000)]
Mark jump tables in code sections with DataRegion directives.

Even out-of-line jump tables can be in the code section, so mark them
as data-regions for those targets which support the directives.

rdar://12362871&12362974

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164571 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTypo.
Chad Rosier [Mon, 24 Sep 2012 23:04:25 +0000 (23:04 +0000)]
Typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164570 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRather then have a wrapper function, have tblgen instantiate the implementation.
Chad Rosier [Mon, 24 Sep 2012 22:57:55 +0000 (22:57 +0000)]
Rather then have a wrapper function, have tblgen instantiate the implementation.
Also remove an unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164567 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClear UNIVERSAL_SDK_PATH setting when building host tools. <rdar://12360497>
Bob Wilson [Mon, 24 Sep 2012 22:51:19 +0000 (22:51 +0000)]
Clear UNIVERSAL_SDK_PATH setting when building host tools.  <rdar://12360497>

I also moved the SDKROOT setting into the make flags, since clearing it from
the environment isn't good enough to override a setting on the make command
line.  That hasn't been a problem but it could be, and it's good to be
consistent with the way UNIVERSAL_SDK_PATH is handled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164565 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach DSE that strcpy, strncpy, strcat and strncat are all stores which may be
Nick Lewycky [Mon, 24 Sep 2012 22:09:10 +0000 (22:09 +0000)]
Teach DSE that strcpy, strncpy, strcat and strncat are all stores which may be
dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164561 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove all the calls to AA.getTargetLibraryInfo() to using a TLI member variable.
Nick Lewycky [Mon, 24 Sep 2012 22:07:09 +0000 (22:07 +0000)]
Move all the calls to AA.getTargetLibraryInfo() to using a TLI member variable.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164560 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSpecify MachinePointerInfo as refering to the argument value and offset of the
Roman Divacky [Mon, 24 Sep 2012 20:47:19 +0000 (20:47 +0000)]
Specify MachinePointerInfo as refering to the argument value and offset of the
store when handling byval arguments. Thus preventing reordering of the store
with load with post-RA scheduler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164553 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRather then have a wrapper function, have tblgen instantiate the implementation.
Chad Rosier [Mon, 24 Sep 2012 19:32:29 +0000 (19:32 +0000)]
Rather then have a wrapper function, have tblgen instantiate the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164548 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd missing : in CHECK line.
Richard Osborne [Mon, 24 Sep 2012 17:22:43 +0000 (17:22 +0000)]
Add missing : in CHECK line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164540 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd missing check for presence of target data.
Richard Osborne [Mon, 24 Sep 2012 17:10:03 +0000 (17:10 +0000)]
Add missing check for presence of target data.

This avoids a crash in visitAllocaInst when target data isn't available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164539 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable the new SROA pass by default.
Chandler Carruth [Mon, 24 Sep 2012 01:10:25 +0000 (01:10 +0000)]
Enable the new SROA pass by default.

Queue the fallout. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164480 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAddress one of the original FIXMEs for the new SROA pass by implementing
Chandler Carruth [Mon, 24 Sep 2012 00:34:20 +0000 (00:34 +0000)]
Address one of the original FIXMEs for the new SROA pass by implementing
integer promotion analogous to vector promotion. When there is an
integer alloca being accessed both as its integer type and as a narrower
integer type, promote the narrower access to "insert" and "extract" the
smaller integer from the larger one, and make the integer alloca
a candidate for promotion.

In the new formulation, we don't care about target legal integer or use
thresholds to control things. Instead, we only perform this promotion to
an integer type which the frontend has already emitted a load or store
for. This bounds the scope and prevents optimization passes from
coalescing larger and larger entities into a single integer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164479 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEmit dtors into proper section while compiling in vcpp-compatible mode.
Anton Korobeynikov [Sun, 23 Sep 2012 15:53:47 +0000 (15:53 +0000)]
Emit dtors into proper section while compiling in vcpp-compatible mode.
Patch by Kai!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164476 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSwitch to a signed representation for the dynamic offsets while walking
Chandler Carruth [Sun, 23 Sep 2012 11:43:14 +0000 (11:43 +0000)]
Switch to a signed representation for the dynamic offsets while walking
across the uses of the alloca. It's entirely possible for negative
numbers to come up here, and in some rare cases simply doing the 2's
complement arithmetic isn't the correct decision. Notably, we can't zext
the index of the GEP. The definition of GEP is that these offsets are
sign extended or truncated to the size of the pointer, and then wrapping
2's complement arithmetic used.

This patch fixes an issue that comes up with *no* input from the
buildbots or bootstrap afaict. The only place where it manifested,
disturbingly, is Clang's own regression test suite. A reduced and
targeted collection of tests are added to cope with this. Note that I've
tried to pin down the potential cases of overflow, but may have missed
some cases. I've tried to add a few cases to test this, but its hard
because LLVM has quite limited support for >64bit constructs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164475 91177308-0d34-0410-b5e6-96231b3b80d8