diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-04-24 15:14:06 +0100 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2023-04-24 15:20:07 +0100 |
commit | 0b7f53efecb63659cbf4ebc2010a871e9b0121d3 (patch) | |
tree | ea6ed45702c578ddcadddcf2fd37478e80d27002 /llvm/lib/IR/IntrinsicInst.cpp | |
parent | f6657601629005cc9e488f159e310ae4008a25ea (diff) | |
download | llvm-0b7f53efecb63659cbf4ebc2010a871e9b0121d3.zip llvm-0b7f53efecb63659cbf4ebc2010a871e9b0121d3.tar.gz llvm-0b7f53efecb63659cbf4ebc2010a871e9b0121d3.tar.bz2 |
[VP] IR expansion for fabs/fsqrt/fma/fmadd
Add basic handling for VP ops that can expand to FP intrinsics
Fixes #60464
Differential Revision: https://reviews.llvm.org/D149052
Diffstat (limited to 'llvm/lib/IR/IntrinsicInst.cpp')
-rw-r--r-- | llvm/lib/IR/IntrinsicInst.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/IR/IntrinsicInst.cpp b/llvm/lib/IR/IntrinsicInst.cpp index 9270d70..36d5669 100644 --- a/llvm/lib/IR/IntrinsicInst.cpp +++ b/llvm/lib/IR/IntrinsicInst.cpp @@ -529,6 +529,20 @@ VPIntrinsic::getFunctionalOpcodeForVP(Intrinsic::ID ID) { return std::nullopt; } +// Equivalent non-predicated constrained intrinsic +std::optional<unsigned> +VPIntrinsic::getConstrainedIntrinsicIDForVP(Intrinsic::ID ID) { + switch (ID) { + default: + break; +#define BEGIN_REGISTER_VP_INTRINSIC(VPID, ...) case Intrinsic::VPID: +#define VP_PROPERTY_CONSTRAINEDFP(HASRND, HASEXCEPT, CID) return Intrinsic::CID; +#define END_REGISTER_VP_INTRINSIC(VPID) break; +#include "llvm/IR/VPIntrinsics.def" + } + return std::nullopt; +} + Intrinsic::ID VPIntrinsic::getForOpcode(unsigned IROPC) { switch (IROPC) { default: |