oota-llvm.git
15 years agowire up support for emitting "special" values from inline asm
Chris Lattner [Tue, 10 Mar 2009 05:37:13 +0000 (05:37 +0000)]
wire up support for emitting "special" values from inline asm
format strings with the standard ${:foo} syntax.

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

15 years agoAdd more information to the EFLAGS note.
Dan Gohman [Tue, 10 Mar 2009 00:26:23 +0000 (00:26 +0000)]
Add more information to the EFLAGS note.

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

15 years agoCheck for warnings about inappropriate weak_imports.
Stuart Hastings [Tue, 10 Mar 2009 00:17:39 +0000 (00:17 +0000)]
Check for warnings about inappropriate weak_imports.
Darwin-specific; marked XFAIL for others.

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

15 years agoAdd a note about EFLAGS optimization.
Dan Gohman [Mon, 9 Mar 2009 23:47:02 +0000 (23:47 +0000)]
Add a note about EFLAGS optimization.

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

15 years agoIgnore debug info while evaluating function.
Devang Patel [Mon, 9 Mar 2009 23:04:12 +0000 (23:04 +0000)]
Ignore debug info while evaluating function.

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

15 years agoDon't record the increment instruction; just recompute it from the Phi
Dan Gohman [Mon, 9 Mar 2009 22:04:01 +0000 (22:04 +0000)]
Don't record the increment instruction; just recompute it from the Phi
if needed. This simplifies the code a little, and is needed for an
upcoming refactoring.

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

15 years agoFix PR3724 by searching for the largest free block when
Chris Lattner [Mon, 9 Mar 2009 21:34:10 +0000 (21:34 +0000)]
Fix PR3724 by searching for the largest free block when
allocating memory in the JIT.  This is insanely inefficient, but
hey, most people implement their own memory managers anyway.

Patch by Eric Yew!

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

15 years agoRemove llvm.dbg.global_variables also.
Devang Patel [Mon, 9 Mar 2009 21:32:28 +0000 (21:32 +0000)]
Remove llvm.dbg.global_variables also.

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

15 years agoFix a few more places where induction variable types were used
Dan Gohman [Mon, 9 Mar 2009 21:22:12 +0000 (21:22 +0000)]
Fix a few more places where induction variable types were used
where memory access types are needed.

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

15 years agoUse ReplacedTy instead of recomputing the same value.
Dan Gohman [Mon, 9 Mar 2009 21:19:58 +0000 (21:19 +0000)]
Use ReplacedTy instead of recomputing the same value.

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

15 years agoUse LoopInfo's getLoopLatch() instead of doing what it does manualy.
Dan Gohman [Mon, 9 Mar 2009 21:14:16 +0000 (21:14 +0000)]
Use LoopInfo's getLoopLatch() instead of doing what it does manualy.

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

15 years agoDon't use an induction variable type as a memory access type.
Dan Gohman [Mon, 9 Mar 2009 21:04:19 +0000 (21:04 +0000)]
Don't use an induction variable type as a memory access type.
Use VoidTy instead, to be properly conservative.

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

15 years agoFactor out the code that determines the memory access type
Dan Gohman [Mon, 9 Mar 2009 21:01:17 +0000 (21:01 +0000)]
Factor out the code that determines the memory access type
of an instruction into a helper function.

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

15 years agoClarify wording, patch by Stefanus Du Toit!
Chris Lattner [Mon, 9 Mar 2009 20:55:18 +0000 (20:55 +0000)]
Clarify wording, patch by Stefanus Du Toit!

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

15 years agoAdd helper pass to remove llvm.dbg.declare intrinsics.
Devang Patel [Mon, 9 Mar 2009 20:49:37 +0000 (20:49 +0000)]
Add helper pass to remove llvm.dbg.declare intrinsics.

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

15 years agoMove the sorting of the StrideOrder array earlier so that it doesn't
Dan Gohman [Mon, 9 Mar 2009 20:46:50 +0000 (20:46 +0000)]
Move the sorting of the StrideOrder array earlier so that it doesn't
have to be done twice.

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

15 years agoDelete the isOnlyStride argument, which is unused.
Dan Gohman [Mon, 9 Mar 2009 20:41:15 +0000 (20:41 +0000)]
Delete the isOnlyStride argument, which is unused.

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

15 years agoTidy some LSR debug output: announce the loop it's about to process
Dan Gohman [Mon, 9 Mar 2009 20:34:59 +0000 (20:34 +0000)]
Tidy some LSR debug output: announce the loop it's about to process
before it does any processing.

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

15 years agoARM target now also recognize triplets like thumbv6-apple-darwin and set thumb mode...
Evan Cheng [Mon, 9 Mar 2009 20:25:39 +0000 (20:25 +0000)]
ARM target now also recognize triplets like thumbv6-apple-darwin and set thumb mode and arch subversion. Eventually thumb triplets will go way and replaced with function notes.

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

15 years agoFix PR3763 by using proper APInt methods instead of uint64_t's.
Chris Lattner [Mon, 9 Mar 2009 20:22:18 +0000 (20:22 +0000)]
Fix PR3763 by using proper APInt methods instead of uint64_t's.

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

15 years agomake the Op<N> methods protected, how it was intended to be
Gabor Greif [Mon, 9 Mar 2009 19:57:49 +0000 (19:57 +0000)]
make the Op<N> methods protected, how it was intended to be

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

15 years agoARM isLegalAddressImmediate should check if type is a simple type now that optimizer...
Evan Cheng [Mon, 9 Mar 2009 19:15:00 +0000 (19:15 +0000)]
ARM isLegalAddressImmediate should check if type is a simple type now that optimizer can create values of funky scalar types.

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

15 years agoYet another case where the spiller marked two uses of the same register on the same...
Evan Cheng [Mon, 9 Mar 2009 19:00:05 +0000 (19:00 +0000)]
Yet another case where the spiller marked two uses of the same register on the same instruction as kill. This fixes PR3706.

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

15 years agoRe-apply 66315, but restrict it to Darwin only.
Evan Cheng [Mon, 9 Mar 2009 18:28:37 +0000 (18:28 +0000)]
Re-apply 66315, but restrict it to Darwin only.

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

15 years agoRevert r66415. It's causing failures during bootstrap builds:
Bill Wendling [Mon, 9 Mar 2009 18:01:33 +0000 (18:01 +0000)]
Revert r66415. It's causing failures during bootstrap builds:

Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__muldi3':
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:567: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c: In function '__lshrdi3':
/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~obj/src/gcc/libgcc2.c:421: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.
make[5]: *** [libgcc/./_lshrdi3.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [libgcc/./_muldi3.o] Error 1
make[5]: *** [libgcc/./_negdi2.o] Error 1

--- Reverse-merging (from foreign repository) r66415 into '.':
U    include/llvm/BasicBlock.h
U    include/llvm/ADT/ilist_node.h
U    include/llvm/CodeGen/SelectionDAG.h
U    include/llvm/CodeGen/MachineFunction.h
U    include/llvm/CodeGen/MachineBasicBlock.h
U    include/llvm/Function.h

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

15 years agoAdd a constructor for BuildVectorSDNode and revert the temporary workaround
Bob Wilson [Mon, 9 Mar 2009 17:07:15 +0000 (17:07 +0000)]
Add a constructor for BuildVectorSDNode and revert the temporary workaround
from 66280.  I was unable to verify this with gcc-3.4.6, but with gcc-3.3 it
avoids the "base class with only non-default constructor in class without
a constructor" warning.  Apparently that warning was promoted to an error
in gcc-3.4.

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

15 years agoThis debug info special case should no longer
Duncan Sands [Mon, 9 Mar 2009 11:57:08 +0000 (11:57 +0000)]
This debug info special case should no longer
be needed now that these intrinsics are marked
as not accessing memory.

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

15 years agojust remove the use_empty() check entirely, the only reason it
Chris Lattner [Mon, 9 Mar 2009 08:18:48 +0000 (08:18 +0000)]
just remove the use_empty() check entirely, the only reason it
existed was for llvm-gcc 3.4 (which used the __main hack) which
is really really long dead.

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

15 years agoin builds without asserts we do not need to allocate the Next pointer in "ghostly...
Gabor Greif [Mon, 9 Mar 2009 07:09:01 +0000 (07:09 +0000)]
in builds without asserts we do not need to allocate the Next pointer in "ghostly" sentinels

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

15 years agoRegenerate.
Nick Lewycky [Mon, 9 Mar 2009 06:16:46 +0000 (06:16 +0000)]
Regenerate.

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

15 years agoRemove configurey-fu to autodetect hash_map and hash_set now that they are
Nick Lewycky [Mon, 9 Mar 2009 06:16:26 +0000 (06:16 +0000)]
Remove configurey-fu to autodetect hash_map and hash_set now that they are
no longer used in LLVM.

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

15 years agoMake the code generator rip of dead constant expr uses before deciding
Chris Lattner [Mon, 9 Mar 2009 05:52:15 +0000 (05:52 +0000)]
Make the code generator rip of dead constant expr uses before deciding
whether a global is dead or not.  This should fix PR3749 - linker adds
spurious use to appending globals.  I can't reasonably add a testcase
for this, because the bc writer/reader strip dead constant users.

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

15 years agomake GlobalValue::removeDeadConstantUsers() const.
Chris Lattner [Mon, 9 Mar 2009 05:50:45 +0000 (05:50 +0000)]
make GlobalValue::removeDeadConstantUsers() const.

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

15 years agotestcase for PR3744
Chris Lattner [Mon, 9 Mar 2009 05:44:59 +0000 (05:44 +0000)]
testcase for PR3744

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

15 years agodon't allow hash_map or hash_set.
Chris Lattner [Mon, 9 Mar 2009 05:20:45 +0000 (05:20 +0000)]
don't allow hash_map or hash_set.

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

15 years agoIgnore debug intrinsics when computing dependences.
Owen Anderson [Mon, 9 Mar 2009 05:12:38 +0000 (05:12 +0000)]
Ignore debug intrinsics when computing dependences.

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

15 years agoreimplement AliasSetTracker in terms of DenseMap instead of hash_map,
Chris Lattner [Mon, 9 Mar 2009 05:11:09 +0000 (05:11 +0000)]
reimplement AliasSetTracker in terms of DenseMap instead of hash_map,
hopefully no functionality change.

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

15 years agoadd a #include to improve portability to windows, as requested by
Chris Lattner [Mon, 9 Mar 2009 05:10:08 +0000 (05:10 +0000)]
add a #include to improve portability to windows, as requested by
someone on llvmdev.

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

15 years agoPass in a std::string when getting the names of debugging things. This cuts down
Bill Wendling [Mon, 9 Mar 2009 05:04:40 +0000 (05:04 +0000)]
Pass in a std::string when getting the names of debugging things. This cuts down
on the number of times a std::string is created and copied.

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

15 years agofix Analysis/BasicAA/2004-12-08-BasicAACrash.ll by allowing opaque types.
Chris Lattner [Mon, 9 Mar 2009 04:56:22 +0000 (04:56 +0000)]
fix Analysis/BasicAA/2004-12-08-BasicAACrash.ll by allowing opaque types.

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

15 years agoFix two classes of bugs. First:
Chris Lattner [Mon, 9 Mar 2009 04:49:14 +0000 (04:49 +0000)]
Fix two classes of bugs.  First:

validate an invariant so that the asmparser rejects a bad construct
instead of the verifier.  Before:

llvm-as: assembly parsed, but does not verify as correct!
Invalid struct return type!
i64 (%struct.Type*, %struct.Type*)* @foo

after:

llvm-as: t.ll:5:8: functions with 'sret' argument must return void
define i64 @foo(%struct.Type* noalias nocapture sret %agg.result, %struct.Type* nocapture byval %t) nounwind {
       ^

Second, check that void is only used where allowed (in function return types) not in
arbitrary places, fixing PR3747 - Crash in llvm-as with void field in struct.  We
now reject that example with:

$ llvm-as t.ll
llvm-as: t.ll:1:12: struct element can not have void type
%x = type {void}
           ^

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

15 years agoFix PR3746 - Crash in isel with GEP of function pointer
Chris Lattner [Mon, 9 Mar 2009 04:46:40 +0000 (04:46 +0000)]
Fix PR3746 - Crash in isel with GEP of function pointer
by checking that the top-level type of a gep is sized. This
causes us to reject the example with:

llvm-as: t2.ll:2:16: invalid getelementptr indices
getelementptr i32()* null, i32 1
              ^

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

15 years agoFix PR3743 - -mmacosx-version-min inappropriate for Mac OS X 10.4.11,
Chris Lattner [Mon, 9 Mar 2009 04:45:03 +0000 (04:45 +0000)]
Fix PR3743 - -mmacosx-version-min inappropriate for Mac OS X 10.4.11,
by stripping off any versions past the "10.4".

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

15 years agoadd some explicit llvm:: qualifiers to the unix side, fix problems on the windows...
Chris Lattner [Sun, 8 Mar 2009 19:13:45 +0000 (19:13 +0000)]
add some explicit llvm:: qualifiers to the unix side, fix problems on the windows side.

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

15 years agoKeep calling-convention and tail-call bit when creating new invoke or call.
Nick Lewycky [Sun, 8 Mar 2009 19:02:17 +0000 (19:02 +0000)]
Keep calling-convention and tail-call bit when creating new invoke or call.

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

15 years agodo not export all the X86FastISel symbols, ever.
Chris Lattner [Sun, 8 Mar 2009 18:44:31 +0000 (18:44 +0000)]
do not export all the X86FastISel symbols, ever.

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

15 years agoFix comments, pointed out by Duncan Sands.
Nick Lewycky [Sun, 8 Mar 2009 17:08:09 +0000 (17:08 +0000)]
Fix comments, pointed out by Duncan Sands.

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

15 years agoApply ODR linkage changes accidentally dropped during
Duncan Sands [Sun, 8 Mar 2009 13:35:23 +0000 (13:35 +0000)]
Apply ODR linkage changes accidentally dropped during
final cleaning.  This fixes a bunch of testsuite failures.

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

15 years agoTest commit
Sebastian Redl [Sun, 8 Mar 2009 11:43:20 +0000 (11:43 +0000)]
Test commit

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

15 years agoMark function returns as noalias.
Nick Lewycky [Sun, 8 Mar 2009 06:20:47 +0000 (06:20 +0000)]
Mark function returns as noalias.

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

15 years agoteach SROA to handle promoting vector allocas with a memset into them into
Chris Lattner [Sun, 8 Mar 2009 04:17:04 +0000 (04:17 +0000)]
teach SROA to handle promoting vector allocas with a memset into them into
a vector type instead of into an integer type.

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

15 years agofix typo
Chris Lattner [Sun, 8 Mar 2009 04:06:26 +0000 (04:06 +0000)]
fix typo

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

15 years agoEnhance SROA to "promote to scalar" allocas which are
Chris Lattner [Sun, 8 Mar 2009 04:04:21 +0000 (04:04 +0000)]
Enhance SROA to "promote to scalar" allocas which are
memcpy/memmove'd into or out of.  This fixes a serious
perf issue that Nate ran into.

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

15 years agoRecognize triplets starting with armv5-, armv6- etc. And set the ARM arch version...
Evan Cheng [Sun, 8 Mar 2009 04:02:49 +0000 (04:02 +0000)]
Recognize triplets starting with armv5-, armv6- etc. And set the ARM arch version accordingly.

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

15 years agochange the MemIntrinsic get/setAlignment method to take an unsigned
Chris Lattner [Sun, 8 Mar 2009 03:59:00 +0000 (03:59 +0000)]
change the MemIntrinsic get/setAlignment method to take an unsigned
instead of a Constant*, which is what the clients of it really want.

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

15 years agoIf a MI uses the same register more than once, only mark one of them as 'kill'.
Evan Cheng [Sun, 8 Mar 2009 03:58:35 +0000 (03:58 +0000)]
If a MI uses the same register more than once, only mark one of them as 'kill'.

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

15 years agouse MemTransferInst.
Chris Lattner [Sun, 8 Mar 2009 03:37:35 +0000 (03:37 +0000)]
use MemTransferInst.

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

15 years agoIntroduce a new MemTransferInst pseudo class, which is a common
Chris Lattner [Sun, 8 Mar 2009 03:37:16 +0000 (03:37 +0000)]
Introduce a new MemTransferInst pseudo class, which is a common
parent between MemCpyInst and MemMoveInst, simplify some code to
use it.

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

15 years agoadd a note.
Chris Lattner [Sun, 8 Mar 2009 03:04:26 +0000 (03:04 +0000)]
add a note.

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

15 years agoadd a note.
Chris Lattner [Sun, 8 Mar 2009 01:54:43 +0000 (01:54 +0000)]
add a note.

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

15 years agoimplement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4.
Chris Lattner [Sun, 8 Mar 2009 01:51:30 +0000 (01:51 +0000)]
implement an optimization to codegen c ? 1.0 : 2.0 as load { 2.0, 1.0 } + c*4.
For 2009-03-07-FPConstSelect.ll we now produce:

_f:
xorl %eax, %eax
testl %edi, %edi
movl $4, %ecx
cmovne %rax, %rcx
leaq LCPI1_0(%rip), %rax
movss (%rcx,%rax), %xmm0
ret

previously we produced:

_f:
subl $4, %esp
cmpl $0, 8(%esp)
movss LCPI1_0, %xmm0
je LBB1_2 ## entry
LBB1_1: ## entry
movss LCPI1_1, %xmm0
LBB1_2: ## entry
movss %xmm0, (%esp)
flds (%esp)
addl $4, %esp
ret

on PPC the code also improves to:

_f:
cntlzw r2, r3
srwi r2, r2, 5
li r3, lo16(LCPI1_0)
slwi r2, r2, 2
addis r3, r3, ha16(LCPI1_0)
lfsx f1, r3, r2
blr

from:

_f:
li r2, lo16(LCPI1_1)
cmplwi cr0, r3, 0
addis r2, r2, ha16(LCPI1_1)
beq cr0, LBB1_2 ; entry
LBB1_1: ; entry
li r2, lo16(LCPI1_0)
addis r2, r2, ha16(LCPI1_0)
LBB1_2: ; entry
lfs f1, 0(r2)
blr

This also improves the existing pic-cpool case from:

foo:
subl $12, %esp
call .Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
popl %eax
addl $_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
cmpl $0, 16(%esp)
movsd .LCPI1_0@GOTOFF(%eax), %xmm0
je .LBB1_2 # entry
.LBB1_1: # entry
movsd .LCPI1_1@GOTOFF(%eax), %xmm0
.LBB1_2: # entry
movsd %xmm0, (%esp)
fldl (%esp)
addl $12, %esp
ret

to:

foo:
call .Lllvm$1.$piclabel
.Lllvm$1.$piclabel:
popl %eax
addl $_GLOBAL_OFFSET_TABLE_ + [.-.Lllvm$1.$piclabel], %eax
xorl %ecx, %ecx
cmpl $0, 4(%esp)
movl $8, %edx
cmovne %ecx, %edx
fldl .LCPI1_0@GOTOFF(%eax,%edx)
ret

This triggers a few dozen times in spec FP 2000.

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

15 years agorandom cleanups.
Chris Lattner [Sun, 8 Mar 2009 01:47:41 +0000 (01:47 +0000)]
random cleanups.

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

15 years agoFix misaligned whitespace. No functionality change.
Nick Lewycky [Sun, 8 Mar 2009 00:57:09 +0000 (00:57 +0000)]
Fix misaligned whitespace. No functionality change.

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

15 years agofix a serious pessimization that Tron on IRC pointed out where we would
Chris Lattner [Sat, 7 Mar 2009 23:32:02 +0000 (23:32 +0000)]
fix a serious pessimization that Tron on IRC pointed out where we would
"boolify" pointers, generating really awful code because getting the pointer
value requires a load itself.  Before:

_foo:
movb $1, _X.b
ret
_get:
xorl %ecx, %ecx
movb _X.b, %al
testb %al, %al
movl $_Y, %eax
cmove %ecx, %eax
ret

With the xform disabled:

_foo:
movl $_Y, _X
ret
_get:
movl _X, %eax
ret

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

15 years agoRevert r66315. Fix the build on mixed 64/32 Linux systems.
Nick Lewycky [Sat, 7 Mar 2009 22:17:05 +0000 (22:17 +0000)]
Revert r66315. Fix the build on mixed 64/32 Linux systems.

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

15 years agoRemove some duplication.
Mikhail Glushenkov [Sat, 7 Mar 2009 20:18:46 +0000 (20:18 +0000)]
Remove some duplication.

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

15 years agoIntroduce new linkage types linkonce_odr, weak_odr, common_odr
Duncan Sands [Sat, 7 Mar 2009 15:45:40 +0000 (15:45 +0000)]
Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

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

15 years agosimplify the way how traits get hold of the symbol table
Gabor Greif [Sat, 7 Mar 2009 12:33:24 +0000 (12:33 +0000)]
simplify the way how traits get hold of the symbol table

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

15 years agofurther simplifications arising from peruse of the more declarative interface
Gabor Greif [Sat, 7 Mar 2009 10:49:57 +0000 (10:49 +0000)]
further simplifications arising from peruse of the more declarative interface

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

15 years agoRemove the burden of dealing with list offsets
Gabor Greif [Sat, 7 Mar 2009 10:00:35 +0000 (10:00 +0000)]
Remove the burden of dealing with list offsets
from SymbolTableListTraits' clients, and
intead request a nice declarative interface.
Cleans up an IMHO ugly wart.

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

15 years agoWhen a crash signal is delivered do two things: remove all of our
Chris Lattner [Sat, 7 Mar 2009 08:15:47 +0000 (08:15 +0000)]
When a crash signal is delivered do two things: remove all of our
signal handlers to prevent reentrance on unrelated things (a sigabort
where the handle bus errors) also, clear the signal mask so that the
signal doesn't infinitely reissue.  This fixes rdar://6654827 -
Crash causes clang to loop

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

15 years agoFinish cross-process JIT work, and clean up previous work.
Nate Begeman [Sat, 7 Mar 2009 06:41:19 +0000 (06:41 +0000)]
Finish cross-process JIT work, and clean up previous work.

1. When the JIT is asked to remove a function, updating it's
   mapping to 0, we invalidate any function stubs used only
   by that function.  Now, also invalidate the JIT's mapping
   from the GV the stub pointed to, to the address of the GV.

2. When dlsym stubs for cross-process JIT are enabled, do not
   abort just because a named function cannot be found in the
   JIT's process.

3. Fix various assumptions about when it is ok to use the lazy
   resolver when non-lazy JITing is enabled.

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

15 years agoArithmetic instructions don't set EFLAGS bits OF and CF bits
Dan Gohman [Sat, 7 Mar 2009 01:58:32 +0000 (01:58 +0000)]
Arithmetic instructions don't set EFLAGS bits OF and CF bits
the same say the "test" instruction does in overflow cases,
so eliminating the test is only safe when those bits aren't
needed, as is the case for COND_E and COND_NE, or if it
can be proven that no overflow will occur. For now, just
restrict the optimization to COND_E and COND_NE and don't
do any overflow analysis.

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

15 years agoIf ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386. This makes sure...
Evan Cheng [Sat, 7 Mar 2009 01:40:17 +0000 (01:40 +0000)]
If ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386. This makes sure the JIT work correctly.

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

15 years agoAdd IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
Daniel Dunbar [Fri, 6 Mar 2009 22:26:07 +0000 (22:26 +0000)]
Add IRBuilder::CreateConstGEP{1, 2}_{32, 64}.
 - Names are lame, but it seems better to be explicit.

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

15 years agoRename my makefile debugging rule to prevent accidental collisions.
Daniel Dunbar [Fri, 6 Mar 2009 22:23:25 +0000 (22:23 +0000)]
Rename my makefile debugging rule to prevent accidental collisions.

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

15 years agoAdd Module::getNamedValue; use to normalize access to Module symbol
Daniel Dunbar [Fri, 6 Mar 2009 22:04:43 +0000 (22:04 +0000)]
Add Module::getNamedValue; use to normalize access to Module symbol
table.
 - No functionality change.

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

15 years agoFix another case where debug info interferes with
Dale Johannesen [Fri, 6 Mar 2009 21:08:33 +0000 (21:08 +0000)]
Fix another case where debug info interferes with
an optimization.

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

15 years agoAdd default constructor to SDNode to make gcc 3.4.6 happy.
Tanya Lattner [Fri, 6 Mar 2009 18:17:45 +0000 (18:17 +0000)]
Add default constructor to SDNode to make gcc 3.4.6 happy.

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

15 years agoUse c_str() to force the string to be nul-terminated.
Dan Gohman [Fri, 6 Mar 2009 18:13:15 +0000 (18:13 +0000)]
Use c_str() to force the string to be nul-terminated.

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

15 years agoAdd a comment.
Mikhail Glushenkov [Fri, 6 Mar 2009 17:59:58 +0000 (17:59 +0000)]
Add a comment.

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

15 years agosome nits noticed by Duncan
Chris Lattner [Fri, 6 Mar 2009 17:05:04 +0000 (17:05 +0000)]
some nits noticed by Duncan

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

15 years agofix header comment and include guard.
Chris Lattner [Fri, 6 Mar 2009 16:54:19 +0000 (16:54 +0000)]
fix header comment and include guard.

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

15 years agoadd a bunch more passes to the C bindings (PR3734), patch by
Chris Lattner [Fri, 6 Mar 2009 16:52:18 +0000 (16:52 +0000)]
add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!

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

15 years agoTrailing whitespace.
Mikhail Glushenkov [Fri, 6 Mar 2009 12:25:56 +0000 (12:25 +0000)]
Trailing whitespace.

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

15 years agoTrailing whitespace.
Mikhail Glushenkov [Fri, 6 Mar 2009 12:21:40 +0000 (12:21 +0000)]
Trailing whitespace.

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

15 years agoWhile thinking about the one-definition-rule and trying
Duncan Sands [Fri, 6 Mar 2009 10:21:56 +0000 (10:21 +0000)]
While thinking about the one-definition-rule and trying
to find a tiny mouse hole to squeeze through, it struck
me that globals without a name can be considered internal
since they can't be referenced from outside the current
module.  This patch makes GlobalOpt give them internal
linkage.  Also done for aliases even though they always
have names, since in my opinion anonymous aliases should
be allowed for consistency with global variables and
functions.  So if that happens one day, this code is ready!

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

15 years agoon apple systems, integrate nicely with crash reporter.
Chris Lattner [Fri, 6 Mar 2009 07:19:54 +0000 (07:19 +0000)]
on apple systems, integrate nicely with crash reporter.

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

15 years agoWhile converting an aggregate to scalare, ignore and remove aggregate's debug info.
Devang Patel [Fri, 6 Mar 2009 07:03:54 +0000 (07:03 +0000)]
While converting an aggregate to scalare, ignore and remove aggregate's debug info.

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

15 years agoSprinkle some PrettyStackEntry magic into the passmanager. With this, we now
Chris Lattner [Fri, 6 Mar 2009 06:45:05 +0000 (06:45 +0000)]
Sprinkle some PrettyStackEntry magic into the passmanager.  With this, we now
get nice and happy stack traces when we crash in an optimizer or codegen.  For
example, an abort put in UnswitchLoops now looks like this:

Stack dump:
0. Program arguments: clang pr3399.c -S -O3
1. <eof> parser at end of file
2. per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module 'pr3399.c'.
4. Running pass 'Loop Pass Manager' on function '@foo'
5. Running pass 'Unswitch loops' on basic block '%for.inc'
Abort

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

15 years agoRemove this as dbginfo intrinsics has been defined as
Zhou Sheng [Fri, 6 Mar 2009 06:05:01 +0000 (06:05 +0000)]
Remove this as dbginfo intrinsics has been defined as
IntrNoMem.

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

15 years agoWhile hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.
Devang Patel [Fri, 6 Mar 2009 06:00:17 +0000 (06:00 +0000)]
While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.

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

15 years agovarious cosmetic cleanups.
Chris Lattner [Fri, 6 Mar 2009 05:53:14 +0000 (05:53 +0000)]
various cosmetic cleanups.

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

15 years agothis wasn't intended to go in.
Chris Lattner [Fri, 6 Mar 2009 05:42:30 +0000 (05:42 +0000)]
this wasn't intended to go in.

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

15 years agoChange various llvm utilities to use PrettyStackTraceProgram in
Chris Lattner [Fri, 6 Mar 2009 05:34:10 +0000 (05:34 +0000)]
Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

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

15 years agoDo not count DbgInfoIntrinsic while estimating loop header size.
Devang Patel [Fri, 6 Mar 2009 03:51:30 +0000 (03:51 +0000)]
Do not count DbgInfoIntrinsic while estimating loop header size.

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

15 years agoSkip DbgInfoIntrinsic.
Devang Patel [Fri, 6 Mar 2009 02:59:27 +0000 (02:59 +0000)]
Skip DbgInfoIntrinsic.

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

15 years agoCommitting unsaved changes that should've been with r66237.
Gordon Henriksen [Fri, 6 Mar 2009 02:42:47 +0000 (02:42 +0000)]
Committing unsaved changes that should've been with r66237.

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

15 years agoFix ScheduleDAGRRList::CopyAndMoveSuccessors' handling of nodes
Dan Gohman [Fri, 6 Mar 2009 02:23:01 +0000 (02:23 +0000)]
Fix ScheduleDAGRRList::CopyAndMoveSuccessors' handling of nodes
with multiple chain operands. This can occur when the scheduler
has added chain operands to a node that already has a chain
operand, in order to handle physical register dependencies.

This fixes an llvm-gcc bootstrap failure on x86-64 introduced
in r66058.

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

15 years agoUse CloneModule's ValueMap to avoid needing to look up
Dan Gohman [Fri, 6 Mar 2009 02:16:23 +0000 (02:16 +0000)]
Use CloneModule's ValueMap to avoid needing to look up
functions by name. This fixes PR718.

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