Fix back-branch target for do-while loops.
To ensure back branches always go to a header block, create a header block even for !testFirst loops. Then unify common code between the testFirst/!testFirst cases. Generate the header-block code first, so update golden files. Realize that certain infinite loops generate invalid SPIR-V, so put a TODO to instead abort code generation in such cases. Change-Id: I1e173c8f73daad186cfc666b7d72bd563ed7665d
This commit is contained in:
parent
c8fbbab419
commit
832c65c33b
20 changed files with 2062 additions and 2029 deletions
|
|
@ -374,7 +374,7 @@ public:
|
|||
void endSwitch(std::vector<Block*>& segmentBB);
|
||||
|
||||
struct LoopBlocks {
|
||||
Block &body, &merge, &continue_target;
|
||||
Block &head, &body, &merge, &continue_target;
|
||||
};
|
||||
|
||||
// Start a new loop and prepare the builder to generate code for it. Until
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue