Skip to content

Commit 3fbd8fd

Browse files
committed
[OpenMP] Simplify getFloatTypeSemantics
When the float point representations are the same on the host and on the target device, (`&Target->getLongDoubleFormat() == &AuxTarget->getLongDoubleFormat()`), we can just use `AuxTarget->getLongDoubleFormat()`. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D64423 llvm-svn: 365545
1 parent 2d73994 commit 3fbd8fd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

clang/lib/AST/ASTContext.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,13 +1525,11 @@ const llvm::fltSemantics &ASTContext::getFloatTypeSemantics(QualType T) const {
15251525
case BuiltinType::Float: return Target->getFloatFormat();
15261526
case BuiltinType::Double: return Target->getDoubleFormat();
15271527
case BuiltinType::LongDouble:
1528-
if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice &&
1529-
&Target->getLongDoubleFormat() != &AuxTarget->getLongDoubleFormat())
1528+
if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice)
15301529
return AuxTarget->getLongDoubleFormat();
15311530
return Target->getLongDoubleFormat();
15321531
case BuiltinType::Float128:
1533-
if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice &&
1534-
&Target->getFloat128Format() != &AuxTarget->getFloat128Format())
1532+
if (getLangOpts().OpenMP && getLangOpts().OpenMPIsDevice)
15351533
return AuxTarget->getFloat128Format();
15361534
return Target->getFloat128Format();
15371535
}

0 commit comments

Comments
 (0)