HomePhabricator

[DAGCombiner] Require ninf for division estimation

Authored by qiucf on Jun 14 2020, 7:58 AM.

Description

[DAGCombiner] Require ninf for division estimation

Current implementation of division estimation isn't correct for some
cases like 1.0/0.0 (result is nan, not expected inf).

And this change exposes a potential infinite loop: we use
isConstOrConstSplatFP in combineRepeatedFPDivisors to look up if the
divisor is some constant. But it doesn't work after legalized on some
platforms. This patch restricts the method to act before LegalDAG.

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D80542

Details

Committed
qiucfJun 14 2020, 7:58 AM
Reviewer
spatel
Differential Revision
D80542: [DAGCombiner] Require ninf for division estimation
Parents
rG098e48a6a155: [PassManager] restore early-cse to vector cleanup
Branches
Unknown
Tags
Unknown