aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2023-06-09 18:23:03 -0400
committerMatt Arsenault <Matthew.Arsenault@amd.com>2023-06-09 19:09:48 -0400
commit19293b82c180660de9636ebe8caa01fe797fb388 (patch)
treed4735cbc5485105a2549fcb99fa3c932b9c5b68d /llvm/lib/IR/Attributes.cpp
parentd0b9cb1f659ffe327acae57be7e1b40473b12b4d (diff)
downloadllvm-19293b82c180660de9636ebe8caa01fe797fb388.zip
llvm-19293b82c180660de9636ebe8caa01fe797fb388.tar.gz
llvm-19293b82c180660de9636ebe8caa01fe797fb388.tar.bz2
Inline: Fix case of not inlining with denormal-fp-math-f32
This was failing to inline the opencl libraries with daz enabled. As a modifier to the base mode, denormal-fp-mode-f32 is weird and has no meaning if it's missing.
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index c1c4c0f..ace23f3 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -2026,6 +2026,10 @@ static bool checkDenormMode(const Function &Caller, const Function &Callee) {
if (denormModeCompatible(CallerMode, CalleeMode)) {
DenormalMode CallerModeF32 = Caller.getDenormalModeF32Raw();
DenormalMode CalleeModeF32 = Callee.getDenormalModeF32Raw();
+ if (CallerModeF32 == DenormalMode::getInvalid())
+ CallerModeF32 = CallerMode;
+ if (CalleeModeF32 == DenormalMode::getInvalid())
+ CalleeModeF32 = CalleeMode;
return denormModeCompatible(CallerModeF32, CalleeModeF32);
}