[PATCH] D104569: [SimplifyCFG] Fix SimplifyBranchOnICmpChain to be undef/poison safe.

Hyeongyu Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 2 05:21:54 PDT 2021


hyeongyukim added a comment.

I was curious about the impact of this patch, so I ran llvm-test-suite (benchmarks only) and found that only assembly files were different among 1977.
Three of them are just syntactic differences (@aqjune made a patch for this), but two of them had meaningful differences. The reason was as follows.

  v = load ptr
  cond = freeze(icmp (and v, const), const')
  br cond, ...

Since `cond` was frozen, value analysis didn't work well.
I think adding this optimization to InstCombine can be helpful:

  v = load ptr
  freeze(icmp (and v, const), const')
  =>
  v = load ptr
  v' = freeze v
  icmp (and v', const), const'

What do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104569



More information about the llvm-commits mailing list