oota-llvm.git
15 years agoRespect the DisableRedZone flag on PowerPC.
Dan Gohman [Tue, 27 Jan 2009 19:19:28 +0000 (19:19 +0000)]
Respect the DisableRedZone flag on PowerPC.

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

15 years agoSimplify findNonImmUse; return the result using the return value
Dan Gohman [Tue, 27 Jan 2009 19:04:30 +0000 (19:04 +0000)]
Simplify findNonImmUse; return the result using the return value
instead of via a by-reference argument. No functionality change.

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

15 years agoAPInt's countLeadingOnes() was broken for negative i128 values,
Torok Edwin [Tue, 27 Jan 2009 18:06:03 +0000 (18:06 +0000)]
APInt's countLeadingOnes() was broken for negative i128 values,
causing assertion failures in getSExtValue().
Fix it by making highWordBits actually contain what its name says,
and add some more unit-tests for APInt.
This fixes PR3419.

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

15 years agoMake some comments doxygen-friendly.
Dan Gohman [Tue, 27 Jan 2009 17:28:23 +0000 (17:28 +0000)]
Make some comments doxygen-friendly.

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

15 years agoMake the pre-split-limit option more useful by using a per-function counter.
Owen Anderson [Tue, 27 Jan 2009 05:01:15 +0000 (05:01 +0000)]
Make the pre-split-limit option more useful by using a per-function counter.

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

15 years agoImplement multiple with overflow by 2 with an add instruction.
Evan Cheng [Tue, 27 Jan 2009 03:30:42 +0000 (03:30 +0000)]
Implement multiple with overflow by 2 with an add instruction.

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

15 years agoForgot this test case.
Evan Cheng [Tue, 27 Jan 2009 02:59:39 +0000 (02:59 +0000)]
Forgot this test case.

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

15 years agoEliminate unnecessary operands-list traversals.
Dan Gohman [Tue, 27 Jan 2009 02:37:43 +0000 (02:37 +0000)]
Eliminate unnecessary operands-list traversals.

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

15 years agoAdd a FrontendC testcase for the x86-64 Red Zone feature,
Dan Gohman [Tue, 27 Jan 2009 00:59:55 +0000 (00:59 +0000)]
Add a FrontendC testcase for the x86-64 Red Zone feature,
to help verify that the feature may be disabled through
the -mno-red-zone option.

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

15 years agoEnable the red zone on x86-64 by default.
Dan Gohman [Tue, 27 Jan 2009 00:58:47 +0000 (00:58 +0000)]
Enable the red zone on x86-64 by default.

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

15 years agoAssorted debug info fixes.
Devang Patel [Tue, 27 Jan 2009 00:45:04 +0000 (00:45 +0000)]
Assorted debug info fixes.
- DW_AT_bit_size is only suitable for bitfields.
- Encode source location info for derived types.
- Source location and type size info is not useful for subroutine_type (info is included in respective DISubprogram) and array_type.

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

15 years agoAdd a regression test for x86-64 red zone usage.
Dan Gohman [Tue, 27 Jan 2009 00:40:27 +0000 (00:40 +0000)]
Add a regression test for x86-64 red zone usage.

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

15 years agoFix the Red Zone calculation for functions with frame pointers.
Dan Gohman [Tue, 27 Jan 2009 00:40:06 +0000 (00:40 +0000)]
Fix the Red Zone calculation for functions with frame pointers.

Don't use the Red Zone when dynamic stack realignment is needed.
This could be implemented, but most x86-64 ABIs don't require
dynamic stack realignment so it isn't urgent.

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

15 years agoAdd an svn:ignore property.
Dan Gohman [Tue, 27 Jan 2009 00:37:09 +0000 (00:37 +0000)]
Add an svn:ignore property.

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

15 years agoNo need to keep size of DebugLocations vector separately.
Evan Cheng [Mon, 26 Jan 2009 23:47:30 +0000 (23:47 +0000)]
No need to keep size of DebugLocations vector separately.

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

15 years agoTestcase for 6522054.
Dale Johannesen [Mon, 26 Jan 2009 23:22:19 +0000 (23:22 +0000)]
Testcase for 6522054.

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

15 years agoCellSPU:
Scott Michel [Mon, 26 Jan 2009 22:33:37 +0000 (22:33 +0000)]
CellSPU:
- Update DWARF debugging support.

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

15 years agoMake the Dwarf macro information section optional; CellSPU's assembler
Scott Michel [Mon, 26 Jan 2009 22:32:51 +0000 (22:32 +0000)]
Make the Dwarf macro information section optional; CellSPU's assembler
doesn't support it. The default is set to 'true', so this should not
impact any other target backends.

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

15 years agoImplement Red Zone utilization on x86-64. This is currently
Dan Gohman [Mon, 26 Jan 2009 22:22:31 +0000 (22:22 +0000)]
Implement Red Zone utilization on x86-64. This is currently
disabled by default; I'll enable it when I hook it up with
the llvm-gcc flag which controls it.

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

15 years agoMore updates to VC proj...
Steve Naroff [Mon, 26 Jan 2009 22:03:42 +0000 (22:03 +0000)]
More updates to VC proj...

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

15 years agoReapply r63025 and r63026, with fixes for the failing testcases.
Owen Anderson [Mon, 26 Jan 2009 21:57:31 +0000 (21:57 +0000)]
Reapply r63025 and r63026, with fixes for the failing testcases.

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

15 years agoFix PR3393, which amounts to a bug in the expensive
Duncan Sands [Mon, 26 Jan 2009 21:54:18 +0000 (21:54 +0000)]
Fix PR3393, which amounts to a bug in the expensive
checking logic.  Rather than make the checking more
complicated, I've tweaked some logic to make things
conform to how the checking thought things ought to
be, since this results in a simpler "mental model".

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

15 years agoAdd method raw_fd_ostream::seek() for random access within a file.
Ted Kremenek [Mon, 26 Jan 2009 21:42:04 +0000 (21:42 +0000)]
Add method raw_fd_ostream::seek() for random access within a file.

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

15 years agoAt Nick Lewycky's request, rename this test with a more informative name.
Dan Gohman [Mon, 26 Jan 2009 21:36:31 +0000 (21:36 +0000)]
At Nick Lewycky's request, rename this test with a more informative name.

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

15 years agoAlso revert r63206
Bill Wendling [Mon, 26 Jan 2009 21:30:17 +0000 (21:30 +0000)]
Also revert r63206

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

15 years agoTemporarily revert r63025 until the testsuite failures can be fixed.
Bill Wendling [Mon, 26 Jan 2009 21:27:03 +0000 (21:27 +0000)]
Temporarily revert r63025 until the testsuite failures can be fixed.

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

15 years agoFix the name of an argument.
Dan Gohman [Mon, 26 Jan 2009 20:27:11 +0000 (20:27 +0000)]
Fix the name of an argument.

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

15 years agoDuring bittest switch lowering emit shift in the test block, which should (theoretically)
Anton Korobeynikov [Mon, 26 Jan 2009 19:26:01 +0000 (19:26 +0000)]
During bittest switch lowering emit shift in the test block, which should (theoretically)
allow us to generate more efficient code. We don't do this now though :)

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

15 years agoGet rid of a bunch of dead code now that interval reconstruction is enabled.
Owen Anderson [Mon, 26 Jan 2009 19:18:06 +0000 (19:18 +0000)]
Get rid of a bunch of dead code now that interval reconstruction is enabled.

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

15 years agoFix an issue where LiveIntervals was trying to be smart about removing kill
Owen Anderson [Mon, 26 Jan 2009 19:12:06 +0000 (19:12 +0000)]
Fix an issue where LiveIntervals was trying to be smart about removing kill
markers, and ended up foiling the interval reconstruction.

This allows us to turn on reconstruction in the pre alloc splitter, which
fixes a number of miscompilations.

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

15 years agoEnhance logic in X86DAGToDAGISel::PreprocessForRMW which move load inside callseq_sta...
Evan Cheng [Mon, 26 Jan 2009 18:43:34 +0000 (18:43 +0000)]
Enhance logic in X86DAGToDAGISel::PreprocessForRMW which move load inside callseq_start to allow it to be folded into a call. It was not considering the cases where a token factor is between the load and the callseq_start.

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

15 years agoSilence a bogus compiler warning.
Evan Cheng [Mon, 26 Jan 2009 18:33:51 +0000 (18:33 +0000)]
Silence a bogus compiler warning.

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

15 years agoUpdate VS project files.
Steve Naroff [Mon, 26 Jan 2009 18:08:55 +0000 (18:08 +0000)]
Update VS project files.

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

15 years agoFix a bug in BitVector.h. All assignment operations (except the usual
Roman Levenstein [Mon, 26 Jan 2009 11:07:20 +0000 (11:07 +0000)]
Fix a bug in BitVector.h. All assignment operations (except the usual
assignment operator) were returning a copy of the bit vector, instead of a
reference! This old semantics probably did not meet the expectations.
With this patch, chained assignments happen to the right object.

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

15 years agoActually source file has already been uniquified into an id during isel. Eliminate...
Evan Cheng [Mon, 26 Jan 2009 07:53:42 +0000 (07:53 +0000)]
Actually source file has already been uniquified into an id during isel. Eliminate the StringMap.

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

15 years agoAdd data structure to define and track debug location during codegen.
Evan Cheng [Mon, 26 Jan 2009 07:41:49 +0000 (07:41 +0000)]
Add data structure to define and track debug location during codegen.

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

15 years agoLooks like comments were chopped off.
Evan Cheng [Mon, 26 Jan 2009 07:40:13 +0000 (07:40 +0000)]
Looks like comments were chopped off.

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

15 years agoLLVM_SUPPORT_DEBUGINFO_H -> LLVM_ANALYSIS_DEBUGINFO_H since DebugInfo.h is under...
Evan Cheng [Mon, 26 Jan 2009 07:31:20 +0000 (07:31 +0000)]
LLVM_SUPPORT_DEBUGINFO_H -> LLVM_ANALYSIS_DEBUGINFO_H since DebugInfo.h is under Analysis.

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

15 years agoFixed optimization of combining two shuffles where the first shuffle inputs
Mon P Wang [Mon, 26 Jan 2009 04:39:00 +0000 (04:39 +0000)]
Fixed optimization of combining two shuffles where the first shuffle inputs
has a different number of elements than the output.

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

15 years agoTake the next steps in making SDUse more consistent with LLVM Use, and
Dan Gohman [Mon, 26 Jan 2009 04:35:06 +0000 (04:35 +0000)]
Take the next steps in making SDUse more consistent with LLVM Use, and
tidy up SDUse and related code.
 - Replace the operator= member functions with a set method, like
   LLVM Use has, and variants setInitial and setNode, which take
   care up updating use lists, like LLVM Use's does. This simplifies
   code that calls these functions.
 - getSDValue() is renamed to get(), as in LLVM Use, though most
   places can either use the implicit conversion to SDValue or the
   convenience functions instead.
 - Fix some more node vs. value terminology issues.

Also, eliminate the one remaining use of SDOperandPtr, and
SDOperandPtr itself.

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

15 years agoUntabify code.
Scott Michel [Mon, 26 Jan 2009 03:37:41 +0000 (03:37 +0000)]
Untabify code.

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

15 years agoCellSPU:
Scott Michel [Mon, 26 Jan 2009 03:31:40 +0000 (03:31 +0000)]
CellSPU:
- Rename fcmp.ll test to fcmp32.ll, start adding new double tests to fcmp64.ll
- Fix select_bits.ll test
- Capitulate to the DAGCombiner and move i64 constant loads to instruction
  selection (SPUISelDAGtoDAG.cpp).

  <rant>DAGCombiner will insert all kinds of 64-bit optimizations after
  operation legalization occurs and now we have to do most of the work that
  instruction selection should be doing twice (once to determine if v2i64
  build_vector can be handled by SelectCode(), which then runs all of the
  predicates a second time to select the necessary instructions.) But,
  CellSPU is a good citizen.</rant>

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

15 years agoFix a typo
Nate Begeman [Mon, 26 Jan 2009 03:15:54 +0000 (03:15 +0000)]
Fix a typo

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

15 years agoDe-identifying per sabre review
Nate Begeman [Mon, 26 Jan 2009 03:15:31 +0000 (03:15 +0000)]
De-identifying per sabre review

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

15 years agoBuild libLTO on any platform so long as PIC is enabled.
Nick Lewycky [Mon, 26 Jan 2009 03:04:57 +0000 (03:04 +0000)]
Build libLTO on any platform so long as PIC is enabled.

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

15 years agoAdd some documentation for address-space-based access to the segment registers.
Nate Begeman [Mon, 26 Jan 2009 02:54:45 +0000 (02:54 +0000)]
Add some documentation for address-space-based access to the segment registers.

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

15 years agoHandle single-entry phi nodes gracefully in condprop.
Chris Lattner [Mon, 26 Jan 2009 02:18:20 +0000 (02:18 +0000)]
Handle single-entry phi nodes gracefully in condprop.

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

15 years agoFix PR3408 by making a non-obvious assumption very obvious, and
Chris Lattner [Mon, 26 Jan 2009 02:11:30 +0000 (02:11 +0000)]
Fix PR3408 by making a non-obvious assumption very obvious, and
handling the flaw inherent in that assumption.  :)

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

15 years agoMore cleanups and simplifications, no functionality change.
Chris Lattner [Mon, 26 Jan 2009 01:57:01 +0000 (01:57 +0000)]
More cleanups and simplifications, no functionality change.

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

15 years agotidy asserts
Chris Lattner [Mon, 26 Jan 2009 01:38:24 +0000 (01:38 +0000)]
tidy asserts

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

15 years agoMap address space 256 to gs; similar mappings could be supported for the
Nate Begeman [Mon, 26 Jan 2009 01:24:32 +0000 (01:24 +0000)]
Map address space 256 to gs; similar mappings could be supported for the
other x86 segments.  address space 0 is stack/default, 1-255 are reserved for
client use.

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

15 years agoSupport pattern matching various x86 sse shifts.
Nate Begeman [Mon, 26 Jan 2009 00:52:55 +0000 (00:52 +0000)]
Support pattern matching various x86 sse shifts.

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

15 years agosilence a warning when assertions are disabled.
Chris Lattner [Sun, 25 Jan 2009 23:08:00 +0000 (23:08 +0000)]
silence a warning when assertions are disabled.

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

15 years agoshould have removed the + when manually applying a patch!
Torok Edwin [Sun, 25 Jan 2009 20:29:34 +0000 (20:29 +0000)]
should have removed the + when manually applying a patch!

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

15 years agorevert this patch for now, because Codegen does still want to generate SSE code,
Torok Edwin [Sun, 25 Jan 2009 20:21:24 +0000 (20:21 +0000)]
revert this patch for now, because Codegen does still want to generate SSE code,
for example in the case of va-args. XFAIL associated tests.

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

15 years agotestcase for llvm-gcc part of PR3402.
Torok Edwin [Sun, 25 Jan 2009 18:00:06 +0000 (18:00 +0000)]
testcase for llvm-gcc part of PR3402.

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

15 years agoIf user explicitly asks not to use SSE, don't force it. This fixes LLVM part of PR3402.
Torok Edwin [Sun, 25 Jan 2009 17:58:56 +0000 (17:58 +0000)]
If user explicitly asks not to use SSE, don't force it. This fixes LLVM part of PR3402.

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

15 years agoEliminate the loop that searches through each of the operands
Dan Gohman [Sun, 25 Jan 2009 16:29:12 +0000 (16:29 +0000)]
Eliminate the loop that searches through each of the operands
of each use in the SelectionDAG ReplaceAllUses* functions. Thanks
to Chris for spotting this opportunity.

Also, factor out code from all 5 of the ReplaceAllUses* functions
into AddNonLeafNodeToCSEMaps, which is now renamed
AddModifiedNodeToCSEMaps to more accurately reflect its purpose.

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

15 years agoWhitespace tidiments.
Dan Gohman [Sun, 25 Jan 2009 16:21:38 +0000 (16:21 +0000)]
Whitespace tidiments.

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

15 years agoMove the N->use_empty() assert from DeleteNode to
Dan Gohman [Sun, 25 Jan 2009 16:20:37 +0000 (16:20 +0000)]
Move the N->use_empty() assert from DeleteNode to
DeleteNodeNotInCSEMaps, since DeleteNode just calls
DeleteNodeNotInCSEMaps.

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

15 years agoReality-check the FAQ entry for "Can I use LLVM to convert C++ to C?"
Dan Gohman [Sun, 25 Jan 2009 16:04:50 +0000 (16:04 +0000)]
Reality-check the FAQ entry for "Can I use LLVM to convert C++ to C?"

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

15 years agoStart generating arbitrary precision integer SCEVs. This removes the temporary
Nick Lewycky [Sun, 25 Jan 2009 08:16:27 +0000 (08:16 +0000)]
Start generating arbitrary precision integer SCEVs. This removes the temporary
code that rounded up and capped the size.

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

15 years agoActually run the test in this directory.
Nick Lewycky [Sun, 25 Jan 2009 08:05:07 +0000 (08:05 +0000)]
Actually run the test in this directory.

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

15 years agoThe function that does nothing but call malloc is noalias return.
Nick Lewycky [Sun, 25 Jan 2009 07:59:57 +0000 (07:59 +0000)]
The function that does nothing but call malloc is noalias return.

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

15 years agoPrivate linkage support for PPC / Darwin.
Evan Cheng [Sun, 25 Jan 2009 06:32:01 +0000 (06:32 +0000)]
Private linkage support for PPC / Darwin.

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

15 years agoTeach 2addr pass to be do more commuting. If both uses of a two-address instruction...
Evan Cheng [Sun, 25 Jan 2009 03:53:59 +0000 (03:53 +0000)]
Teach 2addr pass to be do more commuting. If both uses of a two-address instruction are killed, but the first operand has a use before and after the def, commute if the second operand does not suffer from the same issue.
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1
%reg1029<def> = MOV8rr %reg1028
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>
insert => %reg1030<def> = MOV8rr %reg1028
%reg1030<def> = ADD8rr %reg1028<kill>, %reg1029<kill>, %EFLAGS<imp-def,dead>

In this case, it might not be possible to coalesce the second MOV8rr
instruction if the first one is coalesced. So it would be profitable to
commute it:
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1
%reg1029<def> = MOV8rr %reg1028
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>
insert => %reg1030<def> = MOV8rr %reg1029
%reg1030<def> = ADD8rr %reg1029<kill>, %reg1028<kill>, %EFLAGS<imp-def,dead>

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

15 years agoFix an indent and a typo.
Nate Begeman [Sat, 24 Jan 2009 22:12:48 +0000 (22:12 +0000)]
Fix an indent and a typo.

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

15 years agoRevert previous change; even this mild and clearly
Dale Johannesen [Sat, 24 Jan 2009 21:49:34 +0000 (21:49 +0000)]
Revert previous change; even this mild and clearly
more accurate change loses more than it gains on
benchmarks.

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

15 years agoadd note about possible GEP improvement with fields of size 0.
Torok Edwin [Sat, 24 Jan 2009 19:30:25 +0000 (19:30 +0000)]
add note about possible GEP improvement with fields of size 0.

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

15 years agoAdd a PR comment to this test.
Dan Gohman [Sat, 24 Jan 2009 17:32:54 +0000 (17:32 +0000)]
Add a PR comment to this test.

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

15 years agotestcase for PR3381.
Torok Edwin [Sat, 24 Jan 2009 17:16:04 +0000 (17:16 +0000)]
testcase for PR3381.
Also it was an empty struct, not a void after all.

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

15 years agoAdd more documentation mentioning the limitations due to PR2660.
Dan Gohman [Sat, 24 Jan 2009 15:58:40 +0000 (15:58 +0000)]
Add more documentation mentioning the limitations due to PR2660.

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

15 years agovoid* is represented as pointer to empty struct {}.
Torok Edwin [Sat, 24 Jan 2009 11:30:49 +0000 (11:30 +0000)]
void* is represented as pointer to empty struct {}.
Thus we need to check whether the struct is empty before trying to index into
it. This fixes PR3381.

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

15 years agoSome cleanups. No functional changes.
Owen Anderson [Sat, 24 Jan 2009 10:07:43 +0000 (10:07 +0000)]
Some cleanups.  No functional changes.

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

15 years agoImprove the inlining cost function a bit.
Dale Johannesen [Sat, 24 Jan 2009 01:27:33 +0000 (01:27 +0000)]
Improve the inlining cost function a bit.
Little practical effect.

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

15 years agoMake InstCombineStoreToCast handle aggregates more aggressively,
Chris Lattner [Sat, 24 Jan 2009 01:00:13 +0000 (01:00 +0000)]
Make InstCombineStoreToCast handle aggregates more aggressively,
handling the case in Transforms/InstCombine/cast-store-gep.ll, which
is a heavily reduced testcase from Clang on x86-64.

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

15 years agoPerform optional clang building.
Mike Stump [Sat, 24 Jan 2009 00:00:41 +0000 (00:00 +0000)]
Perform optional clang building.

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

15 years agoRefactor code. No functionality change.
Evan Cheng [Fri, 23 Jan 2009 23:27:33 +0000 (23:27 +0000)]
Refactor code. No functionality change.

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

15 years agoIntroduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags.
Devang Patel [Fri, 23 Jan 2009 22:33:47 +0000 (22:33 +0000)]
Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags.

DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way.

DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by  a project, irrespective of whether the project used makefile, Xcode or something else.

llvm-gcc patch is next.

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

15 years agohopefully address PR3379 by making the P modifier work in x86 inline asm.
Chris Lattner [Fri, 23 Jan 2009 22:33:40 +0000 (22:33 +0000)]
hopefully address PR3379 by making the P modifier work in x86 inline asm.

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

15 years agoFix test case. Use valid file name and directory in global variable's debug info...
Devang Patel [Fri, 23 Jan 2009 21:54:18 +0000 (21:54 +0000)]
Fix test case. Use valid file name and directory in global variable's debug info entry.

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

15 years agouse CallSite::isCalle instead of slow getOperandNo
Gabor Greif [Fri, 23 Jan 2009 21:17:04 +0000 (21:17 +0000)]
use CallSite::isCalle instead of slow getOperandNo

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

15 years agoSimplify the logic of getting hold of a PHI predecessor block.
Gabor Greif [Fri, 23 Jan 2009 19:40:15 +0000 (19:40 +0000)]
Simplify the logic of getting hold of a PHI predecessor block.
There is now a direct way from value-use-iterator to incoming block in PHINode's API.
This way we avoid the iterator->index->iterator trip, and especially the costly
getOperandNo() invocation. Additionally there is now an assertion that the iterator
really refers to one of the PHI's Uses.

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

15 years agoAdd support for deleting a module provider from a JIT in such a way that it does...
Nate Begeman [Fri, 23 Jan 2009 19:27:28 +0000 (19:27 +0000)]
Add support for deleting a module provider from a JIT in such a way that it does not cause the owned module to be fully materialized.

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

15 years agoEmpty DIType represents void. In this case no need to construct any type DIE.
Devang Patel [Fri, 23 Jan 2009 19:13:31 +0000 (19:13 +0000)]
Empty DIType represents void. In  this case no need to construct any type DIE.

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

15 years agoFold x-0 to x in unsafe-fp-math mode. This comes up in the
Dan Gohman [Fri, 23 Jan 2009 19:10:37 +0000 (19:10 +0000)]
Fold x-0 to x in unsafe-fp-math mode. This comes up in the
testcase from PR3376, and in fact is sufficient to completely
avoid the problem in that testcase.

There's an underlying problem though; TLI.isOperationLegal
considers Custom to be Legal, which might be ok in some
cases, but that's what DAGCombiner is using in many places
to test if something is legal when LegalOperations is true.
When DAGCombiner is running after legalize, this isn't
sufficient. I'll address this in a separate commit.

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

15 years agoPatch to build llvm with srcdir != objdir from
Duncan Sands [Fri, 23 Jan 2009 08:42:38 +0000 (08:42 +0000)]
Patch to build llvm with srcdir != objdir from
llvm-top.  By Michael Schuerig, with some small
tweaks to make the "don't configure if already
configured" logic work.

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

15 years agofix two more cases where we could let the NLPDI cache get unsorted.
Chris Lattner [Fri, 23 Jan 2009 07:12:16 +0000 (07:12 +0000)]
fix two more cases where we could let the NLPDI cache get unsorted.
With this, sqlite3 now passes.

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

15 years agoUnconditionally reset 'cache' to zero, even if we don't need to resort it.
Chris Lattner [Fri, 23 Jan 2009 06:48:41 +0000 (06:48 +0000)]
Unconditionally reset 'cache' to zero, even if we don't need to resort it.
This avoids using a dangling pointer.

Reset NumSortedEntries after restoring Cache to avoid extraneous sorts.
This fixes the reduced sqlite3 testcase, but apparently not the whole app.

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

15 years agoOnly check if coalescing is worthwhile when the result is targeting a more restrictiv...
Evan Cheng [Fri, 23 Jan 2009 05:48:59 +0000 (05:48 +0000)]
Only check if coalescing is worthwhile when the result is targeting a more restrictive register class.

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

15 years agoUpdate test to reflect command line option name change.
Evan Cheng [Fri, 23 Jan 2009 05:45:31 +0000 (05:45 +0000)]
Update test to reflect command line option name change.

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

15 years agoStage two of fixing pre-alloc-splitting's code size issues: filter out restores that...
Owen Anderson [Fri, 23 Jan 2009 03:28:53 +0000 (03:28 +0000)]
Stage two of fixing pre-alloc-splitting's code size issues: filter out restores that are just
going to be re-spilled again.

This also helps performance.  Pre-alloc-splitting now seems to be an overall win on SPEC.

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

15 years agoCross register class coalescing. Not yet enabled.
Evan Cheng [Fri, 23 Jan 2009 02:15:19 +0000 (02:15 +0000)]
Cross register class coalescing. Not yet enabled.

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

15 years agoCode did not follow associated comment. not a good idea.
Devang Patel [Fri, 23 Jan 2009 01:25:58 +0000 (01:25 +0000)]
Code did not follow associated comment. not a good idea.

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

15 years agoSet appropriate tag for the composite type.
Devang Patel [Fri, 23 Jan 2009 01:19:09 +0000 (01:19 +0000)]
Set appropriate tag for the composite type.

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

15 years agoa minor tweak to my previous patch, handle the invalidation case
Chris Lattner [Fri, 23 Jan 2009 00:27:03 +0000 (00:27 +0000)]
a minor tweak to my previous patch, handle the invalidation case
when there are multiple iterations of the loop.  This fixes PR3375.

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

15 years agoAdd an initial pass at dead spill/restore removal for pre alloc splitting.
Owen Anderson [Fri, 23 Jan 2009 00:23:32 +0000 (00:23 +0000)]
Add an initial pass at dead spill/restore removal for pre alloc splitting.

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

15 years agodo not sign extend characters input to isprint. This improves
Chris Lattner [Thu, 22 Jan 2009 23:38:45 +0000 (23:38 +0000)]
do not sign extend characters input to isprint.  This improves
compatibility with VC++.  Patch by Max Burke!

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

15 years agoHandful of fixes to the VC project files.
Steve Naroff [Thu, 22 Jan 2009 23:05:37 +0000 (23:05 +0000)]
Handful of fixes to the VC project files.

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

15 years agoFix a minor bug in DAGCombiner's folding of SELECT. Folding "select C, 0, 1"
Bob Wilson [Thu, 22 Jan 2009 22:05:48 +0000 (22:05 +0000)]
Fix a minor bug in DAGCombiner's folding of SELECT.  Folding "select C, 0, 1"
to "C ^ 1" is only valid when C is known to be either 0 or 1.  Most of the
similar foldings in this function only handle "i1" types, but this one appears
intentionally written to handle larger integer types.  If C has an integer
type larger than "i1", this needs to check if the high bits of a boolean
are known to be zero.  I also changed the comment to describe this folding as
"C ^ 1" instead of "~C", since that is what the code does and since the latter
would only be valid for "i1" types.  The good news is that most LLVM targets
use TargetLowering::ZeroOrOneBooleanContent so this change will not disable
the optimization; the bad news is that I've been unable to come up with a
testcase to demonstrate the problem.

I have also removed a "FIXME" comment for folding "select C, X, 0" to "C & X",
since the code looks correct to me.  It could be made more aggressive by not
limiting the type to "i1", but that would then require checking for
TargetLowering::ZeroOrNegativeOneBooleanContent.  Similar changes could be
done for the other SELECT foldings, but it was decided to be not worth the
trouble and complexity (see e.g., r44663).

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