@@ -9392,7 +9392,9 @@ bool SelectionDAGBuilder::visitStrNLenCall(const CallInst &I) {
93929392bool SelectionDAGBuilder::visitUnaryFloatCall(const CallInst &I,
93939393 unsigned Opcode) {
93949394 // We already checked this call's prototype; verify it doesn't modify errno.
9395- if (!I.onlyReadsMemory())
9395+ // Do not perform optimizations for call sites that require strict
9396+ // floating-point semantics.
9397+ if (!I.onlyReadsMemory() || I.isStrictFP())
93969398 return false;
93979399
93989400 SDNodeFlags Flags;
@@ -9412,7 +9414,9 @@ bool SelectionDAGBuilder::visitUnaryFloatCall(const CallInst &I,
94129414bool SelectionDAGBuilder::visitBinaryFloatCall(const CallInst &I,
94139415 unsigned Opcode) {
94149416 // We already checked this call's prototype; verify it doesn't modify errno.
9415- if (!I.onlyReadsMemory())
9417+ // Do not perform optimizations for call sites that require strict
9418+ // floating-point semantics.
9419+ if (!I.onlyReadsMemory() || I.isStrictFP())
94169420 return false;
94179421
94189422 SDNodeFlags Flags;
@@ -9445,11 +9449,10 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
94459449
94469450 // Check for well-known libc/libm calls. If the function is internal, it
94479451 // can't be a library call. Don't do the check if marked as nobuiltin for
9448- // some reason or the call site requires strict floating point semantics .
9452+ // some reason.
94499453 LibFunc Func;
9450- if (!I.isNoBuiltin() && !I.isStrictFP() && !F->hasLocalLinkage() &&
9451- F->hasName() && LibInfo->getLibFunc(*F, Func) &&
9452- LibInfo->hasOptimizedCodeGen(Func)) {
9454+ if (!I.isNoBuiltin() && !F->hasLocalLinkage() && F->hasName() &&
9455+ LibInfo->getLibFunc(*F, Func) && LibInfo->hasOptimizedCodeGen(Func)) {
94539456 switch (Func) {
94549457 default: break;
94559458 case LibFunc_bcmp:
0 commit comments