[PATCH] D54121: [FPEnv] Add constrained FCMP intrinsic

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 5 13:40:32 PST 2018


cameron.mcinally created this revision.
cameron.mcinally added reviewers: craig.topper, andrew.w.kaylor, kpn, uweigand, hfinkel.
Herald added a subscriber: llvm-commits.

This isn't so much a patch as it is an RFC...

The compares are an odd duck wrt constrained intrinsics, since they are represented internally by the FCMPInst class. There are several ways that we could handle this quirk, one of which is shown in this Diff.

This patch attempts to use one intrinsic to represent the FCMP with a dedicated operand for the condition code. That way we don't need separate intrinsics for EQ/LT/LTE/etc. IMO, this solution is most in line with the other constrained intrinsics.

There are some weaknesses here though, like encoding and decoding the condition code. I'll comment inline on some of the other issues that need addressing too.


Repository:
  rL LLVM

https://reviews.llvm.org/D54121

Files:
  docs/LangRef.rst
  include/llvm/CodeGen/ISDOpcodes.h
  include/llvm/CodeGen/SelectionDAGNodes.h
  include/llvm/CodeGen/TargetLowering.h
  include/llvm/IR/IntrinsicInst.h
  include/llvm/IR/Intrinsics.td
  lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
  lib/IR/IntrinsicInst.cpp
  lib/IR/Verifier.cpp
  test/CodeGen/X86/fp-intrinsics.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54121.172647.patch
Type: text/x-patch
Size: 11342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181105/9231fec8/attachment.bin>


More information about the llvm-commits mailing list