qsharp-compiler icon indicating copy to clipboard operation
qsharp-compiler copied to clipboard

Optimize conditions with compile time Booleans

Open swernli opened this issue 2 years ago • 2 comments

This change optimizes handling of conditions where some of the values are known compile time Boolean values. In particular, it expands handling of if-elif-else sequences by compressing known true branches into the current block and skipping any other branches. Likewise, for compound conditional evaluation it adds handling for special cases where part of a logical and or logical or statement is known to be constant, removing the need for a phi-node and propagating the appropriate constant or dynamic value.

New and updated test cases were manually verified for correct output.

swernli avatar Aug 09 '22 06:08 swernli

/azp run

swernli avatar Aug 10 '22 20:08 swernli

Azure Pipelines successfully started running 2 pipeline(s).

azure-pipelines[bot] avatar Aug 10 '22 20:08 azure-pipelines[bot]