[all-commits] [llvm/llvm-project] 0eb1ef: [DAGCombiner] When combining REM ensure optimized ...
Bradley Smith via All-commits
all-commits at lists.llvm.org
Wed Dec 1 03:39:23 PST 2021
Author: Bradley Smith <bradley.smith at arm.com>
Date: 2021-12-01 (Wed, 01 Dec 2021)
[DAGCombiner] When combining REM ensure optimized div nodes are unique
The REM DAG combine uses the visitDivLike functions to try and get an
optimized DIV node to provide better codegen, however in some cases this
visitDivLike call ends up in the BuildSDIVPow2 target hook, which in
turn sometimes will return the same node passed in to indicate not to
change it. The REM DAG combine does not anticipate this and creates a
cycle in the DAG because of it.
Fix this by ensuring any such optimized div node returned is distinct
from the node being combined.
Differential Revision: https://reviews.llvm.org/D114716
More information about the All-commits