Commit Graph

24 Commits

Author SHA1 Message Date
Erik Eckstein
b175436d07 libswift: add instructions, support block predecessors/successors
Add many new instruction classes in libswift, including all terminator instructions.
This allows to support BasicBlock predecessors and successors.
2021-07-01 16:15:44 +02:00
Ravi Kandhadai
249b11a018 [SIL Diagnostics] Improve diagnostics for yield-once coroutines
when the coroutines yield in some paths but not in all paths.

<rdar://48184430>
2019-03-11 18:15:35 -07:00
Adrian Prantl
ff63eaea6f Remove \brief commands from doxygen comments.
We've been running doxygen with the autobrief option for a couple of
years now. This makes the \brief markers into our comments
redundant. Since they are a visual distraction and we don't want to
encourage more \brief markers in new code either, this patch removes
them all.

Patch produced by

      for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done
2018-12-04 15:45:04 -08:00
David Zarzycki
52fd7cb2c9 [SIL] Perf: Cache basic block during SILSuccessor iteration
'operator*' in this patch becomes a hot spot in some scenarios. For
example: an enum with an unusually large number of cases.
2018-05-29 09:44:07 -04:00
Joe Shajrawi
75939510cd PGO: Use ProfileCounter instead of Optional<uint64_t> to hold profile counts 2017-09-26 13:34:46 -07:00
Joe Shajrawi
7cb5b5a759 PGO: Move profile counts to SILSuccessor 2017-09-26 10:55:05 -07:00
Michael Gottesman
913920c93b [sil] Rename SILSuccessorIterator -> SILSuccessor::pred_iterator.
This iterator is not actually a SILSuccessorIterator since it is not iterating
over the "successors" of a block. Instead it is used to given the head of a CFG
edge, iterate over the CFG edge's predecessors using the double linked list
stored inside SILSuccessor.

This rename/refactor ties SILSuccessor closer to SILSuccessorIterator and makes
it clear what we are actually iterating over.
2017-04-26 13:32:59 -07:00
Michael Gottesman
3ab6604a67 [gardening] Add more comprehensive comments to SILSuccessor.h.
This just makes it clearer what this class really does and also makes it clear
that this is really representing a CFGEdge more than a specific successor. I may
rename it to SILCFGEdge at some point to make the name match its usage.
2017-04-26 13:15:51 -07:00
Hugh Bellamy
3220f7fba8 Provide const dereference operator in SILSuccessorIterator 2017-03-16 14:41:51 +07:00
Bob Wilson
c24c9958c0 Fix incorrect SILSuccessorIterator operator++ that broke master-next after llvm r294339.
This operator++ is a post-increment operator but it was implemented with pre-increment behavior.
This bug was exposed by the changes in llvm r294339 and caused the master-next branch to stop
building.
2017-02-10 22:22:29 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Michael Gottesman
c8e119b159 [gardening] Standardize include guard in SILSuccessor.h
We always use all caps.
2016-11-28 12:53:40 -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
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
John McCall
f262b13b80 Handle try_apply in the diagnostic unreachable-code pass.
A somewhat more natural solution would be to replace the
normal successor with an edge to an unreachable block,
but that would require adding blocks during the iteration.

Add a small amount of SIL infrastructure for asking a
pred_iterator exactly which edge out of a terminator it
represents.

Swift SVN r28514
2015-05-13 08:52:31 +00:00
Michael Gottesman
177f48a897 Change SILSuccessorIterator++() to be a canonical preincrement and add in a postincrement operator.
Swift SVN r10737
2013-12-02 22:52:01 +00:00
Anna Zaks
dde5e15457 [SIL] Cleanup, remove redundant initializers.
Swift SVN r6666
2013-07-27 00:25:02 +00:00
Joe Groff
8e56e45f22 SIL: Define a switch_oneof instruction.
This instruction encapsulates testing, branching, and destructuring a oneof, as in:

oneof Expr {
  case True
  case False
  case IntLiteral(Int)
  case StringLiteral(String)
}

sil @dispatch_expr : $(Expr) -> () {
entry(%expr : $Expr):
  switch_oneof %expr, \
    case #Expr.True!oneofelt : bb1, \
    case #Expr.False!oneofelt : bb2, \
    case #Expr.IntLiteral!oneofelt : bb3, \
    default bb4
bb1:
  ...
bb2:
  ...
bb3(%int : $Int):
  ...
bb4:
  ...
}

Swift SVN r6329
2013-07-17 16:55:29 +00:00
Chris Lattner
a71bc3a78e rename Value -> SILValue, BasicBlock -> SILBasicBlock, BBArgument -> SILArgument.
Swift SVN r4594
2013-04-03 21:05:42 +00:00
Joe Groff
b105e02534 IRGen: Lower SIL bb arguments to LLVM phi nodes.
Swift SVN r4493
2013-03-27 17:07:17 +00:00
Joe Groff
59d418de81 SIL: Add arguments to branch instructions.
BranchInst and CondBranchInst need to be able to pass arguments into the target BB. Add argument lists to the instructions.

Swift SVN r4485
2013-03-25 19:28:13 +00:00
Chris Lattner
eab0962c5f rename many references to CFG to SIL.
Swift SVN r3130
2012-11-07 01:06:19 +00:00
Chris Lattner
93ae03891d rename the SIL/CFG*.h headers to SIL/SIL*.h
Swift SVN r3128
2012-11-07 00:56:21 +00:00