Commit Graph

14846 Commits

Author SHA1 Message Date
Lang Hames
5fa792e65a Re-applying the target data layout verification patch from r142288, plus appropriate CMake dependencies.
Thanks to Raphael Espindola for tracking down the CMake issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142306 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 23:24:48 +00:00
Nick Lewycky
44d798d976 Add support for a new extension to the .file directive:
.file filenumber "directory" "filename"

This removes one join+split of the directory+filename in MC internals. Because
bitcode files have independent fields for directory and filenames in debug info,
this patch may change the .o files written by existing .bc files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142300 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 23:05:28 +00:00
Rafael Espindola
10820d9a97 142288 broke the build:
Linking CXX executable ../../bin/llvm-as
../../lib/libLLVMAsmParser.a(LLParser.cpp.o):/home/espindola/llvm/llvm/lib/AsmParser/LLParser.cpp:function llvm::LLParser::ParseTargetDefinition(): error: undefined reference to 'llvm::TargetData::parseSpecifier(llvm::StringRef, llvm::TargetData*)'
clang-3: error: linker command failed with exit code 1 (use -v to see invocation)

Revert "Validate target data layout strings."

This reverts commit 599d2d4c25.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142296 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 22:37:51 +00:00
Lang Hames
599d2d4c25 Validate target data layout strings.
Invalid strings in asm files will result in parse errors. Invalid string literals passed to TargetData constructors will result in an assertion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142288 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 22:05:34 +00:00
Owen Anderson
df3f929ec2 Add an accessor to get the underlying MachO representation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142261 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 21:37:03 +00:00
Owen Anderson
9ca9acfaff Use the correct predicate for determining if a branch is conditional or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142257 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 21:21:44 +00:00
Benjamin Kramer
b006337bb8 MCOperand is pod-like.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142253 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 21:18:03 +00:00
Michael J. Spencer
1130a799ab Object: Fix redundant name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 20:19:29 +00:00
Bill Wendling
3c5e60994f Correct over-zealous removal of hack.
Some code want to check that *any* call within a function has the 'returns
twice' attribute, not just that the current function has one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142221 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 18:43:40 +00:00
Hal Finkel
442bf7a64d Add comments to TargetLowering.h indicating that the set*Alignment functions take arguments in log2(bytes)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142213 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 18:23:13 +00:00
Bill Wendling
728662f9e8 Now that we have the ReturnsTwice function attribute, this method is
obsolete. Check the attribute instead.
<rdar://problem/8031714>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142212 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 18:22:52 +00:00
Jakob Stoklund Olesen
4007529d4b Admonish that MI is not IR and virtual registers have constraints.
In machine code, you can't just replaceRegWith() the same way you can
replaceAllUsesWith() in IR.  Virtual registers may have different
register classes that need to be merged first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142201 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 17:33:39 +00:00
Devang Patel
827454e6e2 svn mv Target/ARM/ARMGlobalMerge.cpp Transforms/Scalar/GlobalMerge.cpp
There is no reason to have simple IR level pass in lib/Target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142200 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 17:17:43 +00:00
Chandler Carruth
602650c988 Add a routine to swap branch instruction operands, and update any
profile metadata at the same time. Use it to preserve metadata attached
to a branch when re-writing it in InstCombine.

Add metadata to the canonicalize_branch InstCombine test, and check that
it is tranformed correctly.

Reviewed by Nick Lewycky!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-17 01:11:57 +00:00
Benjamin Kramer
5efabcf01d Add AsmToken::getEndLoc and use it to add ranges to x86 asm register parsing.
<stdin>:1:12: error: register %rax is only available in 64-bit mode
   incl    %rax
           ^~~~

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142137 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 12:10:27 +00:00
Benjamin Kramer
04a0426cc2 PR11143: Save the old diagnostic handler and call it when munging diagnostics for #line directives.
This reenables proper inline asm diagnostics in clang

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142132 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 10:48:29 +00:00
Chris Lattner
462b43cbf6 remove the dead 'ShowLine' argument from SMDiagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142108 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 05:47:55 +00:00
Chris Lattner
3f2d5f60b3 Make SMDiagnostic a little more sane. Instead of passing around note/warning/error as a
string, pass it around as an enum.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 05:43:57 +00:00
Chris Lattner
d8b7aa2613 Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang does. Enhance
the X86 asmparser to produce ranges in the one case that was annoying me, for example:

test.s:10:15: error: invalid operand for instruction
movl 0(%rax), 0(%edx)
              ^~~~~~~

It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use 
ranges where appropriate if someone is interested.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142106 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-16 04:47:35 +00:00
Nick Lewycky
56169787db Fix extra whitespace in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142079 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-15 19:36:45 +00:00
Andrew Trick
365c9f1ff5 Fix SCEVExpander assert during LSR: "argument of incompatible type".
Just because we're dealing with a GEP doesn't mean we can assert the
SCEV has a pointer type. The fix is simply to ignore the SCEV pointer
type, which we really didn't need.
Fixes PR11138 webkit crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142058 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-15 06:19:55 +00:00
Torok Edwin
3dd1674186 ocaml bindings: introduce classify_value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141991 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-14 20:37:56 +00:00
Torok Edwin
6563c87996 ocaml bindings: add getopcode for constant and instruction, and int64_of_const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141990 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-14 20:37:49 +00:00
Akira Hatanaka
88c1103c22 Add ELF relocation types for Mips.
Patch by Jack Carter and Reed Kotler at Mips. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141935 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-14 02:43:18 +00:00
Eli Friedman
b414142036 Enhance the memdep interface so that users can tell the difference between a dependency which cannot be calculated and a path reaching the entry point of the function. This patch introduces isNonFuncLocal, which replaces isUnknown in some cases.
Patch by Xiaoyi Guo.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141896 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 22:14:57 +00:00
Richard Osborne
a4d326dcef Update IntrinsicsXCore.td with the normal LLVM notice at the top of the file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141889 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 21:08:11 +00:00
Michael J. Spencer
c8f6c44af4 Fix incorrect ELF typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141871 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 17:33:52 +00:00
Michael J. Spencer
fc61a23506 Add missing ELF constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141840 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-13 00:16:25 +00:00
Jakob Stoklund Olesen
f5916976e9 Add MachineInstr::getRegClassConstraint().
Most instructions have some requirements for their register operands.
Usually, this is expressed as register class constraints in the
MCInstrDesc, but for inline assembly the constraints are encoded in the
flag words.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141835 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 23:37:36 +00:00
Jakob Stoklund Olesen
9dfaacb696 Extract a method for finding the inline asm flag operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141834 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 23:37:33 +00:00
Jakob Stoklund Olesen
459b74b964 Encode register class constreaints in inline asm instructions.
The inline asm operand constraint is initially encoded in the virtual
register for the operand, but that register class may change during
coalescing, and the original constraint is lost.

Encode the original register class as part of the flag word for each
inline asm operand.  This makes it possible to recover the actual
constraint required by inline asm, just like we can for normal
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 23:37:29 +00:00
Eli Friedman
a046d2ff9a Use unsigned multiply to hash integers, so we don't end up with undefined behavior for large signed integers. Based on patch by Ahmed Charles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141827 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 22:25:45 +00:00
Kevin Enderby
acbaecd4c8 Finish supporting cpp #file/line comments in assembler for error messages. So
for cpp pre-processed assembly we give correct filename and line numbers when
reporting errors in assembly files when using clang and -integrated-as on .s
files. rdar://8998895



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141814 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 21:38:39 +00:00
Eric Christopher
d0851aae51 Make this use a public accessor too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141752 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-12 00:38:05 +00:00
Eric Christopher
3c43b48fa9 Use public accessors on the scope that is returned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141739 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 23:19:35 +00:00
Chris Lattner
6509f50c69 improve some of the documentation around target data layout strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141733 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 23:01:39 +00:00
Eric Christopher
6618a241f7 Add a new wrapper node for a DILexicalBlock that encapsulates it and a
file. Since it should only be used when necessary propagate it through
the backend code generation and tweak testcases accordingly.

This helps with code like in clang's test/CodeGen/debug-info-line.c where
we have multiple #line directives within a single lexical block and want
to generate only a single block that contains each file change.

Part of rdar://10246360

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141729 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 22:59:11 +00:00
Daniel Dunbar
b5e8bc1fac Support/DataTypes.h: Clean up some types and add matching (but presumably
unused) code from .cmake to DataTypes.h.in so that the files are essentially in
sync module differences in autoconf/cmake replacement syntax.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 20:02:49 +00:00
Owen Anderson
f7c93a3867 Expose MachOObjectFile externally, like we do for COFF. First step in reducing the amount of special-purpose code needed for llvm-objdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141684 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 17:32:27 +00:00
NAKAMURA Takumi
e2aa5d53db Add -D__STDC_FORMAT_MACROS to use PRIx64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141663 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 12:51:44 +00:00
Nick Lewycky
15c3f727ae Add support for .symtab_shnidx. Unfortunately, doing this required breaking a
layer of abstraction around SymbolRef where you can read its private
SymbolPimpl member.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141636 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 02:57:48 +00:00
Andrew Trick
204494149b Move replaceCongruentIVs into SCEVExapander and bias toward "expanded"
IVs.

Indvars previously chose randomly between congruent IVs. Now it will
bias the decision toward IVs that SCEVExpander likes to create. This
was not done to fix any problem, it's just a welcome side effect of
factoring code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141633 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 02:28:51 +00:00
Tanya Lattner
f1f1a4f161 Make it possible to use the linker without destroying the source module. This is so the source module can be linked to multiple other destination modules. For all that used LinkModules() before, they will continue to destroy the source module as before.
This line, and those below, will be ignored--

M    include/llvm/Linker.h
M    tools/bugpoint/Miscompilation.cpp
M    tools/bugpoint/BugDriver.cpp
M    tools/llvm-link/llvm-link.cpp
M    lib/Linker/LinkModules.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-11 00:24:54 +00:00
Lang Hames
bb5b3f3359 Add a natural stack alignment field to TargetData, and prevent InstCombine from
promoting allocas to preferred alignments that exceed the natural
alignment. This avoids some potentially expensive dynamic stack realignments.

The natural stack alignment is set in target data strings via the "S<size>"
option. Size is in bits and must be a multiple of 8. The natural stack alignment
defaults to "unspecified" (represented by a zero value), and the "unspecified"
value does not prevent any alignment promotions. Target maintainers that care
about avoiding promotions should explicitly add the "S<size>" option to their
target data strings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141599 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 23:42:08 +00:00
Michael J. Spencer
e2f2f07be7 Object: add getSectionAlignment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141581 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 21:55:43 +00:00
Nick Lewycky
023bb15bea Add support for dumping section headers to llvm-objdump. This uses the same
flags as binutils objdump but the output is different, not just in format but
also showing different sections. Compare its results against readelf, not
objdump.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141579 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 21:21:34 +00:00
Andrew Trick
8cc4769108 Allow stat += 0 without activating the stat.
For me, this is a nice convenience. We generally want grep to match
stats output only when the event has occurred.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141574 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 19:48:56 +00:00
Andrew Trick
b35e4e8472 whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141572 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 19:35:46 +00:00
Jakob Stoklund Olesen
5a57168a55 Mark the standard pseudos as isPseudo = 1.
The difference between isPseudo and isCodeGenOnly is a bit murky, but
isCodeGenOnly should eventually go away.  It is used for instructions
that are clones of real instructions with slightly different properties.

The standard pseudo-instructions never mirror real instructions, so they
are definitely in the isPseudo category.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141567 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 18:51:33 +00:00
Owen Anderson
042aadd8ee MCAtom extending methods need to extend the range of the atom as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141557 91177308-0d34-0410-b5e6-96231b3b80d8
2011-10-10 18:09:38 +00:00