oota-llvm.git
14 years agoFix typos.
Dan Gohman [Thu, 18 Nov 2010 17:44:17 +0000 (17:44 +0000)]
Fix typos.

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

14 years agoDocument the units for the Size field.
Dan Gohman [Thu, 18 Nov 2010 17:39:01 +0000 (17:39 +0000)]
Document the units for the Size field.

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

14 years agoBounds-check APInt's operator[].
Dan Gohman [Thu, 18 Nov 2010 17:14:56 +0000 (17:14 +0000)]
Bounds-check APInt's operator[].

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

14 years agoExpandPseudos doesn't have any dependencies, so it can use the
Dan Gohman [Thu, 18 Nov 2010 17:14:05 +0000 (17:14 +0000)]
ExpandPseudos doesn't have any dependencies, so it can use the
simple form of INITIALIZE_PASS.

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

14 years agoStrip trailing whitespace.
Dan Gohman [Thu, 18 Nov 2010 17:06:31 +0000 (17:06 +0000)]
Strip trailing whitespace.

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

14 years agoUse llvm_unreachable for "impossible" situations.
Dan Gohman [Thu, 18 Nov 2010 17:05:57 +0000 (17:05 +0000)]
Use llvm_unreachable for "impossible" situations.

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

14 years agoAdd support for PHI-translating sext, zext, and trunc instructions,
Dan Gohman [Thu, 18 Nov 2010 17:05:13 +0000 (17:05 +0000)]
Add support for PHI-translating sext, zext, and trunc instructions,
enabling more PRE. PR8586.

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

14 years agoslightly simplify code and substantially improve comment. Instead of
Chris Lattner [Thu, 18 Nov 2010 08:07:09 +0000 (08:07 +0000)]
slightly simplify code and substantially improve comment.  Instead of
saying "it would be bad", give an example of what is going on.

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

14 years agoremove a pointless restriction from memcpyopt. It was
Chris Lattner [Thu, 18 Nov 2010 08:00:57 +0000 (08:00 +0000)]
remove a pointless restriction from memcpyopt.  It was
refusing to optimize two memcpy's like this:

copy A <- B
copy C <- A

if it couldn't prove that noalias(B,C).  We can eliminate
the copy by producing a memmove instead of memcpy.

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

14 years agofilecheckize, this is still not optimal, see PR8643
Chris Lattner [Thu, 18 Nov 2010 07:49:32 +0000 (07:49 +0000)]
filecheckize, this is still not optimal, see PR8643

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

14 years agoremove another pointless noalias check: M is a memcpy, so the
Chris Lattner [Thu, 18 Nov 2010 07:39:57 +0000 (07:39 +0000)]
remove another pointless noalias check: M is a memcpy, so the
source and dest are known to not overlap.

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

14 years agouse AA::isNoAlias instead of open coding it. Remove an extraneous noalias check:
Chris Lattner [Thu, 18 Nov 2010 07:38:43 +0000 (07:38 +0000)]
use AA::isNoAlias instead of open coding it.  Remove an extraneous noalias check:
there is no need to check to see if the source and dest of a memcpy are noalias,
behavior is undefined if not.

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

14 years agofinish a thought.
Chris Lattner [Thu, 18 Nov 2010 07:32:33 +0000 (07:32 +0000)]
finish a thought.

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

14 years agorearrange some code, splitting memcpy/memcpy optimization
Chris Lattner [Thu, 18 Nov 2010 07:02:37 +0000 (07:02 +0000)]
rearrange some code, splitting memcpy/memcpy optimization
out of processMemCpy into its own function.

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

14 years agoallow eliminating an alloca that is just copied from an constant global
Chris Lattner [Thu, 18 Nov 2010 06:41:51 +0000 (06:41 +0000)]
allow eliminating an alloca that is just copied from an constant global
if it is passed as a byval argument.  The byval argument will just be a
read, so it is safe to read from the original global instead.  This allows
us to promote away the %agg.tmp alloca in PR8582

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

14 years agoenhance the "alloca is just a memcpy from constant global"
Chris Lattner [Thu, 18 Nov 2010 06:26:49 +0000 (06:26 +0000)]
enhance the "alloca is just a memcpy from constant global"
to ignore calls that obviously can't modify the alloca
because they are readonly/readnone.

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

14 years agofix a small oversight in the "eliminate memcpy from constant global"
Chris Lattner [Thu, 18 Nov 2010 06:20:47 +0000 (06:20 +0000)]
fix a small oversight in the "eliminate memcpy from constant global"
optimization.  If the alloca that is "memcpy'd from constant" also has
a memcpy from *it*, ignore it: it is a load.  We now optimize the testcase to:

define void @test2() {
  %B = alloca %T
  %a = bitcast %T* @G to i8*
  %b = bitcast %T* %B to i8*
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false)
  call void @bar(i8* %b)
  ret void
}

previously we would generate:

define void @test() {
  %B = alloca %T
  %b = bitcast %T* %B to i8*
  %G.0 = getelementptr inbounds %T* @G, i32 0, i32 0
  %tmp3 = load i8* %G.0, align 4
  %G.1 = getelementptr inbounds %T* @G, i32 0, i32 1
  %G.15 = bitcast [123 x i8]* %G.1 to i8*
  %1 = bitcast [123 x i8]* %G.1 to i984*
  %srcval = load i984* %1, align 1
  %B.0 = getelementptr inbounds %T* %B, i32 0, i32 0
  store i8 %tmp3, i8* %B.0, align 4
  %B.1 = getelementptr inbounds %T* %B, i32 0, i32 1
  %B.12 = bitcast [123 x i8]* %B.1 to i8*
  %2 = bitcast [123 x i8]* %B.1 to i984*
  store i984 %srcval, i984* %2, align 1
  call void @bar(i8* %b)
  ret void
}

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

14 years agofilecheckize
Chris Lattner [Thu, 18 Nov 2010 06:16:43 +0000 (06:16 +0000)]
filecheckize

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

14 years agotrivial QoI improvement. On this invalid input:
Chris Lattner [Thu, 18 Nov 2010 02:53:02 +0000 (02:53 +0000)]
trivial QoI improvement.  On this invalid input:
  sahf movl 344(%rdi),%r14d
we used to produce:

t.s:2:1: error: unexpected token in argument list

^

we now produce:
t.s:1:11: error: unexpected token in argument list
sahf movl 344(%rdi),%r14d
          ^

rdar://8581401

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

14 years agopatch from Frits van Bommel:
Chris Lattner [Thu, 18 Nov 2010 02:15:42 +0000 (02:15 +0000)]
patch from Frits van Bommel:

The attached patch fixes IRBuilder and the NoFolder class so that when
NoFolder is used the instructions it generates are treated just like
the ones IRBuilder creates directly (insert into block, assign them a
name and debug info, as applicable).
It does this by
1) having NoFolder return Instruction*s instead of Value*s,
2) having IRBuilder call Insert(Value, Name) on values obtained from
the folder like it does on instructions it creates directly, and
3) adding an Insert(Constant*, const Twine& = "") overload which just
returns the constant so that the other folders shouldn't have any
extra overhead as long as inlining is enabled.

While I was there, I also added some missing (CreateFNeg and various
Create*Cast) methods to NoFolder.

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

14 years agoChange CodeGen to use .loc directives. This produces a lot more readable output
Rafael Espindola [Thu, 18 Nov 2010 02:04:25 +0000 (02:04 +0000)]
Change CodeGen to use .loc directives. This produces a lot more readable output
and testing is easier.  A good example is the unknown-location.ll test that
now can just look for ".loc 1 0 0".  We also don't use a DW_LNE_set_address for
every address change anymore.

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

14 years agoSilence compiler warnings.
Evan Cheng [Thu, 18 Nov 2010 01:43:23 +0000 (01:43 +0000)]
Silence compiler warnings.

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

14 years agoRemove trailing whitespace.
Jim Grosbach [Thu, 18 Nov 2010 01:39:50 +0000 (01:39 +0000)]
Remove trailing whitespace.

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

14 years agoARM PseudoInst instructions don't need or use an assembler string. Get rid of
Jim Grosbach [Thu, 18 Nov 2010 01:38:26 +0000 (01:38 +0000)]
ARM PseudoInst instructions don't need or use an assembler string. Get rid of
the operand to the pattern.

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

14 years agoRevert 119600 to unbreak the build. Francois, please investigate.
Jim Grosbach [Thu, 18 Nov 2010 01:38:07 +0000 (01:38 +0000)]
Revert 119600 to unbreak the build. Francois, please investigate.

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

14 years agoDo not throw away alignment when generating the DAG for
Dale Johannesen [Thu, 18 Nov 2010 01:35:23 +0000 (01:35 +0000)]
Do not throw away alignment when generating the DAG for
memset; we may need it to decide between MOVAPS and MOVUPS
later.  Adjust a test that was looking for wrong code.
PR 3866 / 8675131.

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

14 years agoCode clean up.
Evan Cheng [Thu, 18 Nov 2010 01:28:51 +0000 (01:28 +0000)]
Code clean up.

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

14 years agoAdd FIXME.
Jim Grosbach [Thu, 18 Nov 2010 01:20:48 +0000 (01:20 +0000)]
Add FIXME.

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

14 years agoRefactor the ARM PICADD and PICLDR* instructions to really be pseudos and not
Jim Grosbach [Thu, 18 Nov 2010 01:15:56 +0000 (01:15 +0000)]
Refactor the ARM PICADD and PICLDR* instructions to really be pseudos and not
just pretend to be.

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

14 years agoTry again at providing Thumb2 encodings for basic multiplication operators.
Owen Anderson [Thu, 18 Nov 2010 01:08:42 +0000 (01:08 +0000)]
Try again at providing Thumb2 encodings for basic multiplication operators.

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

14 years agoAppease MSVC 2008: you can't use keyword this inside EXPECT_EQ().
Francois Pichet [Thu, 18 Nov 2010 00:59:50 +0000 (00:59 +0000)]
Appease MSVC 2008: you can't use keyword this inside EXPECT_EQ().
This is because of bug 331418 on Microsoft Connect.

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

14 years agoFixed to use input redirection for source - to eliminate .s output.
John Thompson [Thu, 18 Nov 2010 00:50:20 +0000 (00:50 +0000)]
Fixed to use input redirection for source - to eliminate .s output.

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

14 years agoRefactor a few ARM load instructions to better parameterize things and re-use
Jim Grosbach [Thu, 18 Nov 2010 00:46:58 +0000 (00:46 +0000)]
Refactor a few ARM load instructions to better parameterize things and re-use
common encoding information.

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

14 years agoRevert r119593 while I figure out my testing disagrees with the buildbot.
Owen Anderson [Thu, 18 Nov 2010 00:42:51 +0000 (00:42 +0000)]
Revert r119593 while I figure out my testing disagrees with the buildbot.

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

14 years agoIntroduce memoization for ScalarEvolution dominates and properlyDominates
Dan Gohman [Thu, 18 Nov 2010 00:34:22 +0000 (00:34 +0000)]
Introduce memoization for ScalarEvolution dominates and properlyDominates
queries, and SCEVExpander getRelevantLoop queries.

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

14 years agoProvide correct Thumb2 encodings for basic multiplication operators.
Owen Anderson [Thu, 18 Nov 2010 00:19:10 +0000 (00:19 +0000)]
Provide correct Thumb2 encodings for basic multiplication operators.

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

14 years agoUpdated library dependencies.
Oscar Fuentes [Thu, 18 Nov 2010 00:12:27 +0000 (00:12 +0000)]
Updated library dependencies.

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

14 years agoBug 8621 fix - pointer cast stripped from inline asm constraint argument.
John Thompson [Wed, 17 Nov 2010 23:58:47 +0000 (23:58 +0000)]
Bug 8621 fix - pointer cast stripped from inline asm constraint argument.

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

14 years agoMake MCJIT work with CMake.
Wesley Peck [Wed, 17 Nov 2010 23:35:07 +0000 (23:35 +0000)]
Make MCJIT work with CMake.

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

14 years agoClean up LEApcrel instuction(s) a bit. It's not really a Pseudo, so don't mark
Jim Grosbach [Wed, 17 Nov 2010 23:33:14 +0000 (23:33 +0000)]
Clean up LEApcrel instuction(s) a bit. It's not really a Pseudo, so don't mark
it as such. Add some encoding information.

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

14 years agoFactor out the code for purging a SCEV from all the various memoization maps.
Dan Gohman [Wed, 17 Nov 2010 23:28:48 +0000 (23:28 +0000)]
Factor out the code for purging a SCEV from all the various memoization maps.
Some of these maps may merge in the future, but for now it's convenient to have
a utility function for them.

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

14 years agoMerge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
Dan Gohman [Wed, 17 Nov 2010 23:21:44 +0000 (23:21 +0000)]
Merge the implementations of isLoopInvariant and hasComputableLoopEvolution, and
memoize the results. This improves compile time in code which highly complex
expressions which get queried many times.

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

14 years agoNow that the MBlaze backend is in its own directory, split the test cases into multip...
Wesley Peck [Wed, 17 Nov 2010 22:54:43 +0000 (22:54 +0000)]
Now that the MBlaze backend is in its own directory, split the test cases into multiple files for different types of instructions.

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

14 years agoMake SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand
Dan Gohman [Wed, 17 Nov 2010 22:27:42 +0000 (22:27 +0000)]
Make SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperand
to ScalarEvolution. Delete SCEV::~SCEV. SCEV is no longer virtual.

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

14 years agoSecond attempt at correct encodings for Thumb2 bitfield instructions.
Owen Anderson [Wed, 17 Nov 2010 22:16:31 +0000 (22:16 +0000)]
Second attempt at correct encodings for Thumb2 bitfield instructions.

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

14 years agoFix comment typo.
Jim Grosbach [Wed, 17 Nov 2010 21:57:51 +0000 (21:57 +0000)]
Fix comment typo.

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

14 years agoThese tests are looking for library function names that
Dale Johannesen [Wed, 17 Nov 2010 21:57:32 +0000 (21:57 +0000)]
These tests are looking for library function names that
appear to differ on Linux.  Try to make them pass on Linux.
Would be good for a Linux person to review this.

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

14 years agoMove SCEV::dominates and properlyDominates to ScalarEvolution.
Dan Gohman [Wed, 17 Nov 2010 21:41:58 +0000 (21:41 +0000)]
Move SCEV::dominates and properlyDominates to ScalarEvolution.

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

14 years agoChange ARMGlobalMerge to keep BSS globals in separate pools.
Bob Wilson [Wed, 17 Nov 2010 21:25:39 +0000 (21:25 +0000)]
Change ARMGlobalMerge to keep BSS globals in separate pools.
This completes the fixes for Radar 8673120.

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

14 years agoFix ARMGlobalMerge pass to check if globals are entirely within range.
Bob Wilson [Wed, 17 Nov 2010 21:25:36 +0000 (21:25 +0000)]
Fix ARMGlobalMerge pass to check if globals are entirely within range.
It is generally not sufficient to check if the starting offset is in range
of the maximum offset that can be efficiently used for the target.

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

14 years agoChange the symbol for merged globals from "merged" to "_MergedGlobals".
Bob Wilson [Wed, 17 Nov 2010 21:25:33 +0000 (21:25 +0000)]
Change the symbol for merged globals from "merged" to "_MergedGlobals".
This makes it more clear that the symbol is an internal, compiler-generated
name and gives a little more description about its contents.

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

14 years agoFix the ARMGlobalMerge pass to look at variable sizes instead of pointer sizes.
Bob Wilson [Wed, 17 Nov 2010 21:25:27 +0000 (21:25 +0000)]
Fix the ARMGlobalMerge pass to look at variable sizes instead of pointer sizes.
It was mistakenly looking at the pointer type when checking for the size of
global variables.  This is a partial fix for Radar 8673120.

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

14 years agoMove SCEV::isLoopInvariant and hasComputableLoopEvolution to be member
Dan Gohman [Wed, 17 Nov 2010 21:23:15 +0000 (21:23 +0000)]
Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be member
functions of ScalarEvolution, in preparation for memoization and
other optimizations.

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

14 years agoMake the ARM BR_JTadd instruction an explicit pseudo and lower it properly
Jim Grosbach [Wed, 17 Nov 2010 21:05:55 +0000 (21:05 +0000)]
Make the ARM BR_JTadd instruction an explicit pseudo and lower it properly
in the MC lowering process.

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

14 years agoAvoid isel movcc of large immediates when the large immediate is available in a regis...
Evan Cheng [Wed, 17 Nov 2010 20:56:30 +0000 (20:56 +0000)]
Avoid isel movcc of large immediates when the large immediate is available in a register. These immediates aren't free.

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

14 years agoReference ScalarEvolution by name rather than directly in LICM,
Dan Gohman [Wed, 17 Nov 2010 20:50:07 +0000 (20:50 +0000)]
Reference ScalarEvolution by name rather than directly in LICM,
to avoid an unneeded dependence.

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

14 years agoBefore replacing a phi node with a different value, it
Duncan Sands [Wed, 17 Nov 2010 20:49:12 +0000 (20:49 +0000)]
Before replacing a phi node with a different value, it
needs to be checked that this won't break LCSSA form.
Change the existing checking method to a more direct one:
rather than seeing if all predecessors belong to the loop,
check that the replacing value is either not in any loop or
is in a loop that contains the phi node.

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

14 years agoRevert r119551, which broke buildbots.
Owen Anderson [Wed, 17 Nov 2010 20:48:51 +0000 (20:48 +0000)]
Revert r119551, which broke buildbots.

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

14 years agoVerify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr
Dan Gohman [Wed, 17 Nov 2010 20:48:38 +0000 (20:48 +0000)]
Verify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExpr
instead of in SCEVAddRecExpr's constructor, in preparation for an
upcoming change.

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

14 years agoProvide Thumb2 encodings for bitfield instructions.
Owen Anderson [Wed, 17 Nov 2010 20:35:29 +0000 (20:35 +0000)]
Provide Thumb2 encodings for bitfield instructions.

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

14 years agoFix ScalarEvolution's range memoization to avoid using a
Dan Gohman [Wed, 17 Nov 2010 20:23:08 +0000 (20:23 +0000)]
Fix ScalarEvolution's range memoization to avoid using a
default ctor with ConstantRange.

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

14 years agoRemove ARM isel hacks that fold large immediates into a pair of add, sub, and,
Evan Cheng [Wed, 17 Nov 2010 20:13:28 +0000 (20:13 +0000)]
Remove ARM isel hacks that fold large immediates into a pair of add, sub, and,
and xor. The 32-bit move immediates can be hoisted out of loops by machine
LICM but the isel hacks were preventing them.

Instead, let peephole optimization pass recognize registers that are defined by
immediates and the ARM target hook will fold the immediates in.

Other changes include 1) do not fold and / xor into cmp to isel TST / TEQ
instructions if there are multiple uses. This happens when the 'and' is live
out, machine sink would have sinked the computation and that ends up pessimizing
code. The peephole pass would recognize situations where the 'and' can be
toggled to define CPSR and eliminate the comparison anyway.

2) Move peephole pass to after machine LICM, sink, and CSE to avoid blocking
important optimizations.

rdar://8663787, rdar://8241368

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

14 years agomake isVirtualSection a virtual method on MCSection. Chris' suggestion.
Rafael Espindola [Wed, 17 Nov 2010 20:03:54 +0000 (20:03 +0000)]
make isVirtualSection a virtual method on MCSection. Chris' suggestion.

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

14 years agoMore miscellaneous Thumb2 encodings.
Owen Anderson [Wed, 17 Nov 2010 19:57:38 +0000 (19:57 +0000)]
More miscellaneous Thumb2 encodings.

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

14 years agoadd some justification for "using namespace llvm;"
Chris Lattner [Wed, 17 Nov 2010 19:47:20 +0000 (19:47 +0000)]
add some justification for "using namespace llvm;"

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

14 years agoFix typo.
Jim Grosbach [Wed, 17 Nov 2010 19:30:11 +0000 (19:30 +0000)]
Fix typo.

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

14 years agoAdd missing opcodes now that this function's used in more than one place.
Bill Wendling [Wed, 17 Nov 2010 19:16:20 +0000 (19:16 +0000)]
Add missing opcodes now that this function's used in more than one place.

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

14 years agoInstCombine: Add a missing irem identity (X % X -> 0).
Benjamin Kramer [Wed, 17 Nov 2010 19:11:46 +0000 (19:11 +0000)]
InstCombine: Add a missing irem identity (X % X -> 0).

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

14 years agoMove some those Xor simplifications which don't require creating new
Duncan Sands [Wed, 17 Nov 2010 18:52:15 +0000 (18:52 +0000)]
Move some those Xor simplifications which don't require creating new
instructions out of InstCombine and into InstructionSimplify.  While
there, introduce an m_AllOnes pattern to simplify matching with integers
and vectors with all bits equal to one.

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

14 years agoMore ARM encoding bits. LDRH now encodes properly.
Jim Grosbach [Wed, 17 Nov 2010 18:11:11 +0000 (18:11 +0000)]
More ARM encoding bits. LDRH now encodes properly.

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

14 years agovarious cleanups and other improvements, patch by Zhanyong Wan!
Chris Lattner [Wed, 17 Nov 2010 17:14:55 +0000 (17:14 +0000)]
various cleanups and other improvements, patch by Zhanyong Wan!

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

14 years agoAdd support for .int.
Rafael Espindola [Wed, 17 Nov 2010 16:24:40 +0000 (16:24 +0000)]
Add support for .int.

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

14 years agoAdd support for .2byte, .4byte and .8byte.
Rafael Espindola [Wed, 17 Nov 2010 16:15:42 +0000 (16:15 +0000)]
Add support for .2byte, .4byte and .8byte.
Fixes PR8631.

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

14 years agoMC-JIT: Stub out "pure" streamer.
Daniel Dunbar [Wed, 17 Nov 2010 16:06:47 +0000 (16:06 +0000)]
MC-JIT: Stub out "pure" streamer.
 - No immediate use, but maybe someone feels like hacking on it.

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

14 years agoMCJIT: Stub out MCJIT implementation, still doesn't do anything useful.
Daniel Dunbar [Wed, 17 Nov 2010 16:06:43 +0000 (16:06 +0000)]
MCJIT: Stub out MCJIT implementation, still doesn't do anything useful.

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

14 years agolli: Add stub -use-mcjit option, which doesn't currently do anything.
Daniel Dunbar [Wed, 17 Nov 2010 16:06:37 +0000 (16:06 +0000)]
lli: Add stub -use-mcjit option, which doesn't currently do anything.

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

14 years agoHave InlineFunction use SimplifyInstruction rather than
Duncan Sands [Wed, 17 Nov 2010 11:16:23 +0000 (11:16 +0000)]
Have InlineFunction use SimplifyInstruction rather than
hasConstantValue.  I was leery of using SimplifyInstruction
while the IR was still in a half-baked state, which is the
reason for delaying the simplification until the IR is fully
cooked.

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

14 years agoNow that hasConstantValue has been made simpler, it may return the
Duncan Sands [Wed, 17 Nov 2010 10:23:23 +0000 (10:23 +0000)]
Now that hasConstantValue has been made simpler, it may return the
phi node itself if it occurs in an unreachable basic block.  Protect
against this.  Hopefully this will fix some more buildbots.

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

14 years agoRevert r119109 for now. It's breaking 176.gcc.
Evan Cheng [Wed, 17 Nov 2010 09:31:04 +0000 (09:31 +0000)]
Revert r119109 for now. It's breaking 176.gcc.

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

14 years agoPreviously SimplifyInstruction could report that an instruction
Duncan Sands [Wed, 17 Nov 2010 08:35:29 +0000 (08:35 +0000)]
Previously SimplifyInstruction could report that an instruction
simplified to itself (this can only happen in unreachable blocks).
Change it to return null instead.  Hopefully this will fix some
buildbot failures.

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

14 years agoWith the newly simplified SourceMgr interfaces and the generalized
Chris Lattner [Wed, 17 Nov 2010 08:20:42 +0000 (08:20 +0000)]
With the newly simplified SourceMgr interfaces and the generalized
SrcMgrDiagHandler, we can improve clang diagnostics for inline asm:
instead of reporting them on a source line of the original line,
we can report it on the correct line wherever the string literal came
from. For something like this:

void foo() {
  asm("push %rax\n"
      ".code32\n");
}

we used to get this: (note that the line in t.c isn't helpful)

t.c:4:7: error: warning: ignoring directive for now
  asm("push %rax\n"
      ^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^

now we get:

t.c:5:8: error: warning: ignoring directive for now
      ".code32\n"
       ^
<inline asm>:2:1: note: instantiated into assembly here
.code32
^

Note that we're pointing to line 5 properly now.

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

14 years agonow that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
Chris Lattner [Wed, 17 Nov 2010 08:13:01 +0000 (08:13 +0000)]
now that AsmPrinter::EmitInlineAsm is factored right, we can eliminate the
cookie argument to the SourceMgr diagnostic stuff.  This cleanly separates
LLVMContext's inlineasm handler from the sourcemgr error handling
definition, increasing type safety and cleaning things up.

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

14 years agoAdd simple arithmetics and %type directive for PTX
Che-Liang Chiou [Wed, 17 Nov 2010 08:08:49 +0000 (08:08 +0000)]
Add simple arithmetics and %type directive for PTX

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

14 years agoSimplify code that toggle optional operand to ARM::CPSR.
Evan Cheng [Wed, 17 Nov 2010 08:06:50 +0000 (08:06 +0000)]
Simplify code that toggle optional operand to ARM::CPSR.

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

14 years agorearrange how the handler in SourceMgr is installed, eliminating the use of
Chris Lattner [Wed, 17 Nov 2010 08:03:32 +0000 (08:03 +0000)]
rearrange how the handler in SourceMgr is installed, eliminating the use of
the cookie argument to setDiagHandler

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

14 years agorefactor the interface to EmitInlineAsm a bit, no functionality change.
Chris Lattner [Wed, 17 Nov 2010 07:53:40 +0000 (07:53 +0000)]
refactor the interface to EmitInlineAsm a bit, no functionality change.

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

14 years agofix PR8613 - Copy constructor of SwitchInst does not call SwitchInst::init
Chris Lattner [Wed, 17 Nov 2010 05:41:46 +0000 (05:41 +0000)]
fix PR8613 - Copy constructor of SwitchInst does not call SwitchInst::init

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

14 years agotidy up
Chris Lattner [Wed, 17 Nov 2010 05:41:32 +0000 (05:41 +0000)]
tidy up

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

14 years agoThe machine instruction no longer encodes the submode as a separate operand. We
Bill Wendling [Wed, 17 Nov 2010 05:31:09 +0000 (05:31 +0000)]
The machine instruction no longer encodes the submode as a separate operand. We
should get the submode from the load/store multiple instruction's opcode.

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

14 years agoProper encoding for VLDM and VSTM instructions. The register lists for these
Bill Wendling [Wed, 17 Nov 2010 04:32:08 +0000 (04:32 +0000)]
Proper encoding for VLDM and VSTM instructions. The register lists for these
instructions have to distinguish between lists of single- and double-precision
registers in order for the ASM matcher to do a proper job. In all other
respects, a list of single- or double-precision registers are the same as a list
of GPR registers.

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

14 years agoFix a layering violation: hasConstantValue, which is part of the PHINode
Duncan Sands [Wed, 17 Nov 2010 04:30:22 +0000 (04:30 +0000)]
Fix a layering violation: hasConstantValue, which is part of the PHINode
class, uses DominatorTree which is an analysis.  This change moves all of
the tricky hasConstantValue logic to SimplifyInstruction, and replaces it
with a very simple literal implementation.  I already taught users of
hasConstantValue that need tricky stuff to use SimplifyInstruction instead.
I didn't update InlineFunction because the IR looks like it might be in a
funky state at the point it calls hasConstantValue, which makes calling
SimplifyInstruction dangerous since it can in theory do a lot of tricky
reasoning.  This may be a pessimization, for example in the case where
all phi node operands are either undef or a fixed constant.

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

14 years agoHave ScalarEvolution use SimplifyInstruction rather than hasConstantValue.
Duncan Sands [Wed, 17 Nov 2010 04:18:45 +0000 (04:18 +0000)]
Have ScalarEvolution use SimplifyInstruction rather than hasConstantValue.
While there, add a note about an inefficiency I noticed.

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

14 years agoHave RemovePredecessorAndSimplify you SimplifyInstruction
Duncan Sands [Wed, 17 Nov 2010 04:12:05 +0000 (04:12 +0000)]
Have RemovePredecessorAndSimplify you SimplifyInstruction
rather than hasConstantValue.

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

14 years agoRemove dead code in GVN: now that SimplifyInstruction is called
Duncan Sands [Wed, 17 Nov 2010 04:05:21 +0000 (04:05 +0000)]
Remove dead code in GVN: now that SimplifyInstruction is called
systematically, CollapsePhi will always return null here.  Note
that CollapsePhi did an extra check, isSafeReplacement, which
the SimplifyInstruction logic does not do.  I think that check
was bogus - I guess we will soon find out!  (It was originally
added in commit 41998 without a testcase).

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

14 years agoMemoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
Dan Gohman [Wed, 17 Nov 2010 02:44:44 +0000 (02:44 +0000)]
Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.
This fixes some extreme compile times on unrolled sha512 code.

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

14 years agoFix warnings about missing parents between || and &&.
Dan Gohman [Wed, 17 Nov 2010 02:40:30 +0000 (02:40 +0000)]
Fix warnings about missing parents between || and &&.

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

14 years agoOnly avoid the check if we're the last operand before the variable
Eric Christopher [Wed, 17 Nov 2010 00:55:36 +0000 (00:55 +0000)]
Only avoid the check if we're the last operand before the variable
operands in a variadic instruction.

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

14 years agoAdd binary emission stuff for VLDM/VSTM. This reuses the
Bill Wendling [Wed, 17 Nov 2010 00:45:23 +0000 (00:45 +0000)]
Add binary emission stuff for VLDM/VSTM. This reuses the
"getRegisterListOpValue" logic. If the registers are double or single precision,
the value returned is suitable for VLDM/VSTM.

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

14 years agoFix typo: Exectuable -> Executable
Peter Collingbourne [Wed, 17 Nov 2010 00:43:43 +0000 (00:43 +0000)]
Fix typo: Exectuable -> Executable

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

14 years agoUse new neon_vector_type and neon_polyvector_type attributes for Neon vectors.
Bob Wilson [Tue, 16 Nov 2010 23:57:06 +0000 (23:57 +0000)]
Use new neon_vector_type and neon_polyvector_type attributes for Neon vectors.

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