summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the root cause of PR15348 by correctly handling alignment 0 onChandler Carruth2013-02-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | memory intrinsics in the SDAG builder. When alignment is zero, the lang ref says that *no* alignment assumptions can be made. This is the exact opposite of the internal API contracts of the DAG where alignment 0 indicates that the alignment can be made to be anything desired. There is another, more explicit alignment that is better suited for the role of "no alignment at all": an alignment of 1. Map the intrinsic alignment to this early so that we don't end up generating aligned DAGs. It is really terrifying that we've never seen this before, but we suddenly started generating a large number of alignment 0 memcpys due to the new code to do memcpy-based copying of POD class members. That patch contains a bug that rounds bitfield alignments down when they are the first field. This can in turn produce zero alignments. This fixes weird crashes I've seen in library users of LLVM on 32-bit hosts, etc. llvm-svn: 176022
* Remove unnecessary code.Evan Cheng2013-02-111-4/+0
| | | | llvm-svn: 174854
* Revert 172027 and 174336. Remove diagnostics about over-aligned stack objects.Bob Wilson2013-02-081-2/+1
| | | | | | | | | | | | Aside from the question of whether we report a warning or an error when we can't satisfy a requested stack object alignment, the current implementation of this is not good. We're not providing any source location in the diagnostics and the current warning is not connected to any warning group so you can't control it. We could improve the source location somewhat, but we can do a much better job if this check is implemented in the front-end, so let's do that instead. <rdar://problem/13127907> llvm-svn: 174741
* Tweak check to avoid integer overflow (for insanely large alignments)Evan Cheng2013-02-061-2/+2
| | | | llvm-svn: 174482
* Fix errant fallthrough in the generation of the lifetime markers.Nadav Rotem2013-02-011-0/+1
| | | | | | Found by Alexander Kornienko. llvm-svn: 174207
* Make APFloat constructor require explicit semantics.Tim Northover2013-01-221-1/+2
| | | | | | | | | Previously we tried to infer it from the bit width size, with an added IsIEEE argument for the PPC/IEEE 128-bit case, which had a default value. This default value allowed bugs to creep in, where it was inappropriate. llvm-svn: 173138
* Remove unused parameter. Also use the AttributeSet query methods instead of ↵Bill Wendling2013-01-181-2/+1
| | | | | | the Attribute query methods. llvm-svn: 172852
* For inline asm:Eric Christopher2013-01-111-0/+6
| | | | | | | | | | | - recognize string "{memory}" in the MI generation - mark as mayload/maystore when there's a memory clobber constraint. PR14859. Patch by Krzysztof Parzyszek llvm-svn: 172228
* Remove unneeded includes from FunctionLoweringInfo.h.Jakub Staszak2013-01-101-1/+1
| | | | llvm-svn: 172123
* Stack Alignment: throw error if we can't satisfy the minimal alignmentManman Ren2013-01-101-1/+2
| | | | | | | | | | | | | | | | | | requirement when creating stack objects in MachineFrameInfo. Add CreateStackObjectWithMinAlign to throw error when the minimal alignment can't be achieved and to clamp the alignment when the preferred alignment can't be achieved. Same is true for CreateVariableSizedObject. Will not emit error in CreateSpillStackObject or CreateStackObject. As long as callers of CreateStackObject do not assume the object will be aligned at the requested alignment, we should not have miscompile since later optimizations which look at the object's alignment will have the correct information. rdar://12713765 llvm-svn: 172027
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-13/+13
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Remove the Function::getRetAttributes method in favor of using the ↵Bill Wendling2012-12-301-7/+8
| | | | | | AttributeSet accessor method. llvm-svn: 171256
* Remove Function::getParamAttributes and use the AttributeSet accessor ↵Bill Wendling2012-12-301-8/+8
| | | | | | methods instead. llvm-svn: 171255
* Remove the Function::getFnAttributes method in favor of using the AttributeSetBill Wendling2012-12-301-1/+2
| | | | | | | | | directly. This is in preparation for removing the use of the 'Attribute' class as a collection of attributes. That will shift to the AttributeSet class instead. llvm-svn: 171253
* Change AsmOperandInfo::ConstraintVT to MVT, instead of EVT.Patrik Hagglund2012-12-191-4/+5
| | | | | | Accordingly, add MVT::getVT. llvm-svn: 170550
* Split the usage of 'EVT PartVT' into 'MVT PartVT' and 'EVT PartEVT'.Patrik Hagglund2012-12-191-38/+38
| | | | llvm-svn: 170540
* Change RegVT in BitTestBlock and RegsForValue, to contain MVTs,Patrik Hagglund2012-12-191-12/+11
| | | | | | instead of EVTs. llvm-svn: 170538
* Change TargetLowering::getTypeForExtArgOrReturn to take and returnPatrik Hagglund2012-12-191-1/+1
| | | | | | MVTs, instead of EVTs. llvm-svn: 170537
* Change a parameter of TargetLowering::getVectorTypeBreakdown to MVT,Patrik Hagglund2012-12-191-5/+9
| | | | | | from EVT. llvm-svn: 170536
* Change TargetLowering::RegisterTypeForVT to contain MVTs, instead ofPatrik Hagglund2012-12-191-10/+10
| | | | | | EVTs. llvm-svn: 170535
* Rename the 'Attributes' class to 'Attribute'. It's going to represent a ↵Bill Wendling2012-12-191-18/+18
| | | | | | single attribute in the future. llvm-svn: 170502
* Change TargetLowering::getRegClassFor to take an MVT, instead of EVT.Patrik Hagglund2012-12-131-5/+5
| | | | | | | | | | | | Accordingly, add helper funtions getSimpleValueType (in parallel to getValueType) in SDValue, SDNode, and TargetLowering. This is the first, in a series of patches. This is the second attempt. In the first attempt (r169837), a few getSimpleVT() were hoisted too far, detected by bootstrap failures. llvm-svn: 170104
* Revert EVT->MVT changes, r169836-169851, due to buildbot failures.Patrik Hagglund2012-12-111-34/+30
| | | | llvm-svn: 169854
* Change RegVT in BitTestBlock and RegsForValue, to contain MVTs,Patrik Hagglund2012-12-111-11/+10
| | | | | | instead of EVTs. llvm-svn: 169851
* Change TargetLowering::getTypeForExtArgOrReturn to take and returnPatrik Hagglund2012-12-111-1/+2
| | | | | | | | MVTs, instead of EVTs. Accordingly, add bitsLT (and similar) to MVT. llvm-svn: 169850
* Change a parameter of TargetLowering::getVectorTypeBreakdown to MVT,Patrik Hagglund2012-12-111-5/+9
| | | | | | from EVT. llvm-svn: 169849
* Change TargetLowering::RegisterTypeForVT to contain MVTs, instead ofPatrik Hagglund2012-12-111-10/+10
| | | | | | EVTs. llvm-svn: 169848
* Change TargetLowering::getRegClassFor to take an MVT, instead of EVT.Patrik Hagglund2012-12-111-4/+4
| | | | | | | | | Accordingly, add helper funtions getSimpleValueType (in parallel to getValueType) in SDValue, SDNode, and TargetLowering. This is the first, in a series of patches. llvm-svn: 169837
* Fall back to the selection dag isel to select tail calls.Chad Rosier2012-12-111-5/+0
| | | | | | | | | | | | | | | | | | | This shouldn't affect codegen for -O0 compiles as tail call markers are not emitted in unoptimized compiles. Testing with the external/internal nightly test suite reveals no change in compile time performance. Testing with -O1, -O2 and -O3 with fast-isel enabled did not cause any compile-time or execution-time failures. All tests were performed on my x86 machine. I'll monitor our arm testers to ensure no regressions occur there. In an upcoming clang patch I will be marking the objc_autoreleaseReturnValue and objc_retainAutoreleaseReturnValue as tail calls unconditionally. While it's theoretically true that this is just an optimization, it's an optimization that we very much want to happen even at -O0, or else ARC applications become substantially harder to debug. Part of rdar://12553082 llvm-svn: 169796
* Replace r169459 with something safer. Rather than having computeMaskedBits toEvan Cheng2012-12-061-1/+3
| | | | | | | | | | understand target implementation of any_extend / extload, just generate zero_extend in place of any_extend for liveouts when the target knows the zero_extend will be implicit (e.g. ARM ldrb / ldrh) or folded (e.g. x86 movz). rdar://12771555 llvm-svn: 169536
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-20/+20
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Refactor to make helper method static.Craig Topper2012-11-251-27/+14
| | | | llvm-svn: 168557
* Remove duplicate check of LimitFloatPrecision. It was already checked ↵Craig Topper2012-11-251-1/+1
| | | | | | earlier before IsExp10 could be set to true. llvm-svn: 168553
* Factor common code out of individual if blocks into common tail.Craig Topper2012-11-251-24/+12
| | | | llvm-svn: 168551
* Remove redundant calls to getCurDebugLoc in visitIntrinsicCall. It's already ↵Craig Topper2012-11-241-7/+4
| | | | | | called at the start of the function and captured in a local variable. llvm-svn: 168548
* Refactor a bit to make some helper methods static.Craig Topper2012-11-241-37/+20
| | | | llvm-svn: 168546
* Factor some common code out of individual if blocks.Craig Topper2012-11-241-52/+27
| | | | llvm-svn: 168538
* Refactor a bit to make some helper functions static.Craig Topper2012-11-231-51/+24
| | | | llvm-svn: 168524
* llvm.fmuladd.* lowering should be checking isOperationLegalOrCustom, rather thanLang Hames2012-11-221-1/+1
| | | | | | isOperationLegal. Thanks to Craig Topper for pointing this out. llvm-svn: 168485
* Remove conditions from 'else if' that were guaranteed by preceding 'if'.Craig Topper2012-11-161-12/+12
| | | | llvm-svn: 168191
* Factor out the final FADD that's common to multiple code paths in the ↵Craig Topper2012-11-161-45/+30
| | | | | | visitLog* functions. llvm-svn: 168183
* Factor some common code to reduce compile size.Craig Topper2012-11-161-37/+20
| | | | llvm-svn: 168143
* Add llvm.ceil, llvm.trunc, llvm.rint, llvm.nearbyint intrinsics.Craig Topper2012-11-151-0/+20
| | | | llvm-svn: 168025
* Codegen support for arbitrary vector getelementptrs.Duncan Sands2012-11-131-3/+3
| | | | llvm-svn: 167830
* OutputArg: added an index of the original argument to match the change toManman Ren2012-11-011-2/+3
| | | | | | | | | | InputArg in r165616. This will enable us to get the actual type for both InputArg and OutputArg. rdar://9932559 llvm-svn: 167265
* Add a comment for r167040.Chad Rosier2012-10-301-0/+4
| | | | llvm-svn: 167046
* [inline asm] Implement mayLoad and mayStore for inline assembly. In general,Chad Rosier2012-10-301-1/+19
| | | | | | | | | | the MachineInstr MayLoad/MayLoad flags are based on the tablegen implementation. For inline assembly, however, we need to compute these based on the constraints. Revert r166929 as this is no longer needed, but leave the test case in place. rdar://12033048 and PR13504 llvm-svn: 167040
* Make the indirect branch optimization deterministic. No functionality change.Nadav Rotem2012-10-231-8/+8
| | | | | | Patch by Daniel Reynaud. llvm-svn: 166501
* This patch is to fix radar://8426430. It is about llvm support of ↵Shuxin Yang2012-10-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | __builtin_debugtrap() which is supposed to consistently raise SIGTRAP across all systems. In contrast, __builtin_trap() behave differently on different systems. e.g. it raises SIGTRAP on ARM, and SIGILL on X86. The purpose of __builtin_debugtrap() is to consistently provide "trap" functionality, in the mean time preserve the compatibility with on gcc on __builtin_trap(). The X86 backend is already able to handle debugtrap(). This patch is to: 1) make front-end recognize "__builtin_debugtrap()" (emboddied in the one-line change to Clang). 2) In DAG legalization phase, by default, "debugtrap" will be replaced with "trap", which make the __builtin_debugtrap() "available" to all existing ports without the hassle of changing their code. 3) If trap-function is specified (via -trap-func=xyz to llc), both __builtin_debugtrap() and __builtin_trap() will be expanded into the function call of the specified trap function. This behavior may need change in the future. The provided testing-case is to make sure 2) and 3) are working for ARM port, and we already have a testing case for x86. llvm-svn: 166300
* Issue description:Stepan Dyatkovskiy2012-10-101-2/+3
| | | | | | | | | | | | | | | | | | | | SchedulerDAGInstrs::buildSchedGraph ignores dependencies between FixedStack objects and byval parameters. So loading byval parameters from stack may be inserted *before* it will be stored, since these operations are treated as independent. Fix: Currently ARMTargetLowering::LowerFormalArguments saves byval registers with FixedStack MachinePointerInfo. To fix the problem we need to store byval registers with MachinePointerInfo referenced to first the "byval" parameter. Also commit adds two new fields to the InputArg structure: Function's argument index and InputArg's part offset in bytes relative to the start position of Function's argument. E.g.: If function's argument is 128 bit width and it was splitted onto 32 bit regs, then we got 4 InputArg structs with same arg index, but different offset values. llvm-svn: 165616
OpenPOWER on IntegriCloud