Page MenuHomePhabricator

[FPEnv][InstSimplify] Enable more folds for constrained fsub
Needs ReviewPublic

Authored by kpn on Aug 2 2021, 9:19 AM.

Details

Summary

Currently there are optimizations for the fsub instruction that do not fire for a constrained fsub. Add some of these optimizations.

Optimizations that require teaching the IR matchers about the constrained intrinsics are for a future patch.

Diff Detail

Event Timeline

kpn created this revision.Aug 2 2021, 9:19 AM
kpn requested review of this revision.Aug 2 2021, 9:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 2 2021, 9:19 AM
sepavloff added inline comments.Aug 2 2021, 11:03 AM
llvm/lib/Analysis/InstructionSimplify.cpp
4963

This transformation is valid only if FMF.noNaNs() is set, because it is incorrect if X==SNaN. Similar for other cases below.