[PATCH] D87361: [SelectionDAG] Add helper guard to automatically insert flags

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 04:30:09 PDT 2020


qiucf created this revision.
qiucf added reviewers: spatel, nemanjai, aemerson, hfinkel, craig.topper, RKSimon, uweigand, jsji, jonpa, steven.zhang.
Herald added subscribers: llvm-commits, ecnelises, hiraditya.
Herald added a project: LLVM.
qiucf requested review of this revision.

The idea is from review of D87037 <https://reviews.llvm.org/D87037>, @spatel 's comments.

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, unless explicitly use `Inserter->disable()`.

It's a prototype so in this revision I only enabled in `visitFMA` to show the same flag propagation as D87037 <https://reviews.llvm.org/D87037>.


https://reviews.llvm.org/D87361

Files:
  llvm/include/llvm/CodeGen/SelectionDAG.h
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/test/CodeGen/PowerPC/fma-combine.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87361.290695.patch
Type: text/x-patch
Size: 10237 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200909/03118411/attachment.bin>


More information about the llvm-commits mailing list