Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
f3c63cc3
Commit
f3c63cc3
authored
Jan 19, 2016
by
Dejan Mircevski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move continue-block to after all branches.
parent
e7f6cac1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
40 deletions
+54
-40
InReadableOrder.cpp
SPIRV/InReadableOrder.cpp
+14
-2
spv.do-while-continue-break.vert.out
Test/baseResults/spv.do-while-continue-break.vert.out
+6
-6
spv.for-continue-break.vert.out
Test/baseResults/spv.for-continue-break.vert.out
+5
-5
spv.loops.frag.out
Test/baseResults/spv.loops.frag.out
+19
-17
spv.loopsArtificial.frag.out
Test/baseResults/spv.loopsArtificial.frag.out
+8
-8
spv.while-continue-break.vert.out
Test/baseResults/spv.while-continue-break.vert.out
+2
-2
No files found.
SPIRV/InReadableOrder.cpp
View file @
f3c63cc3
...
@@ -67,8 +67,9 @@ class ReadableOrderTraverser {
...
@@ -67,8 +67,9 @@ class ReadableOrderTraverser {
public
:
public
:
explicit
ReadableOrderTraverser
(
std
::
function
<
void
(
Block
*
)
>
callback
)
:
callback_
(
callback
)
{}
explicit
ReadableOrderTraverser
(
std
::
function
<
void
(
Block
*
)
>
callback
)
:
callback_
(
callback
)
{}
// Visits the block if it hasn't been visited already and isn't currently
// Visits the block if it hasn't been visited already and isn't currently
// being delayed. Invokes callback(block), then descends into its successors.
// being delayed. Invokes callback(block), then descends into its
// Delays merge-block processing until all the branches have been completed.
// successors. Delays merge-block and continue-block processing until all
// the branches have been completed.
void
visit
(
Block
*
block
)
void
visit
(
Block
*
block
)
{
{
assert
(
block
);
assert
(
block
);
...
@@ -77,14 +78,25 @@ public:
...
@@ -77,14 +78,25 @@ public:
callback_
(
block
);
callback_
(
block
);
visited_
[
block
]
=
true
;
visited_
[
block
]
=
true
;
Block
*
mergeBlock
=
nullptr
;
Block
*
mergeBlock
=
nullptr
;
Block
*
continueBlock
=
nullptr
;
auto
mergeInst
=
block
->
getMergeInstruction
();
auto
mergeInst
=
block
->
getMergeInstruction
();
if
(
mergeInst
)
{
if
(
mergeInst
)
{
Id
mergeId
=
mergeInst
->
getIdOperand
(
0
);
Id
mergeId
=
mergeInst
->
getIdOperand
(
0
);
mergeBlock
=
block
->
getParent
().
getParent
().
getInstruction
(
mergeId
)
->
getBlock
();
mergeBlock
=
block
->
getParent
().
getParent
().
getInstruction
(
mergeId
)
->
getBlock
();
delayed_
[
mergeBlock
]
=
true
;
delayed_
[
mergeBlock
]
=
true
;
if
(
mergeInst
->
getOpCode
()
==
spv
::
OpLoopMerge
)
{
Id
continueId
=
mergeInst
->
getIdOperand
(
1
);
continueBlock
=
block
->
getParent
().
getParent
().
getInstruction
(
continueId
)
->
getBlock
();
delayed_
[
continueBlock
]
=
true
;
}
}
}
for
(
const
auto
succ
:
block
->
getSuccessors
())
for
(
const
auto
succ
:
block
->
getSuccessors
())
visit
(
succ
);
visit
(
succ
);
if
(
continueBlock
)
{
delayed_
[
continueBlock
]
=
false
;
visit
(
continueBlock
);
}
if
(
mergeBlock
)
{
if
(
mergeBlock
)
{
delayed_
[
mergeBlock
]
=
false
;
delayed_
[
mergeBlock
]
=
false
;
visit
(
mergeBlock
);
visit
(
mergeBlock
);
...
...
Test/baseResults/spv.do-while-continue-break.vert.out
View file @
f3c63cc3
...
@@ -66,12 +66,6 @@ Linked vertex stage:
...
@@ -66,12 +66,6 @@ Linked vertex stage:
19: Label
19: Label
Store 21(B) 22
Store 21(B) 22
Branch 13
Branch 13
13: Label
37: 6(int) Load 8(i)
38: 6(int) IAdd 37 22
Store 8(i) 38
40: 17(bool) SLessThan 38 39
BranchConditional 40 10 12
20: Label
20: Label
25: 6(int) Load 8(i)
25: 6(int) Load 8(i)
27: 17(bool) IEqual 25 26
27: 17(bool) IEqual 25 26
...
@@ -83,6 +77,12 @@ Linked vertex stage:
...
@@ -83,6 +77,12 @@ Linked vertex stage:
29: Label
29: Label
Store 35(F) 36
Store 35(F) 36
Branch 13
Branch 13
13: Label
37: 6(int) Load 8(i)
38: 6(int) IAdd 37 22
Store 8(i) 38
40: 17(bool) SLessThan 38 39
BranchConditional 40 10 12
12: Label
12: Label
Store 41(G) 42
Store 41(G) 42
Return
Return
...
...
Test/baseResults/spv.for-continue-break.vert.out
View file @
f3c63cc3
...
@@ -67,11 +67,6 @@ Linked vertex stage:
...
@@ -67,11 +67,6 @@ Linked vertex stage:
24: Label
24: Label
Store 26(B) 19
Store 26(B) 19
Branch 13
Branch 13
13: Label
40: 6(int) Load 8(i)
41: 6(int) IAdd 40 19
Store 8(i) 41
Branch 10
25: Label
25: Label
29: 6(int) Load 8(i)
29: 6(int) Load 8(i)
31: 6(int) SMod 29 30
31: 6(int) SMod 29 30
...
@@ -84,6 +79,11 @@ Linked vertex stage:
...
@@ -84,6 +79,11 @@ Linked vertex stage:
34: Label
34: Label
Store 38(F) 39
Store 38(F) 39
Branch 13
Branch 13
13: Label
40: 6(int) Load 8(i)
41: 6(int) IAdd 40 19
Store 8(i) 41
Branch 10
12: Label
12: Label
Store 42(G) 43
Store 42(G) 43
Return
Return
...
...
Test/baseResults/spv.loops.frag.out
View file @
f3c63cc3
...
@@ -197,6 +197,8 @@ Linked fragment stage:
...
@@ -197,6 +197,8 @@ Linked fragment stage:
43: 7(fvec4) FAdd 42 28
43: 7(fvec4) FAdd 42 28
Store 9(color) 43
Store 9(color) 43
Branch 15
Branch 15
16: Label
Branch 13
15: Label
15: Label
Branch 45
Branch 45
45: Label
45: Label
...
@@ -236,14 +238,14 @@ Linked fragment stage:
...
@@ -236,14 +238,14 @@ Linked fragment stage:
BranchConditional 77 78 79
BranchConditional 77 78 79
78: Label
78: Label
Branch 63
Branch 63
63: Label
Branch 60
79: Label
79: Label
81: 7(fvec4) Load 69(bigColor1_1)
81: 7(fvec4) Load 69(bigColor1_1)
82: 7(fvec4) Load 9(color)
82: 7(fvec4) Load 9(color)
83: 7(fvec4) FAdd 82 81
83: 7(fvec4) FAdd 82 81
Store 9(color) 83
Store 9(color) 83
Branch 63
Branch 63
63: Label
Branch 60
62: Label
62: Label
Branch 84
Branch 84
84: Label
84: Label
...
@@ -482,17 +484,17 @@ Linked fragment stage:
...
@@ -482,17 +484,17 @@ Linked fragment stage:
BranchConditional 260 261 262
BranchConditional 260 261 262
261: Label
261: Label
Branch 249
Branch 249
249: Label
267: 141(int) Load 245(i)
268: 141(int) IAdd 267 159
Store 245(i) 268
Branch 246
262: Label
262: Label
264: 21(ptr) AccessChain 9(color) 73
264: 21(ptr) AccessChain 9(color) 73
265: 6(float) Load 264
265: 6(float) Load 264
266: 6(float) FAdd 265 93
266: 6(float) FAdd 265 93
Store 264 266
Store 264 266
Branch 249
Branch 249
249: Label
267: 141(int) Load 245(i)
268: 141(int) IAdd 267 159
Store 245(i) 268
Branch 246
248: Label
248: Label
Store 269(i) 144
Store 269(i) 144
Branch 270
Branch 270
...
@@ -545,12 +547,6 @@ Linked fragment stage:
...
@@ -545,12 +547,6 @@ Linked fragment stage:
BranchConditional 304 305 306
BranchConditional 304 305 306
305: Label
305: Label
Branch 296
Branch 296
296: Label
325: 21(ptr) AccessChain 9(color) 64
326: 6(float) Load 325
327: 6(float) Load 132(d4)
328: 17(bool) FOrdLessThan 326 327
BranchConditional 328 293 295
306: Label
306: Label
308: 21(ptr) AccessChain 9(color) 107
308: 21(ptr) AccessChain 9(color) 107
309: 6(float) Load 308
309: 6(float) Load 308
...
@@ -576,6 +572,12 @@ Linked fragment stage:
...
@@ -576,6 +572,12 @@ Linked fragment stage:
Branch 313
Branch 313
313: Label
313: Label
Branch 296
Branch 296
296: Label
325: 21(ptr) AccessChain 9(color) 64
326: 6(float) Load 325
327: 6(float) Load 132(d4)
328: 17(bool) FOrdLessThan 326 327
BranchConditional 328 293 295
295: Label
295: Label
Branch 329
Branch 329
329: Label
329: Label
...
@@ -891,14 +893,14 @@ Linked fragment stage:
...
@@ -891,14 +893,14 @@ Linked fragment stage:
Branch 549
Branch 549
549: Label
549: Label
Branch 524
Branch 524
524: Label
Branch 521
539: Label
539: Label
558: 7(fvec4) Load 9(color)
558: 7(fvec4) Load 9(color)
559: 7(fvec4) CompositeConstruct 93 93 93 93
559: 7(fvec4) CompositeConstruct 93 93 93 93
560: 7(fvec4) FAdd 558 559
560: 7(fvec4) FAdd 558 559
Store 9(color) 560
Store 9(color) 560
Branch 523
Branch 523
524: Label
Branch 521
523: Label
523: Label
Branch 562
Branch 562
562: Label
562: Label
...
@@ -927,8 +929,6 @@ Linked fragment stage:
...
@@ -927,8 +929,6 @@ Linked fragment stage:
BranchConditional 583 584 585
BranchConditional 583 584 585
584: Label
584: Label
Branch 565
Branch 565
565: Label
Branch 562
585: Label
585: Label
Branch 579
Branch 579
579: Label
579: Label
...
@@ -940,6 +940,8 @@ Linked fragment stage:
...
@@ -940,6 +940,8 @@ Linked fragment stage:
592: 21(ptr) AccessChain 9(color) 107
592: 21(ptr) AccessChain 9(color) 107
Store 592 591
Store 592 591
Branch 565
Branch 565
565: Label
Branch 562
564: Label
564: Label
593: 7(fvec4) Load 9(color)
593: 7(fvec4) Load 9(color)
594: 7(fvec4) CompositeConstruct 93 93 93 93
594: 7(fvec4) CompositeConstruct 93 93 93 93
...
...
Test/baseResults/spv.loopsArtificial.frag.out
View file @
f3c63cc3
...
@@ -171,12 +171,6 @@ Linked fragment stage:
...
@@ -171,12 +171,6 @@ Linked fragment stage:
49: 6(float) FAdd 47 48
49: 6(float) FAdd 47 48
Store 46 49
Store 46 49
Branch 16
Branch 16
16: Label
69: 24(ptr) AccessChain 9(color) 35
70: 6(float) Load 69
71: 6(float) Load 28(d4)
72: 30(bool) FOrdLessThan 70 71
BranchConditional 72 13 15
45: Label
45: Label
Branch 33
Branch 33
33: Label
33: Label
...
@@ -204,6 +198,12 @@ Linked fragment stage:
...
@@ -204,6 +198,12 @@ Linked fragment stage:
Branch 57
Branch 57
57: Label
57: Label
Branch 16
Branch 16
16: Label
69: 24(ptr) AccessChain 9(color) 35
70: 6(float) Load 69
71: 6(float) Load 28(d4)
72: 30(bool) FOrdLessThan 70 71
BranchConditional 72 13 15
15: Label
15: Label
Branch 73
Branch 73
73: Label
73: Label
...
@@ -261,8 +261,6 @@ Linked fragment stage:
...
@@ -261,8 +261,6 @@ Linked fragment stage:
117: 6(float) FAdd 116 48
117: 6(float) FAdd 116 48
Store 115 117
Store 115 117
Branch 76
Branch 76
76: Label
Branch 73
114: Label
114: Label
Branch 104
Branch 104
104: Label
104: Label
...
@@ -290,6 +288,8 @@ Linked fragment stage:
...
@@ -290,6 +288,8 @@ Linked fragment stage:
Branch 124
Branch 124
124: Label
124: Label
Branch 76
Branch 76
76: Label
Branch 73
75: Label
75: Label
136: 7(fvec4) Load 9(color)
136: 7(fvec4) Load 9(color)
137: 7(fvec4) CompositeConstruct 48 48 48 48
137: 7(fvec4) CompositeConstruct 48 48 48 48
...
...
Test/baseResults/spv.while-continue-break.vert.out
View file @
f3c63cc3
...
@@ -60,8 +60,6 @@ Linked vertex stage:
...
@@ -60,8 +60,6 @@ Linked vertex stage:
24: Label
24: Label
Store 26(B) 21
Store 26(B) 21
Branch 13
Branch 13
13: Label
Branch 10
25: Label
25: Label
29: 6(int) Load 8(i)
29: 6(int) Load 8(i)
31: 6(int) SMod 29 30
31: 6(int) SMod 29 30
...
@@ -76,6 +74,8 @@ Linked vertex stage:
...
@@ -76,6 +74,8 @@ Linked vertex stage:
37: 6(int) IAdd 36 19
37: 6(int) IAdd 36 19
Store 8(i) 37
Store 8(i) 37
Branch 13
Branch 13
13: Label
Branch 10
12: Label
12: Label
Store 38(D) 39
Store 38(D) 39
Return
Return
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment