[PATCH] D106779: [SimplifyCFG] Make ValueEqaulityComparison freeze-aware.

Hyeongyu Kim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 27 08:36:04 PDT 2021


hyeongyukim added a comment.

In D106779#2905687 <https://reviews.llvm.org/D106779#2905687>, @lebedev.ri wrote:

> In D106779#2905636 <https://reviews.llvm.org/D106779#2905636>, @nikic wrote:
>
>> As the relevant optimizations already exist in InstCombine (D105392 <https://reviews.llvm.org/D105392>, D106233 <https://reviews.llvm.org/D106233>) is the motivation here a phase ordering problem? No InstCombine + SimplifyCFG runs at the relevant pipeline position?
>
> I'll ask a slightly different question.
> Does simplifycfg itself insert said `freeze` that is problematic here, and thus blocks itselves forward progress?

SimplyCFG does not insert Freeze. This freeze is inserted by loop unswitch.(D106041 <https://reviews.llvm.org/D106041>)

In D106779#2905636 <https://reviews.llvm.org/D106779#2905636>, @nikic wrote:

> As the relevant optimizations already exist in InstCombine (D105392 <https://reviews.llvm.org/D105392>, D106233 <https://reviews.llvm.org/D106233>) is the motivation here a phase ordering problem? No InstCombine + SimplifyCFG runs at the relevant pipeline position?

You're right. This problem can be solved by D105392 <https://reviews.llvm.org/D105392>. 
However, this problem may remain by order of Instcombine and SimplifyCFG.
How about calling `pushFreezeToPreventPoisonFromPropagating`(implemented by D105392 <https://reviews.llvm.org/D105392>) in SimplifyCFG? It will solve more general cases of performance degradation


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106779



More information about the llvm-commits mailing list