Commit Graph

8388 Commits

Author SHA1 Message Date
Chris Lattner
0037bfabd4 We currently only run ipsccp at LTO time, which is silly. It subsumes
ipconstprop and doesn't take much time.  Just run it in its place.

This adds a testcase for it, which I plan to expand to cover other
"integration" cases, where we expect the optimizer to be able to
eliminate various things.  Due to phase order issues we've regressed
in a number of areas and integration tests are the only way I see to
prevent this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 18:57:49 +00:00
Evan Cheng
1107f03ef4 Fix tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85723 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 18:13:29 +00:00
Chris Lattner
43f44aa160 improve x86 codegen support for blockaddress. We now compile
the testcase into:

_test1:                                                     ## @test1
## BB#0:                                                    ## %entry
	leaq	L_test1_bb6(%rip), %rax
	jmpq	*%rax
L_test1_bb:                                                 ## Address Taken
LBB1_1:                                                     ## %bb
	movb	$1, %al
	ret
L_test1_bb6:                                                ## Address Taken
LBB1_2:                                                     ## %bb6
	movb	$2, %al
	ret

Note, it is very very strange that BlockAddressSDNode doesn't carry 
around TargetFlags.  Dan, please fix this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 03:25:03 +00:00
Evan Cheng
de17fb6e4d Use cbz and cbnz instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 23:46:45 +00:00
Jim Grosbach
8cd0a8cb82 vml[as].f32 cause stalls in following advanced SIMD instructions. Avoid using
them for scalar floating point operations for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85697 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 22:57:36 +00:00
Jim Grosbach
1820ec5e7a Consolidate test files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 22:20:56 +00:00
Jim Grosbach
91c0aebe68 Change to use FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 22:16:14 +00:00
Jim Grosbach
0e5c9beeed Make tests more explicit about which instructions are expected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85694 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 22:14:17 +00:00
Jim Grosbach
6b0b4b3eaf Grammar tweak to comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 22:12:44 +00:00
Jim Grosbach
199a4b4c70 Update test to be more explicit about what instruction sequences are expected for each operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 22:10:38 +00:00
Jim Grosbach
07d236ba88 Update test to be more explicit about what instruction sequences are expected for each operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 21:52:58 +00:00
Jim Grosbach
bcf2f2c159 Expand 64-bit logical shift right inline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 21:42:19 +00:00
Jim Grosbach
b4a976c304 Expand 64-bit arithmetic shift right inline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85685 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 21:00:56 +00:00
Benjamin Kramer
e3246fc6ab Force triple; darwin's ASM syntax differs from linux's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 19:54:06 +00:00
Jim Grosbach
c2b879fcfe Expand 64 bit left shift inline rather than using the libcall. For now, this
is unconditional. Making it still use the libcall when optimizing for size
would be a good adjustment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85675 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 19:38:01 +00:00
Benjamin Kramer
823bdbc770 Add missing colons for FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 19:22:24 +00:00
Jim Grosbach
4a26092248 Convert to FileCheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85673 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 19:06:53 +00:00
Dan Gohman
438b583dbd Revert r85667. LoopUnroll currently can't call utility functions which
auto-update the DominatorTree because it doesn't keep the DominatorTree
current while it works.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 17:33:01 +00:00
Dan Gohman
f230d8ad15 Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor into
MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive,
and makes it unnecessary for LoopUnroll to have its own copy of this code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 16:08:00 +00:00
Evan Cheng
9eda68988e It's safe to remat t2LDRpci; Add PseudoSourceValue to load / store's to enable more machine licm. More changes coming.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85643 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 03:39:36 +00:00
Dan Gohman
c933acf096 Add a target triple so that this test behaves consistently across hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 00:15:28 +00:00
Dan Gohman
0437a06ea6 Fix the -mattr line for this test so that it passes on hosts that lack SSSE3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 23:18:27 +00:00
Dan Gohman
cf35517c4e Add a testcase for the recent duplicate PHI elimination changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 23:16:10 +00:00
Chris Lattner
dac8bde235 if basic blocks are destroyed while there are *just* BlockAddress' hanging
around, then zap them.  This is analogous to dangling constantexprs hanging
off functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85627 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 22:39:36 +00:00
Dan Gohman
0115e164ba Fix MachineLICM to use the correct virtual register class when
unfolding loads for hoisting.  getOpcodeAfterMemoryUnfold returns the
opcode of the original operation without the load, not the load
itself, MachineLICM needs to know the operand index in order to get
the correct register class. Extend getOpcodeAfterMemoryUnfold to
return this information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 22:18:41 +00:00
Daniel Dunbar
b0c9a99d9c Add missing substitution for %llvmgcc_only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 21:13:59 +00:00
Evan Cheng
3efabd316f I forgot to commit this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85608 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 20:03:40 +00:00
Rafael Espindola
c1382b745f This fixes functions like
void f (int a1, int a2, int a3, int a4, int a5,...)

In ARMTargetLowering::LowerFormalArguments if the function has 4 or
more regular arguments we used to set VarArgsFrameIndex using an
offset of 0, which is only correct if the function has exactly 4
regular arguments.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 14:33:14 +00:00
Bob Wilson
2c04dae715 Reimplement BranchFolding change to avoid tail merging for a 1 instruction
common tail, except when the OptimizeForSize function attribute is present.
Radar 7338114.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85441 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 22:10:20 +00:00
Victor Hernandez
90f48e7c91 Extend getMallocArraySize() to determine the array size if the malloc argument is:
ArraySize * ElementSize
ElementSize * ArraySize
ArraySize << log2(ElementSize)
ElementSize << log2(ArraySize)

Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic.
Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:18:55 +00:00
Owen Anderson
b62f792e78 Treat lifetime begin/end markers as allocations/frees respectively for the
purposes for GVN/DSE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 07:05:35 +00:00
Owen Anderson
a85a66423d Be more careful about invariance reasoning on "store" queries. Stores still need
to depend on Ref and ModRef calls within the invariant region.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85380 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 06:30:52 +00:00
Owen Anderson
4bc737c5ef Add trivial support for the invariance intrinsics to memdep. This logic is
purely local for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 06:18:42 +00:00
Chris Lattner
50b136dae9 add bitcode reader support for blockaddress. We can now fully
round trip blockaddress through .ll and .bc files, so add a testcase.

There are still a bunch of places in the optimizer and other places
that need to be updated to work with these constructs, but at least
the basics are in now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 05:53:48 +00:00
Dan Gohman
589f1f5a43 Teach MachineLICM to unfold loads from constant memory from
otherwise unhoistable instructions in order to allow the loads
to be hoisted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 03:21:57 +00:00
Evan Cheng
39382427f1 Use fconsts and fconstd to materialize small fp constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:44:26 +00:00
Dan Gohman
a104d1eab2 Mark dead physregdefs dead immediately. This helps MachineSink and
MachineLICM and other things which run before LiveVariables is run.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:13:53 +00:00
Dan Gohman
83f6120c9a Allow constants of different types to share constant pool entries
if they have compatible encodings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 01:12:16 +00:00
Chris Lattner
ab21db79ef rename indbr -> indirectbr to appease the residents of #llvm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85351 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 00:19:10 +00:00
Dale Johannesen
e69ed95855 Add radar number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 20:12:38 +00:00
Dale Johannesen
4fc1231730 Testcase for llvm-gcc patch 85284.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 20:06:05 +00:00
Chris Lattner
f9be95f867 add enough support for indirect branch for the feature test to pass
(assembler,asmprinter, bc reader+writer) and document it.  Codegen
currently aborts on it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85274 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 19:13:16 +00:00
Rafael Espindola
2bda533e1c Add missing testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 17:59:03 +00:00
Chris Lattner
7a034b1127 change of mind :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 17:40:49 +00:00
Chris Lattner
9357754d09 rename test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 17:40:19 +00:00
Edward O'Callaghan
4ea7d4c3eb Convert Analysis tests to FileCheck in regards to PR5307.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 14:54:46 +00:00
Bob Wilson
37986053b4 Fix Thumb2 failures by converting them to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 06:31:02 +00:00
Bob Wilson
b9350315d2 Fix the rest of the ARM failures by converting them to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 06:16:45 +00:00
Bob Wilson
13e80bdb71 Fix some more failures by converting to FileCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 05:50:28 +00:00
Chris Lattner
c581acbbba Fix a pretty serious misfeature of the inliner: if it inlines a function
with multiple return values it inserts a PHI to merge them all together.
However, if the return values are all the same, it ends up with a pointless
PHI and this pointless PHI happens to really block SRoA from happening in 
at least a silly C++ example written by Doug, but probably others.  This 
fixes rdar://7339069.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85206 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 05:39:41 +00:00