[PATCH] D127254: [SelectionDAGISel] Chain any mayRaiseFPException instruction created from a strict FP node

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 7 14:48:29 PDT 2022


craig.topper created this revision.
craig.topper added reviewers: andrew.w.kaylor, uweigand, jonpa, kpn, efriedma.
Herald added subscribers: StephenFan, steven.zhang, kbarton, hiraditya, nemanjai.
Herald added a project: All.
craig.topper requested review of this revision.
Herald added a project: LLVM.

Tablegen doesn't set the OFPL_Chain flag for all the mayRaiseFPException
instructions in an isel output pattern. In practice, it only sets it
for the root of the output pattern and only if the pattern in the
instruction class in tablegen is empty or contains a strict FP node.

It's unclear to me that tablegen has enough information to set the
OPFL_Chain flag.

The result of this is that we don't always add a chain through
mayRaiseFPException instructions created during isel.

This patch updates the isel machinery to detect when we're emitting
nodes for a pattern that contained a strict FP node and will thread
a chain through all mayRaiseFPException nodes we create.

Some isel patterns particularly on PowerPC emit the same compare
instruction multiple times in their isel pattern and expects them
to be CSEd. To ensure they CSE, this patch avoids updating InputChain
until the end of the match or when we find an OPFL_Chain flag.

Hopefully fixes PR54617.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127254

Files:
  llvm/include/llvm/CodeGen/SelectionDAGISel.h
  llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  llvm/test/CodeGen/PowerPC/fp-strict-conv-f128.ll
  llvm/test/CodeGen/PowerPC/fp-strict-fcmp-noopt.ll
  llvm/test/CodeGen/PowerPC/nofpexcept.ll
  llvm/test/CodeGen/PowerPC/ppcf128-constrained-fp-intrinsics.ll
  llvm/test/CodeGen/PowerPC/vector-constrained-fp-intrinsics.ll
  llvm/test/CodeGen/SystemZ/vector-constrained-fp-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127254.434963.patch
Type: text/x-patch
Size: 23269 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220607/0941c616/attachment-0001.bin>


More information about the llvm-commits mailing list