diff options
author | Paul Walker <paul.walker@arm.com> | 2024-05-07 11:23:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-07 11:23:55 +0100 |
commit | 235cea720c0fa6dcf0bf5aff15001de88b6042f9 (patch) | |
tree | 71e356866162e7e6783045f7ef22161329c5f768 /llvm/lib/Transforms/Utils/CloneFunction.cpp | |
parent | e232659028365b51feb001565884b3b8e62cc2a9 (diff) | |
download | llvm-235cea720c0fa6dcf0bf5aff15001de88b6042f9.zip llvm-235cea720c0fa6dcf0bf5aff15001de88b6042f9.tar.gz llvm-235cea720c0fa6dcf0bf5aff15001de88b6042f9.tar.bz2 |
[NFC][LLVM] Refactor rounding mode detection of constrained fp intrinsic IDs (#90854)
I've refactored the code to genericise the implementation to better
allow for target specific constrained fp intrinsics.
Diffstat (limited to 'llvm/lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/CloneFunction.cpp | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/llvm/lib/Transforms/Utils/CloneFunction.cpp b/llvm/lib/Transforms/Utils/CloneFunction.cpp index 6f6dc63..6a3b3fa 100644 --- a/llvm/lib/Transforms/Utils/CloneFunction.cpp +++ b/llvm/lib/Transforms/Utils/CloneFunction.cpp @@ -386,18 +386,6 @@ public: }; } // namespace -static bool hasRoundingModeOperand(Intrinsic::ID CIID) { - switch (CIID) { -#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \ - case Intrinsic::INTRINSIC: \ - return ROUND_MODE == 1; -#define FUNCTION INSTRUCTION -#include "llvm/IR/ConstrainedOps.def" - default: - llvm_unreachable("Unexpected constrained intrinsic id"); - } -} - Instruction * PruningFunctionCloner::cloneInstruction(BasicBlock::const_iterator II) { const Instruction &OldInst = *II; @@ -455,7 +443,7 @@ PruningFunctionCloner::cloneInstruction(BasicBlock::const_iterator II) { // The last arguments of a constrained intrinsic are metadata that // represent rounding mode (absents in some intrinsics) and exception // behavior. The inlined function uses default settings. - if (hasRoundingModeOperand(CIID)) + if (Intrinsic::hasConstrainedFPRoundingModeOperand(CIID)) Args.push_back( MetadataAsValue::get(Ctx, MDString::get(Ctx, "round.tonearest"))); Args.push_back( |