[all-commits] [llvm/llvm-project] c0f8e4: [SelectionDAG] Add guard to automatically insert f...

Qiu Chaofan via All-commits all-commits at lists.llvm.org
Fri Sep 25 22:58:14 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c0f8e4c06c85db256806cfce90a2b49e4cdd58d4
      https://github.com/llvm/llvm-project/commit/c0f8e4c06c85db256806cfce90a2b49e4cdd58d4
  Author: Qiu Chaofan <qiucofan at cn.ibm.com>
  Date:   2020-09-26 (Sat, 26 Sep 2020)

  Changed paths:
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/X86/sqrt-fastmath-mir.ll

  Log Message:
  -----------
  [SelectionDAG] Add guard to automatically insert flags

This is like FastMathFlagGuard in IR. Since we use SDAG instance to get
values, it's with SelectionDAG. By creating a FlagInserter in current
scope, all values created by getNode will get the flags if no Flags
argument provided.

In this patch, I applied it to floating point operations folding part in
DAG combiner, and removed Flags passing to getNode to show its effect.
Other places in DAG combiner and other helper methods similar to getNode
also need this. They can be done in follow-up patches.

Reviewed By: spatel

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




More information about the All-commits mailing list