DirectXShaderCompiler
DirectXShaderCompiler copied to clipboard
Reassociate: add global reassociation algorithm (#6598)
This PR pulls the upstream change, Reassociate: add global reassociation algorithm (https://github.com/llvm/llvm-project/commit/b8a330c42ab43879119cd3a305756d28aefe9fe6), into DXC with miminal changes.
For the code below: foo = (a * b) * c bar = (a * d) * c
As the upstream change states, it can identify the a*c is a common factor and redundant.
This is part 1 of the fix for #6593.
(cherry picked from commit 6f9c107b78c1161cef9c44bec714e081ddbae275)