[PATCH] D79528: [ConstantFold] Optimize xor undef, undef to undef

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 10:47:20 PDT 2020


aqjune abandoned this revision.
aqjune added a comment.

I reconsidered about possible risks and I became to agree that this patch required more discussion about its effectiveness in practice.
The similar case would be the optimizations that exploit signed overflow, but unlike signed overflow, I could not detect any performance benefit at least from testsuite (with LTO enabled); all binaries remained the same. Since folding it to undef allows more freedom in theory, I thought it was a low-hanging fruit, but it doesn't seem to be in reality.
So, I agree that it is okay to have the xor undef, undef -> zero transformation. It works in practice, and it does not break existing source programs that uses the pattern to zero-ize variables.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79528/new/

https://reviews.llvm.org/D79528





More information about the llvm-commits mailing list