Commit Graph

47 Commits

Author SHA1 Message Date
Meghana Gupta
423aa007f3 Add LLVM_ATTRIBUTE_USED to DominanceInfo::dump
This function was unavailable in the debugger because it was getting
optimized away.
2024-09-05 14:19:22 -07:00
Nate Chandler
a1d10997da [SIL] Promoted least-common ancestor to Dominance.
It's a general purpose helper and there will soon be another user.
2023-07-24 16:57:14 -07:00
Erik Eckstein
5b3c34b9e7 fix a linking problem in swift-frontend
Sometimes when building the SwiftCompilerSources with a host compiler, linking fails with unresolved symbols for DenseMap and unique_ptr destroys.
This looks like a problem with C++ interop: the compiler thinks that destructors for some Analysis classes are materialized in the SwiftCompilerSources, but they are not.
Explicitly defining those destructors fixes the problem.
2023-07-21 08:01:31 +02:00
Nate Chandler
ee3cbde8fe [SIL] computeDominatedBoundaryBlocks on non-OSSA.
The algorithm requires no critical edges, but that doesn't mean
require ownership.  Remove the assert to allow the utility to be called
from code where the caller has manually split edges.

In the fullness of time, there should no passes should introduce
critical edges.
2023-06-05 08:11:28 -07:00
Nate Chandler
874e4e428e [NFC] Added DominanceInfo::dump.
Just call to the superclass' print method.
2023-02-15 18:16:33 -08:00
Meghana Gupta
7cf67e7eb4 Fix computation of dominance frontier (#59278) 2022-06-07 10:52:29 -07:00
Andrew Trick
8f20da7024 Add computeDominanceFrontier().
A trivial utility that returns the leaf blocks in a dominance subtree.
2022-02-16 12:23:01 -08:00
John McCall
85c486cf83 Add a utility to run a function on blocks in dominance order,
pushing scopes for various tracking objects as needed.
2021-03-30 18:07:29 -04:00
swift_jenkins
3c28fcaa81 Merge remote-tracking branch 'origin/main' into next 2020-11-11 19:00:10 -08:00
Meghana Gupta
0598957cb9 Add a useful overload of properlyDominates to PostDominanceInfo (#34666) 2020-11-11 18:25:05 -08:00
Arnold Schwaighofer
3797809cea Add struct CfgTraitsFor<swift::SILBasicBlock> 2020-11-04 14:30:25 -08:00
Sho Ikeda
03fbd4a6de [gardening][SIL] Replace typedef with using 2018-04-05 13:53:20 +09:00
swift-ci
bc76ac0f50 Merge remote-tracking branch 'origin/master' into master-next 2017-12-20 14:49:53 -08:00
Chris Lattner
0c6e0c25a1 Two NFC changes:
- Add a DominanceInfo::dominates helper functions that takes two instructions,
  as analogues to the properlyDominates ones.
- Further generalize some SILBuilder code to be more defensive in the face
  of incorrect or partially constructed SIL instructions.

These are cleanups, NFC.
2017-12-19 20:18:24 -08:00
Bob Wilson
d5fd775703 master-next: Update DomTreeBuilder template declarations.
The declarations that I moved into the header on master do not
match the versions for master-next. This just updates the header
to match the template instantiations in lib/SIL/Dominance.cpp.
2017-09-23 12:00:25 -07:00
Bob Wilson
acf22554f3 Declare DomTreeBuilder template instantiations in Dominance.h
This is a follow-up to https://github.com/apple/swift/pull/11075.
2017-09-07 16:08:48 -07:00
John McCall
4d3e44f98d Update SIL's dominance analysis for the template changes in LLVM.
StackPromotion is still busted.
2017-07-18 17:03:28 -04:00
Bob Wilson
b9f6e6b371 Remove llvm::DominatorBase templates to match LLVM r306713.
The content from DominatorBase has been merged into DominatorTreeBase,
and DominatorBase has been removed.
2017-07-05 11:56:00 -07:00
Bob Wilson
37e7d1c627 Merge remote-tracking branch 'origin/master' into master-next 2017-01-08 17:07:46 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Bob Wilson
78b28243ff Merge remote-tracking branch 'origin/master' into master-next 2017-01-03 14:22:59 -08:00
practicalswift
9d0b2abfc2 [gardening] Normalize end-of-namespace comments 2016-12-17 22:29:07 +01:00
Bob Wilson
13da3fa8b1 Merge remote-tracking branch 'origin/master' into master-next 2016-12-04 18:16:09 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Bob Wilson
6ca7872ba5 Merge remote-tracking branch 'origin/master' into master-next 2016-11-16 22:12:23 -08:00
Erik Eckstein
26038055c2 StackPromotion: don’t move an alloc_ref above it’s operands.
fixes a SILVerifier crash: rdar://problem/29276015
2016-11-15 16:50:36 -08:00
Bob Wilson
d70c85745d Remove NodeType from all GraphTraits.
This is no longer used as of llvm r279475.
2016-10-15 11:02:20 -07:00
Saleem Abdulrasool
9203283628 SILOptimizer: switch to NodeRef
This adds the typedef and switches uses of NodeType * to NodeRef.  This is in
preparation for the eventual NodeRef-ization of the GraphTraits in LLVM.  NFC.
2016-08-25 13:01:11 -07:00
Saleem Abdulrasool
365c7b38be SIL: update for SVN r277399
SVN r277399 introduced a new typedef requirement for the traits type.
2016-08-13 09:26:13 -07:00
Erik Eckstein
bfe843fd92 Fix crash in post-dominator-tree verification. 2016-01-05 18:40:41 -08:00
practicalswift
50baf2e53b Use consistent formatting in top of file headers. 2016-01-04 02:17:48 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Leo Shimonaka
70e66973ee Fix spelling error in documentation / comments / method name 2015-12-05 00:28:08 -05:00
Michael Gottesman
f9eab6243d Update LoopInfo for changes to LLVM.
The two changes were:

1. I added a graphtraits implementation for a const
DomTreeNodeBase<SILBasicBlock>.
2. LoopInfoBase::Analyze() => LoopInfoBase::analyze().

Swift SVN r31807
2015-09-09 04:37:25 +00:00
Michael Gottesman
eb6857aa88 Revert "Revert r29594 "Implement verification of dominance analysis.""
This reverts commit r29600.

Swift SVN r29602
2015-06-24 05:45:29 +00:00
Greg Parker
7088b2fe1b Revert r29594 "Implement verification of dominance analysis."
This broke some builders.


Swift SVN r29600
2015-06-24 05:05:46 +00:00
Michael Gottesman
0cc8706c1a Implement verification of dominance analysis.
Swift SVN r29594
2015-06-24 01:57:37 +00:00
Erik Eckstein
6d9a7a1045 Helper class for visiting basic blocks in dominance order.
It uses a worklist-based algorithm. In contrast to a recursive traversal algorithm,
it cannot cause a stack overflow for very deep dominator trees.



Swift SVN r24107
2014-12-23 09:09:34 +00:00
Michael Gottesman
a12880aa8c [dominance] Implement PostDominanceInfo::properlyDominates(SILInstruction *, SILInstruction *)
I am going to use this for dead store elimination in multi-bb load store optimization.

rdar://17680758

Swift SVN r20002
2014-07-16 04:26:00 +00:00
Arnold Schwaighofer
4a5ba0ff87 DominanceInfo: Add a verification function
Swift SVN r19629
2014-07-07 21:05:20 +00:00
Andrew Trick
53cbc3e858 Add a ColdBlockInfo analysis based on DominanceAnalysis.
This will be used by PerformanceInliner, GlobalOpt, and other passes in the future.

Swift SVN r19454
2014-07-02 06:35:09 +00:00
Arnold Schwaighofer
a14aa42ce1 SILLoopInfo: Implement SIL loop info analysis using LLVM's LoopInfo
Swift SVN r18718
2014-06-05 22:25:42 +00:00
Chris Lattner
94d4de408b adjust to llvm mainline changes.
Swift SVN r12226
2014-01-13 15:13:08 +00:00
Michael Gottesman
90082a51f1 Add in a swift namespace typedef DominanceInfoNode for llvm::DomTreeNodeBase<SILBasicBlock>.
This complements the DominanceInfo class.

Swift SVN r10736
2013-12-02 22:52:00 +00:00
Chris Lattner
a9e92a2b61 Expose basic post-dominance information.
Swift SVN r6421
2013-07-21 04:29:29 +00:00
John McCall
dd4f26c6dc It does seem to make non-generic assumptions about the node
type, though;  I had to define a WriteAsOperand function and
add a front() method to SILFunction to get this to work.
Rip out my dominators implementation and replace it with
LLVM's.  I'd forgotten that LLVM's was actually generic.

Swift SVN r4717
2013-04-12 21:24:27 +00:00
John McCall
3274de9c21 Add a simple dominance analysis based on Cooper, Harvey, and
Kennedy (2001).

This hasn't been tested yet.

Swift SVN r4712
2013-04-12 08:15:09 +00:00