Don't consider discard and return inside uniform control flow

This commit is contained in:
Dzmitry Malyshau authored and Dzmitry Malyshau committed 2021-05-31 00:49:25 -04:00
1 parent 58e5b2565d
commit 61bfb29963
1 file changed
+10 -3
+10 -3
View File
@@ -569,7 +569,11 @@ impl FunctionInfo {
S::Break | S::Continue => FunctionUniformity::new(),
S::Kill => FunctionUniformity {
result: Uniformity::new(),
exit: ExitFlags::MAY_KILL,
exit: if disruptor.is_some() {
ExitFlags::MAY_KILL
} else {
ExitFlags::empty()
},
},
S::Barrier(_) => FunctionUniformity {
result: Uniformity {
@@ -633,8 +637,11 @@ impl FunctionInfo {
non_uniform_result: value.and_then(|expr| self.add_ref(expr)),
requirements: UniformityRequirements::empty(),
},
//TODO: if we are in the uniform control flow, should this still be an exit flag?
exit: ExitFlags::MAY_RETURN,
exit: if disruptor.is_some() {
ExitFlags::MAY_RETURN
} else {
ExitFlags::empty()
},
},
// Here and below, the used expressions are already emitted,
// and their results do not affect the function return value,