KhronosGroup / SPIRV-Tools

Apache License 2.0
1.09k stars 559 forks source link

Do not distrubute OpSNegate into OpUDiv #5823

Closed s-perron closed 1 month ago

s-perron commented 2 months ago

We cannot apply the negate to an operand of an OpUDiv instead of it result. This is because the operands of the OpUDiv are interpreted as unsigned. We stop the optimizer from doing that.

There were no tests for distributing a negate into OpIMul, OpSDiv, and OpUDiv. Tests are added for all of these.

Fixes #5822