LLVM 21 compatible computeKnownFPClass
The signature for `computeKnownFPClass` changed with LLVM 21, so this commit includes a conditional compilation which is compatible.
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
#if LLVM_VERSION_MAJOR >= 21
|
#if LLVM_VERSION_MAJOR >= 21
|
||||||
#include "llvm/Support/KnownFPClass.h"
|
#include "llvm/Support/KnownFPClass.h"
|
||||||
#endif
|
#endif
|
||||||
|
#include "llvm/Analysis/SimplifyQuery.h"
|
||||||
#include "llvm/Analysis/ConstantFolding.h"
|
#include "llvm/Analysis/ConstantFolding.h"
|
||||||
#include "llvm/Analysis/ValueTracking.h"
|
#include "llvm/Analysis/ValueTracking.h"
|
||||||
#include "llvm/IR/IntrinsicsX86.h"
|
#include "llvm/IR/IntrinsicsX86.h"
|
||||||
@@ -4286,7 +4287,13 @@ template <typename T1, typename T2, typename T3>
|
|||||||
llvm::KnownFPClass get_known_fp_class(T a, llvm::FPClassTest interested_classes)
|
llvm::KnownFPClass get_known_fp_class(T a, llvm::FPClassTest interested_classes)
|
||||||
{
|
{
|
||||||
static_assert(depth <= llvm::MaxAnalysisRecursionDepth, "Depth parameter can only decrease search. Default is max.");
|
static_assert(depth <= llvm::MaxAnalysisRecursionDepth, "Depth parameter can only decrease search. Default is max.");
|
||||||
|
|
||||||
|
#if LLVM_MAJOR_VERSION >= 21
|
||||||
|
const llvm::SimplifyQuery SQ(m_module->getDataLayout());
|
||||||
|
return llvm::computeKnownFPClass(a.eval(m_ir), interested_classes, SQ, llvm::MaxAnalysisRecursionDepth - depth);
|
||||||
|
#else
|
||||||
return llvm::computeKnownFPClass(a.eval(m_ir), m_module->getDataLayout(), interested_classes, llvm::MaxAnalysisRecursionDepth - depth);
|
return llvm::computeKnownFPClass(a.eval(m_ir), m_module->getDataLayout(), interested_classes, llvm::MaxAnalysisRecursionDepth - depth);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Reference in New Issue
Block a user