aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/TargetData.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Default TargetData alignment information for 128-bit floating-point types.Hal Finkel2012-02-261-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151473 91177308-0d34-0410-b5e6-96231b3b80d8
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic generic CodeGen support for half.Dan Gohman2011-12-201-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146927 91177308-0d34-0410-b5e6-96231b3b80d8
* Haven't yet found a nice way to handle TargetData verification in theLang Hames2011-10-201-25/+88
| | | | | | | | | AsmParser. This patch adds validation for target data layout strings upon construction of TargetData objects. An attempt to construct a TargetData object from a malformed string will trigger an assertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142605 91177308-0d34-0410-b5e6-96231b3b80d8
* Backing out patch. Will refactor to remove the AsmParser dependency on Target.Lang Hames2011-10-181-88/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142323 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-applying the target data layout verification patch from r142288, plus ↵Lang Hames2011-10-171-25/+88
| | | | | | | | | 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
* 142288 broke the build:Rafael Espindola2011-10-171-88/+25
| | | | | | | | | | | | 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 599d2d4c25d3aee63a21d9c67a88cd43bd971b7e. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142296 91177308-0d34-0410-b5e6-96231b3b80d8
* Validate target data layout strings.Lang Hames2011-10-171-25/+88
| | | | | | | 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
* Add a natural stack alignment field to TargetData, and prevent InstCombine fromLang Hames2011-10-101-2/+10
| | | | | | | | | | | | | | | | 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
* Convert gep_type_begin and gep_type_end to use ArrayRef.Jay Foad2011-07-191-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135481 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert TargetData::getIndexedOffset to use ArrayRef.Jay Foad2011-07-191-4/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135478 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-17/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the InvalidateStructLayoutInfo API, which is dead and unnecessary nowChris Lattner2011-07-151-19/+0
| | | | | | | that type refinement is toast. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135245 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove IntegerType constness from TargetDataTobias Grosser2011-07-121-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134978 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134949 91177308-0d34-0410-b5e6-96231b3b80d8
* De-constify Types in StructType::get() and TargetData::getIntPtrType().Jay Foad2011-07-111-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-091-43/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a regression caused by r102515 where explicit alignment on globals isCameron Zwarich2011-04-131-1/+1
| | | | | | | ignored. There was a test to catch this, but it was just blindly updated in a large change. This fixes another part of <rdar://problem/9275290>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129466 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an obvious problem with an alignment computation. AsmPrinter actually doesCameron Zwarich2011-04-131-1/+1
| | | | | | | | the max itself, so it is not easy to write a test case for this, but I added a test case that would fail if the code in AsmPrinter were removed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129432 91177308-0d34-0410-b5e6-96231b3b80d8
* If a global variable has a specified alignment that is less than the preferredCameron Zwarich2011-04-131-2/+6
| | | | | | | alignment for its type, use the minimum of the specified alignment and the ABI alignment. This fixes <rdar://problem/9275290>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129428 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-0/+2
| | | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Whitespace.Michael J. Spencer2010-10-191-25/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116800 91177308-0d34-0410-b5e6-96231b3b80d8
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
* Add x86MMX a few more places.Dale Johannesen2010-09-151-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113914 91177308-0d34-0410-b5e6-96231b3b80d8
* Add X86 MMX type to bitcode and Type.Dale Johannesen2010-09-101-0/+1
| | | | | | | | | (The Ada bindings probably need it too, but all the obvious places to change say "do not edit this file".) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113618 91177308-0d34-0410-b5e6-96231b3b80d8
* remove unions from LLVM IR. They are severely buggy and notChris Lattner2010-08-281-25/+0
| | | | | | | being actively maintained, improved, or extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use unsigned char for alignments in TargetData. There aren'tDan Gohman2010-08-111-15/+15
| | | | | | | | | that many of these things, so the memory savings isn't significant, and there are now situations where there can be alignments greater than 128. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110836 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-2/+2
| | | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
* Do GEP offset calculations with unsigned math rather than signed mathDan Gohman2010-07-281-1/+1
| | | | | | | to avoid undefined behavior on overflow, noticed by John Regehr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109594 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
* Change TargetData's algorithm for computing defualt vector typeDan Gohman2010-04-231-16/+11
| | | | | | | | alignment to match what's used in clang and GCC for __alignof, rather than trying to guess what Legalize is going to be doing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102206 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6332, allowing an index of zero into a zero sized array Chris Lattner2010-04-171-2/+2
| | | | | | | even if the element of the array has no size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101662 91177308-0d34-0410-b5e6-96231b3b80d8
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the recent alignment changes. They're broken for -Os because,Dan Gohman2010-04-021-1/+1
| | | | | | | | in particular, they end up aligning strings at 16-byte boundaries, and there's no way for GlobalOpt to check OptForSize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100172 91177308-0d34-0410-b5e6-96231b3b80d8
* Change variables which are exactly 16 bytes to be 16-byte-aligned too.Dan Gohman2010-04-021-1/+1
| | | | | | | This fixes test/Transforms/GlobalOpt/gv-align.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100161 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r98656 unmodified, which exposed the asmprinter not Chris Lattner2010-03-161-0/+25
| | | | | | | handling constant unions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98680 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r98656, its breaking all over the place.Daniel Dunbar2010-03-161-25/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98662 91177308-0d34-0410-b5e6-96231b3b80d8
* improve support for uniontype and ConstantUnion, patch by Tim Northover!Chris Lattner2010-03-161-0/+25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98656 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r97064. Duncan pointed out that bitcasts are defined inDan Gohman2010-02-251-42/+1
| | | | | | | | | terms of store and load, which means bitcasting between scalar integer and vector has endian-specific results, which undermines this whole approach. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97137 91177308-0d34-0410-b5e6-96231b3b80d8
* Make getTypeSizeInBits work correctly for array types; it should returnDan Gohman2010-02-241-1/+42
| | | | | | | | | | | | | | | | the number of value bits, not the number of bits of allocation for in-memory storage. Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and vectors. Fix several places in CodeGen which compute offsets into in-memory vectors to use TargetData information. This fixes PR1784. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97064 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-1/+1
| | | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
* add a method to get the alignment of an integer type even Chris Lattner2010-01-251-0/+7
| | | | | | | | when we don't have one laying around. Useful if you don't have an llvmcontext handy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94468 91177308-0d34-0410-b5e6-96231b3b80d8
* finish cleaning up StructLayoutMap.Chris Lattner2009-12-171-21/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91612 91177308-0d34-0410-b5e6-96231b3b80d8
* Calling InvalidateEntry during the refinement was breaking the bootstrap.Bill Wendling2009-12-051-2/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90656 91177308-0d34-0410-b5e6-96231b3b80d8
* Final cleanups:Bill Wendling2009-12-051-14/+2
| | | | | | | | - Privatize a typedef. - Call the InvalidateEntry when refining a type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90655 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline methods which are called only once.Bill Wendling2009-12-051-15/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90640 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor some code. No functionality change.Bill Wendling2009-12-051-9/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90639 91177308-0d34-0410-b5e6-96231b3b80d8