Commit Graph

56754 Commits

Author SHA1 Message Date
Mikhail Glushenkov
1124cc02b4 Support some more options...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 18:19:36 +00:00
Dan Gohman
8ca83b4111 Remove the folding rule
getelementptr (i8* inttoptr (i64 1 to i8*), i32 -1) 
  to
  inttoptr (i64 0 to i8*)
from the VMCore constant folder. It didn't handle sign-extension properly
in the case where the source integer is smaller than a pointer size. And,
it relied on an assumption about sizeof(i8).

The Analysis constant folder still folds these kinds of things; it has
access to TargetData, so it can do them right.

Add a testcase which tests that the VMCore constant folder doesn't
miscompile this, and that the Analysis folder does fold it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 18:08:26 +00:00
Benjamin Kramer
12ea66a727 Replace strcpy with memcpy when we have the length around anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94746 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 18:04:38 +00:00
Duncan Sands
2c47368a7d Fix PR6165. The bug was that LHSKnownZero was being and'd with DemandedMask
when it should have been and'd with LowBits.  Fix that and while there beef
up the logic in the case of a negative LHS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94745 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 17:22:42 +00:00
Douglas Gregor
21569cddc1 Add llvm::Program::ChangeStderrToBinary().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 06:42:08 +00:00
Dan Gohman
150dfa8711 Check Type::isSized before calling ScalarEvolution::getAllocSizeExpr,
rather than after.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94742 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 06:32:46 +00:00
Chris Lattner
a34103f6fa convert the last 3 targets to use EmitFunctionBody() now that
it has before/end body hooks.

 lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp |   49 ++-----------
 lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp   |   87 ++++++------------------
 lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp |   56 +++------------
 test/CodeGen/XCore/ashr.ll                      |    2 
 4 files changed, 48 insertions(+), 146 deletions(-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94741 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 06:22:43 +00:00
Dan Gohman
06ed3e788a Make getAlignOf return an i64, for consistency with getSizeOf and
getOffsetOf, and remove the comment about assuming i8 is byte-aligned,
which is no longer applicable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94738 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 02:43:22 +00:00
Dan Gohman
0f5efe5625 Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their place
use plain SCEVUnknowns with ConstantExpr::getSizeOf and
ConstantExpr::getOffsetOf constants. This eliminates a bunch of
special-case code.

Also add code for pattern-matching these expressions, for clients that
want to recognize them.

Move ScalarEvolution's logic for expanding array and vector sizeof
expressions into an element count times the element size, to expose
the multiplication to subsequent folding, into the regular constant
folder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94737 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 02:15:55 +00:00
Chris Lattner
edfe776ac2 add target hooks for emitting random gunk before and after the function body.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94732 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:58:58 +00:00
Evan Cheng
5fef8bc1cb Fix a bug introduced by r94490 where it created a X86ISD::CMP whose output type is different from its inputs.
This fixes PR6146.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:57:22 +00:00
Chris Lattner
a6086fc975 switch blackfin to the default runOnMachineFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94729 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:54:33 +00:00
Chris Lattner
08acebc511 eliminate a now-useless class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:50:22 +00:00
Chris Lattner
745ec06ad2 Switch MSP430, SPU, Sparc, and SystemZ to use EmitFunctionBody().
Diffstat:
 6 files changed, 30 insertions(+), 284 deletions(-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94727 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:48:52 +00:00
Jim Grosbach
ca752c9020 Update of 94055 to track the IR level call site information via an intrinsic.
This allows code gen and the exception table writer to cooperate to make sure
landing pads are associated with the correct invoke locations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94726 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:45:32 +00:00
Jeffrey Yasskin
4fcd607c56 Record the death of ModuleProvier and GhostLinkage in the release notes and
give upgrade instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94723 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:41:20 +00:00
Chris Lattner
d49fe1b6bc Give AsmPrinter the most common expected implementation of
runOnMachineFunction, and switch PPC to use EmitFunctionBody.
The two ppc asmprinters now don't heave to define 
runOnMachineFunction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94722 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:28:58 +00:00
Jeffrey Yasskin
bec487767c Truncate the release notes so they're ready to accumulate notes for the 2.7 release.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94720 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:14:43 +00:00
Chris Lattner
a786ceac5c switch ARM to EmitFunctionBody().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94719 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:10:34 +00:00
Chris Lattner
10e7c60c04 emit a 0 byte instead of a noop if a function is empty on darwin.
"0" is nice and target independent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94718 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:06:32 +00:00
Chris Lattner
14c38ec2af Remove the argument from EmitJumpTableInfo, because it doesn't need it.
Move the X86 implementation of function body emission up to 
AsmPrinter::EmitFunctionBody, which works by calling the virtual
EmitInstruction method.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94716 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 01:02:27 +00:00
Chris Lattner
a2406190ca Drop the argument to AsmPrinter::EmitConstantPool and make it virtual.
Overload it in the ARM backend to do nothing, since is does insane
constant pool emission.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94708 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 00:19:24 +00:00
Chris Lattner
80c062001e don't emit constant pools twice.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94706 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 00:15:18 +00:00
Chris Lattner
be9dfcef82 rename printVisibility to EmitVisibility and make it private,
constify EmitLinkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-28 00:05:10 +00:00
Chris Lattner
953ebb769a switch ARM to use EmitFunctionHeader.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94703 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 23:58:11 +00:00
Chris Lattner
7d7dab0278 eliminate the ARMFunctionInfo::Align member, using
MachineFunction::Alignment instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94701 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 23:37:36 +00:00
Chris Lattner
aeb7be3435 add a helper function for bumping up the alignment of a machine function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94700 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 23:35:43 +00:00
Chris Lattner
ff0210d0b0 switch blackfin to use EmitFunctionHeader. BlackfinAsmPrinter.cpp
is now less than 200 LOC!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 23:26:37 +00:00
Chris Lattner
5006071f7a switch mips to use the shared EmitFunctionHeader() function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94698 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 23:23:58 +00:00
Sean Callanan
e2749017e1 Changed constants to an enum so as not to pollute the
global namespace needlessly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94697 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 23:20:51 +00:00
Sean Callanan
c3fbf91697 Added a header file defining the externally-visible C API
for the LLVM disassemblers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94696 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 23:03:46 +00:00
Dale Johannesen
9514fcbae5 If the only use of something is a DEBUG_VALUE, don't
let that stop it from being deleted, and change the
DEBUG_VALUE value to undef.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94694 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 22:12:36 +00:00
Dale Johannesen
714eb731b2 Treat MO_REG 0 location as undefined in DEBUG_VALUE,
per document.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94693 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 22:11:16 +00:00
Dan Gohman
16abe7d5b5 Add an svn:ignore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94692 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 22:06:46 +00:00
Victor Hernandez
7bf5cf401f Need to recurse for all operands of function-local metadata; and handle Instructions (which map to themselves)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94691 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 22:03:03 +00:00
Bob Wilson
e98585eb36 Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.
This was already being done in SSAUpdater::GetValueAtEndOfBlock so I've
just changed SSAUpdater to check for existing PHIs in both places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94690 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 22:01:02 +00:00
Ted Kremenek
49a43f189b Update CMake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:44:12 +00:00
Jeffrey Yasskin
f0356fe140 Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods.  The bindings to
other languages still use the ModuleProvider concept.  It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 20:34:15 +00:00
Benjamin Kramer
5deb57c685 Don't bother with sprintf, just pass the Twine through.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94684 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 19:58:47 +00:00
Benjamin Kramer
2d64ca09d4 Use the less expensive getName function instead of getNameStr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94683 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 19:46:52 +00:00
Chandler Carruth
6f03433516 Quick fix to a test that is currently failing on every Linux build bot. No idea
if this is the "correct" fix, but it seems a strict improvement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94675 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 10:36:15 +00:00
Chandler Carruth
de4c08008a Silence GCC warnings with asserts turned off. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94673 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 10:27:10 +00:00
Mikhail Glushenkov
42210668da Make SMDiagnostic::Print a const method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94672 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 10:13:28 +00:00
Mikhail Glushenkov
e690ffbe6d Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94671 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 10:13:11 +00:00
Duncan Sands
bc15f242d5 Revert commit 94666 (ddunbar) [Suppress clang warning about unused arguments].
It causes g++ to complain: unrecognized option '-Qunused-arguments'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 10:08:08 +00:00
Chris Lattner
2cf7251d39 add a new AsmPrinter::EmitFunctionEntryLabel virtual function,
which allows targets to override function entry label emission.
Use it to convert linux/ppc to use EmitFunctionHeader().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94667 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 07:21:55 +00:00
Daniel Dunbar
ed240c474d Suppress clang warning about unused arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94666 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 07:10:10 +00:00
Evan Cheng
b17124553d Perform trivial tail call optimization for callees with "C" ABI. These are done
even when -tailcallopt is not specified and it does not require changing ABI.
First case is the most trivial one. Perform tail call optimization when both
the caller and callee do not return values and when the callee does not take
any input arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94664 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 06:25:16 +00:00
Chris Lattner
0a65a14417 merge two ifs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94650 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 02:18:21 +00:00
Chris Lattner
3511c70d18 some cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94649 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-27 02:12:20 +00:00