diff options
author | David Green <david.green@arm.com> | 2024-08-24 14:39:20 +0100 |
---|---|---|
committer | David Green <david.green@arm.com> | 2024-08-24 14:39:20 +0100 |
commit | 83a5c7cb62e404a713a35445b755cf0109650279 (patch) | |
tree | 4b7e02d5a4d18f94be27daea72ffd6c9a6836b76 /llvm/lib/Analysis/ConstantFolding.cpp | |
parent | 40975da950c95124155b752cd683d945f7d203fd (diff) | |
download | llvm-83a5c7cb62e404a713a35445b755cf0109650279.zip llvm-83a5c7cb62e404a713a35445b755cf0109650279.tar.gz llvm-83a5c7cb62e404a713a35445b755cf0109650279.tar.bz2 |
[ConstantFolding] Ensure TLI is valid when simplifying fp128 intrinsics.
TLI might not be valid for all contexts that constant folding is performed. Add
a quick guard that it is not null.
Diffstat (limited to 'llvm/lib/Analysis/ConstantFolding.cpp')
-rw-r--r-- | llvm/lib/Analysis/ConstantFolding.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp index 81c4d4e..26d9304 100644 --- a/llvm/lib/Analysis/ConstantFolding.cpp +++ b/llvm/lib/Analysis/ConstantFolding.cpp @@ -2140,7 +2140,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name, return GetConstantFoldFPValue128(Result, Ty); } LibFunc Fp128Func = NotLibFunc; - if (TLI->getLibFunc(Name, Fp128Func) && TLI->has(Fp128Func) && + if (TLI && TLI->getLibFunc(Name, Fp128Func) && TLI->has(Fp128Func) && Fp128Func == LibFunc_logl) return ConstantFoldFP128(logf128, Op->getValueAPF(), Ty); } |