DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Reassociate: add global reassociation algorithm (#6598)

Open lizhengxing opened this issue 1 year ago • 0 comments

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)

lizhengxing avatar May 21 '24 23:05 lizhengxing