summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen] Re-apply r234809 (concat of scalars), with an x86_mmx fix.Ahmed Bougacha2015-04-161-0/+66
| | | | | | | | | | | | | | | | | | | | | The only type that isn't an integer, isn't floating point, and isn't a vector; ladies and gentlemen, the gift that keeps on giving: x86_mmx! Fixes PR23246. Original message (reverted in r235062): [CodeGen] Combine concat_vectors of scalars into build_vector. Combine something like: (v8i8 concat_vectors (v2i8 bitcast (i16)) x4) into: (v8i8 (bitcast (v4i16 BUILD_VECTOR (i16) x4))) If any of the scalars are floating point, use that throughout. Differential Revision: http://reviews.llvm.org/D8948 llvm-svn: 235072
* DebugInfo: DIRef<> => TypedDebugNodeRef<>Duncan P. N. Exon Smith2015-04-163-8/+2
| | | | | | | | Delete `DIRef<>`, and replace the remaining uses of it with `TypedDebugNodeRef<>`. To minimize code churn, I've added typedefs from `MDTypeRef` to `DITypeRef` (etc.). llvm-svn: 235071
* DebugInfo: Gut DIDescriptorDuncan P. N. Exon Smith2015-04-161-3/+4
| | | | | | | | | | | | | | | PR23080 is almost finished. With this commit, there's no consequential API in `DIDescriptor` and its subclasses. What's left? - Default-constructed to `nullptr`. - Handy `const_cast<>` (constructed from `const`, but accessors are non-`const`). I think the safe way to catch those is to delete the classes and fix compile errors. That'll be my next step, after I delete the `DITypeRef` (etc.) wrapper around `MDTypeRef`. llvm-svn: 235069
* DebugInfo: Gut DIScope, DIEnumerator and DISubrangeDuncan P. N. Exon Smith2015-04-165-19/+19
| | | | | | The only class the still has API left is `DIDescriptor` itself. llvm-svn: 235067
* DebugInfo: Gut DIType and subclassesDuncan P. N. Exon Smith2015-04-164-91/+88
| | | | | | | | Continuing PR23080, gut `DIType` and its various subclasses, leaving behind thin wrappers around the pointer types in the new debug info hierarchy. llvm-svn: 235064
* Revert r234809 because it caused PR23246.Nick Lewycky2015-04-161-60/+0
| | | | llvm-svn: 235062
* [SEH] Deal with users of the old lpad for SEH catch-all blocksReid Kleckner2015-04-161-0/+9
| | | | | | | | | | | The way we split SEH catch-all blocks can leave some dead EH values behind at -O0. Try to remove them, and if we fail, replace them all with undef. Fixes a crash when removing the old unreachable landingpad which is still used by extractvalue instructions in the catch-all block. llvm-svn: 235061
* DebugInfo: Remove unnecessary API from DIDerivedType and DITypeDuncan P. N. Exon Smith2015-04-151-29/+34
| | | | | | | | | Remove the accessors of `DIDerivedType` that downcast to `MDDerivedType`, shifting the `cast<MDDerivedType>` into the callers. Also remove `DIType::isValid()`, which is really just a check against `nullptr` at this point. llvm-svn: 235059
* DebugInfo: Gut DICompileUnit and DIFileDuncan P. N. Exon Smith2015-04-153-12/+12
| | | | | | | Continuing gutting `DIDescriptor` subclasses; this edition, `DICompileUnit` and `DIFile`. In the name of PR23080. llvm-svn: 235055
* DebugInfo: factor out dead variable in NDEBUG from r235050Duncan P. N. Exon Smith2015-04-151-2/+1
| | | | | | | | Caught by the lld bot: http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/9832 llvm-svn: 235052
* DebugInfo: Remove 'inlinedAt:' field from MDLocalVariableDuncan P. N. Exon Smith2015-04-157-70/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove 'inlinedAt:' from MDLocalVariable. Besides saving some memory (variables with it seem to be single largest `Metadata` contributer to memory usage right now in -g -flto builds), this stops optimization and backend passes from having to change local variables. The 'inlinedAt:' field was used by the backend in two ways: 1. To tell the backend whether and into what a variable was inlined. 2. To create a unique id for each inlined variable. Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg` attachment, and change the DWARF backend to use a typedef called `InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`. This `DebugLoc` is already passed reliably through the backend (as verified by r234021). This commit removes the check from r234021, but I added a new check (that will survive) in r235048, and changed the `DIBuilder` API in r235041 to require a `!dbg` attachment whose 'scope:` is in the same `MDSubprogram` as the variable's. If this breaks your out-of-tree testcases, perhaps the script I used (mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778 in a moment. llvm-svn: 235050
* [WinEH] Try to make the MachineFunction CFG more accurateReid Kleckner2015-04-153-47/+77
| | | | | | | | | | | | This avoids emitting code for unreachable landingpad blocks that contain calls to llvm.eh.actions and indirectbr. It's also a first step towards unifying the SEH and WinEH lowering codepaths. I'm keeping the old fan-in lowering of SEH around until the preparation version works well enough that we can switch over without breaking existing users. llvm-svn: 235037
* Reland "[WinEH] Use the parent function when computing frameescape labels"Reid Kleckner2015-04-151-1/+1
| | | | | | Fixed the test by removing extraneous quotes. llvm-svn: 235028
* Revert "[WinEH] Use the parent function when computing frameescape labels"Reid Kleckner2015-04-151-1/+1
| | | | | | This reverts commit r235025. The test isn't passing yet. llvm-svn: 235027
* Add range iterators for post order and inverse post order. Use themDaniel Berlin2015-04-153-15/+9
| | | | llvm-svn: 235026
* [WinEH] Use the parent function when computing frameescape labelsReid Kleckner2015-04-151-1/+1
| | | | | | Fixes assertions in MC when a local label wasn't defined. llvm-svn: 235025
* [MBP] Spell the conditions the same way through out this if statement.Chandler Carruth2015-04-151-1/+1
| | | | | | NFC. llvm-svn: 235009
* [MBP] Sink a comment into the if block to which it pertains. This makesChandler Carruth2015-04-151-1/+1
| | | | | | the content of the comment make much more sense. llvm-svn: 235007
* [MBP] Fix a really misleading typo in a comment.Chandler Carruth2015-04-151-1/+1
| | | | llvm-svn: 235006
* Change range-based for-loops to be -Wrange-loop-analysis clean.Richard Trieu2015-04-151-1/+1
| | | | | | No functionality change. llvm-svn: 234963
* Use raw_pwrite_stream in the object writer/streamer.Rafael Espindola2015-04-141-4/+3
| | | | | | The ELF object writer will take advantage of that in the next commit. llvm-svn: 234950
* [WinEH] Avoid emitting xdata tables twice for cleanupsReid Kleckner2015-04-141-3/+5
| | | | | | | Since adding invokes of llvm.donothing to cleanups, we come here now, and trivial EH cleanup usage from clang fails to compile. llvm-svn: 234948
* DebugInfo: Pubnames: Do not include variable declarations in pubnamesDavid Blaikie2015-04-141-1/+2
| | | | | | | This causes badness for GDB which expects to find a definition in any compile_unit that has an entry for the variable in its pubnames. llvm-svn: 234915
* [MachineLICM] Use newer model of register pressure sets.Daniel Jasper2015-04-141-43/+32
| | | | | | | | | | | | | | | | TargetRegisterInfo::getRegPressureLimit has a note that it is an old model that relies on manually entered classes. Using the newer model of register pressure sets seems more appropriate. We might eventually even switch to lib/CodeGen/RegisterPressure.cpp, but we should probably do incremental changes here. Using the newer model also makes it easier to take regmasks into account which is necessary to fix llvm.org/PR23143. I am currently also preparing a patch for that, but would like to do this switch independently. Review: http://reviews.llvm.org/D8986 llvm-svn: 234880
* DebugInfo: Gut DISubprogram and DILexicalBlock*Duncan P. N. Exon Smith2015-04-146-47/+46
| | | | | | | Gut the `DIDescriptor` wrappers around `MDLocalScope` subclasses. Note that `DILexicalBlock` wraps `MDLexicalBlockBase`, not `MDLexicalBlock`. llvm-svn: 234850
* DebugInfo: Gut DINamespace and DITemplate*ParameterDuncan P. N. Exon Smith2015-04-141-18/+18
| | | | | | | Continue gutting `DIDescriptor` subclasses, turning them into as-bare-as-possible pointer wrappers. llvm-svn: 234843
* DebugInfo: Gut DIVariable and DIGlobalVariableDuncan P. N. Exon Smith2015-04-148-42/+42
| | | | | | | | | | Gut all the non-pointer API from the variable wrappers, except an implicit conversion from `DIGlobalVariable` to `DIDescriptor`. Note that if you're updating out-of-tree code, `DIVariable` wraps `MDLocalVariable` (`MDVariable` is a common base class shared with `MDGlobalVariable`). llvm-svn: 234840
* DebugInfo: Move DIVariable::printExtendedName() to its only callerDuncan P. N. Exon Smith2015-04-141-1/+37
| | | | | | Move the local function `printDebugLoc()` along with it. llvm-svn: 234838
* DebugInfo: Inline DIVariable::isBlockByrefVariable() into its callersDuncan P. N. Exon Smith2015-04-141-2/+4
| | | | | | | I don't think this API is helping much. Change the callers to call `MDType::isBlockByrefStruct()` directly. llvm-svn: 234837
* DebugInfo: Gut DIObjCProperty and DIImportedEntityDuncan P. N. Exon Smith2015-04-143-17/+14
| | | | | | | Gut a couple more classes in the DIDescriptor hierarchy. Leave behind an implicit conversion to `DIDescriptor`, the old base class. llvm-svn: 234836
* DebugInfo: Gut DILocationDuncan P. N. Exon Smith2015-04-141-3/+3
| | | | | | | | This is along the same lines as r234832, but for `DILocation`. Clean out all accessors from `DILocation`. Any callers should be using `MDLocation` directly (e.g., via `operator->()`). llvm-svn: 234835
* DebugInfo: Gut DIExpressionDuncan P. N. Exon Smith2015-04-144-22/+21
| | | | | | | | | | | | | | | | Completely gut `DIExpression`, turning it into a simple wrapper around `MDExpression *`. There are two bits of magic left: - It's constructed from `const MDExpression*` but convertible to `MDExpression*`. - It's default-constructed to `nullptr`. Otherwise, it should behave quite like a raw pointer. Once I've done the same to the rest of the `DIDescriptor` subclasses, I'll come back to delete them entirely (and update call sites as necessary to deal with the missing magic). llvm-svn: 234832
* DebugInfo: Remove DIObjCProperty attribute accessors, NFCDuncan P. N. Exon Smith2015-04-131-14/+1
| | | | | | | | | There's only one user of the various `DIObjCProperty::is*Property()` accessors -- `DwarfUnit::constructTypeDIE()` -- and it's just using the reverse logic to reconstruct the bitfield. Drop this API and simplify the only caller. llvm-svn: 234818
* [CodeGen] Combine concat_vectors of scalars into build_vector.Ahmed Bougacha2015-04-131-0/+60
| | | | | | | | | | | | | Combine something like: (v8i8 concat_vectors (v2i8 bitcast (i16)) x4) into: (v8i8 (bitcast (v4i16 BUILD_VECTOR (i16) x4))) If any of the scalars are floating point, use that throughout. Differential Revision: http://reviews.llvm.org/D8948 llvm-svn: 234809
* SelectionDAG: Stop using DIVariable::isInlinedFnArgument()Duncan P. N. Exon Smith2015-04-131-1/+3
| | | | | | | | | | | | | | | | | | Instead of calling the somewhat confusingly-named `DIVariable::isInlinedFnArgument()`, do the check directly here. There's possibly a small functionality change here: instead of `dyn_cast<>`'ing `DV->getScope()` to `MDSubprogram`, I'm looking up the scope chain for the actual subprogram. I suspect that this is a no-op for function arguments so in practise there isn't a real difference. I've also added a `FIXME` to check the `inlinedAt:` chain instead, since I wonder if that would be more reliable than the `MDSubprogram::describes()` function. Since this was the only user of `DIVariable::isInlinedFnArgument()`, delete it. llvm-svn: 234799
* DebugInfo: Remove DIGlobalVariable::getGlobal()Duncan P. N. Exon Smith2015-04-131-4/+3
| | | | | | | | `DIGlobalVariable::getGlobal()` isn't really helpful, it just does a `dyn_cast_or_null<>`. Simplify its only user by doing the cast directly and delete the code. llvm-svn: 234796
* Reapply "Verifier: Check for incompatible bit piece expressions"Duncan P. N. Exon Smith2015-04-131-9/+1
| | | | | | | | | | | | | | | | | | | | | This reverts commit r234717, reapplying r234698 (in spirit). As described in r234717, the original `Verifier` check had a use-after-free. Instead of storing pointers to "interesting" debug info intrinsics whose bit piece expressions should be verified once we have typerefs, do a second traversal. I've added a testcase to catch the `llc` crasher. Original commit message: Verifier: Check for incompatible bit piece expressions Convert an assertion into a `Verifier` check. Bit piece expressions must fit inside the variable, and mustn't be the entire variable. Catching this in the verifier will help us find bugs sooner, and makes `DIVariable::getSizeInBits()` dead code. llvm-svn: 234776
* Revert revisions r234755, r234759, r234760Jan Vesely2015-04-131-32/+0
| | | | | | | | | | | Revert "Remove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)" Revert "R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO" Revert "LegalizeDAG: Try to use Overflow operations when expanding ADD/SUB" Using overflow operations fails CodeGen/Generic/2011-07-07-ScheduleDAGCrash.ll on hexagon, nvptx, and r600. Revert while I investigate. llvm-svn: 234768
* Allow memory intrinsics to be tail callsKrzysztof Parzyszek2015-04-133-16/+44
| | | | llvm-svn: 234764
* DAGCombiner: Fix crash in select(select) opt.Matthias Braun2015-04-131-2/+2
| | | | | | | | | In case of different types used for the condition of the selects the select(select) -> select(and) normalisation cannot be performed. See also: http://reviews.llvm.org/D7622 llvm-svn: 234763
* Remove default in fully-covered switch (to fix Clang -Werror ↵David Blaikie2015-04-131-1/+0
| | | | | | -Wcovered-switch-default) llvm-svn: 234760
* LegalizeDAG: Try to use Overflow operations when expanding ADD/SUBJan Vesely2015-04-131-0/+33
| | | | | | | | | | v2: consider BooleanContents when processing overflow Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewers: resistor, jholewinsky (nvidia parts) Differential Revision: http://reviews.llvm.org/D6340 llvm-svn: 234755
* [ARM] Align global variables passed to memory intrinsicsJohn Brawn2015-04-131-3/+15
| | | | | | | | | | Fill in the TODO in CodeGenPrepare::OptimizeCallInst so that global variables that are passed to memory intrinsics are aligned in the same way that allocas are. Differential Revision: http://reviews.llvm.org/D8421 llvm-svn: 234735
* Revert "Verifier: Check for incompatible bit piece expressions"Duncan P. N. Exon Smith2015-04-131-1/+9
| | | | | | | | | | | | | This reverts commit r234698. This caused a use-after-free: `QueuedBitPieceExpressions` holds onto references to `DbgInfoIntrinsic`s and references them past where they're deleted (this is because the verifier is run as a function pass, and then `verifyTypeRefs()` is called during `doFinalization()`). I'll include a reduced crasher for `llc` when I recommit the check. llvm-svn: 234717
* Verifier: Check for incompatible bit piece expressionsDuncan P. N. Exon Smith2015-04-111-9/+1
| | | | | | | | | Convert an assertion into a `Verifier` check. Bit piece expressions must fit inside the variable, and mustn't be the entire variable. Catching this in the verifier will help us find bugs sooner, and makes `DIVariable::getSizeInBits()` dead code. llvm-svn: 234698
* Remove empty non-virtual destructors or mark them =default when non-publicBenjamin Kramer2015-04-111-1/+0
| | | | | | These add no value but can make a class non-trivially copyable. NFC. llvm-svn: 234688
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-1116-18/+18
| | | | | | | | | | | | | | The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' \ -j=32 -fix -format http://reviews.llvm.org/D8925 llvm-svn: 234679
* [CodeGen] Split -enable-global-merge into ARM and AArch64 options.Ahmed Bougacha2015-04-111-1/+2
| | | | | | | | | | | | | Currently, there's a single flag, checked by the pass itself. It can't force-enable the pass (and is on by default), because it might not even have been created, as that's the targets decision. Instead, have separate explicit flags, so that the decision is consistently made in the target. Keep the flag as a last-resort "force-disable GlobalMerge" for now, for backwards compatibility. llvm-svn: 234666
* [WinEH] Recognize SEH finally block inserted by the frontendReid Kleckner2015-04-101-63/+118
| | | | | | | | | | | This allows winehprepare to build sensible llvm.eh.actions calls for SEH finally blocks. The pattern matching in this change is brittle and should be replaced with something more robust soon. In the meantime, this will let us write the code that produces __C_specific_handler xdata tables, which we need regardless of how we decide to get finally blocks through EH preparation. llvm-svn: 234663
* [CodeGenPrepare] Report all changes made during instruction sinkingBenjamin Kramer2015-04-101-3/+5
| | | | | | | | r234638 chained another transform below which was tripping over the deleted instruction. Use after free found by asan in many regression tests. llvm-svn: 234654
OpenPOWER on IntegriCloud