Skip to content

Conversation

@alister-chowdhury
Copy link
Contributor

This change extends the negation cancellation added in #6444 to also cancel negation for OpFDiv, OpSDiv and OpVectorTimesScalar.

Additionally adding the following constant folding rules:

  • x - x = 0
  • x / x = 1
  • x / -x = -1
  • -x / x = -1

(x * (1 / x)) = 1 was already in place, but direct division was overlooked.

This change extends the negation cancellation added in KhronosGroup#6444 to also
cancel negation for OpFDiv, OpSDiv and OpVectorTimesScalar.

Additionally adding the following constant folding rules:
* x - x = 0
*  x /  x =  1
*  x / -x = -1
* -x /  x = -1

`(x * (1 / x)) = 1` was already in place, but direct division was
overlooked.
@s-perron s-perron requested review from luciechoi and s-perron and removed request for s-perron December 10, 2025 16:18
@s-perron s-perron enabled auto-merge (squash) January 5, 2026 14:21
@s-perron s-perron merged commit d14606e into KhronosGroup:main Jan 5, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants