Commit Graph

3 Commits

Author SHA1 Message Date
Dejan Mircevski
213bbbe4a7 Split loop header from condition testing for for/while loops. 2016-01-20 11:51:43 -05:00
Dejan Mircevski
832c65c33b 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
2016-01-11 15:57:11 -05:00
Dejan Mircevski
e537b8b488 Fix unreachable-block removal.
Add a test for loop without a condition.

Change-Id: Idd7fc462218a84b1e745207e2975a3f2897d30a0
2016-01-10 19:37:00 -05:00