Commit Graph

8432 Commits

Author SHA1 Message Date
Bob Wilson
8a008cc49d Attempt again to fix buildbot failures: make expected output less specific
and compile with -mtriple to specify *-apple-darwin targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 00:30:35 +00:00
Victor Hernandez
24f934d055 Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses.  The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses.  The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 00:03:03 +00:00
Chris Lattner
40dd12e708 improve DSE when TargetData is not around, based on work by
Hans Wennborg!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 23:20:12 +00:00
Bob Wilson
3d90dbee69 Add PowerPC codegen for indirect branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86050 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 21:31:18 +00:00
Bob Wilson
1709dd73d6 Fix broken test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 20:04:11 +00:00
Bob Wilson
0d48d6106e Add test for ARM indirectbr codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 19:25:34 +00:00
Evan Cheng
50608bac2f RangeIsDefinedByCopyFromReg() should check for subreg_to_reg, insert_subreg,
and extract_subreg as a "copy" that defines a valno.
Also fixes a typo. These two issues prevent a simple subreg coalescing from
happening before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86022 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 08:33:14 +00:00
Chris Lattner
092543ca71 move two functions up higher in the file. Delete a useless argument
to EmitGEPOffset.  

Implement some new transforms for optimizing 
subtracts of two pointer to ints into the same vector.  This happens
for C++ iterator idioms for example, stringmap takes a const char*
that points to the start and end of a string.  Once inlined, we want
the pointer difference to turn back into a length.

This is rdar://7362831.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86021 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 08:05:20 +00:00
Chris Lattner
6a4ab1e426 filecheckize this test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 07:57:05 +00:00
Evan Cheng
ad95ff9fab Fix test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85986 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 00:42:33 +00:00
Chris Lattner
fc36a562ae reimplement multiple return value handling in IPSCCP, making it
more aggressive an correct.  This survives building llvm in 64-bit
mode with optimizations and the built llvm passes make check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85973 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 23:40:48 +00:00
Evan Cheng
b23b2015eb fconsts / fconstd immediate should be proceeded with #.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 21:59:33 +00:00
Evan Cheng
777c6b7caa Re-apply 85799. It turns out my code isn't buggy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 21:40:02 +00:00
Chris Lattner
60faaf64b4 fix test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 21:26:26 +00:00
Chris Lattner
db70f8a442 merge a test into ipsccp-basic. running llvm-ld to get one pass is... bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85945 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 21:25:50 +00:00
Chris Lattner
fde2da47de turn IPSCCP back on by default, try #3 or 4? Woo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 19:35:13 +00:00
Chris Lattner
2396cc37ae fix an IPSCCP bug I introduced when I changed IPSCCP to start working on
functions that don't have local linkage.  Basically, we need to be more
careful about propagating argument information to functions whose results
we aren't tracking.  This fixes a miscompilation of 
LLVMCConfigurationEmitter.cpp when built with an llvm-gcc that has ipsccp
enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85923 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 19:24:51 +00:00
Devang Patel
e8bc45a645 Parse debug info attached with insertvalue and extractvalue instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 19:06:07 +00:00
Chris Lattner
19c2079851 xfail this test since daniel turned off ipsccp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85907 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 17:54:12 +00:00
Chris Lattner
c8d40c7aad testcase for r85903
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85906 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 17:03:02 +00:00
Kenneth Uildriks
b908f8ad6a Make opt default to not adding a target data string and update tests that depend on target data to supply it within the test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 15:29:06 +00:00
Evan Cheng
ba908640b3 Fix PR5367. QPR_8 is the super regclass of DPR_8 and SPR_8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 05:52:54 +00:00
Nate Begeman
e4a9f9c450 Declare sin & cos as readonly so they match the code in SelectionDAGBuild
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 02:19:31 +00:00
Anton Korobeynikov
7b360e7f29 Temporary xfail until PR5367 will be resolved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 00:37:36 +00:00
Anton Korobeynikov
ab453e0641 Revert r85049, it is causing PR5367
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85847 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 00:24:48 +00:00
Evan Cheng
454ac8961b Revert 85799 for now. It might be breaking llvm-gcc driver.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85827 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 21:49:14 +00:00
Chris Lattner
0909796868 merge 2008-03-10-sret.ll into ipsccp-basic.ll, and upgrade its syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 18:27:22 +00:00
Chris Lattner
2bbbbd6ac8 disable IPSCCP support for multiple return values, it is buggy, so just
disable it until I can fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 18:22:51 +00:00
Evan Cheng
72ed88feac Initilize the machine LICM CSE map upon the first time an instruction is hoisted to
the loop preheader. Add instructions which are already in the preheader block that
may be common expressions of those that are hoisted out. These does get a few more
instructions CSE'ed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 08:09:49 +00:00
Chris Lattner
12c8d5f5fe improve IPSCCP to be able to propagate the result of "!mayBeOverridden"
function to calls of that function, regardless of whether it has local
linkage or has its address taken.  Not escaping should only affect 
whether we make an aggressive assumption about the arguments to a 
function, not whether we can track the result of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 07:33:59 +00:00
Evan Cheng
580e791ded Remove an irrelevant and poorly reduced test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 07:11:54 +00:00
Chris Lattner
5638dc618a Use the libanalysis 'ConstantFoldLoadFromConstPtr' function
instead of reinventing SCCP-specific logic.  This gives us
new powers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 06:06:14 +00:00
Evan Cheng
7baae87d8f Unbreak ARMBaseRegisterInfo::copyRegToReg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85787 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 04:44:55 +00:00
Chris Lattner
794c15dc71 fix a bug exposed by moving SRoA earlier which caused a crash building kc++
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85786 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 04:37:17 +00:00
Chris Lattner
7ebbabf500 fix instcombine to only do store sinking when the alignments
of the two loads agree.  Propagate that onto the new store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 02:06:37 +00:00
Chris Lattner
f013eea972 merge a test into store.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 02:00:18 +00:00
Chris Lattner
f7956621ee convert to filecheck
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 01:58:03 +00:00
Anton Korobeynikov
2ae0eec1c0 Handle splats of undefs properly. This includes the testcase for PR5364 as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 00:12:06 +00:00
Anton Korobeynikov
2e1da9fea4 64-bit FP loads & stores operate on both NEON and VFP pipelines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-02 00:11:06 +00:00
Evan Cheng
48d8afab73 Make use of imm12 version of Thumb2 ldr / str instructions more aggressively.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 21:12:51 +00:00
Chris Lattner
213a8d3a48 merge phi-merge.ll into phi.ll
I don't know what Dan wants to do with phi-merge-gep.ll, I'll let
him deal with it because instcombine may end up sinking these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 20:10:11 +00:00
Chris Lattner
a664bb7bdc when merging two loads, make sure to take the min of their alignment,
not the max.  This didn't matter until the previous patch because
instcombine would refuse to sink loads with differenting alignments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 20:07:07 +00:00
Chris Lattner
e3c6281a98 fix a bug noticed by inspection: when instcombine sinks loads through
phis, it didn't preserve the alignment of the load.  This is a missed
optimization of the alignment is high and a miscompilation when the
alignment is low.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 19:50:13 +00:00
Chris Lattner
c7e4e6edc4 convert to filecheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-01 19:22:20 +00:00
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