diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -7067,6 +7067,10 @@ ConstantFPSDNode *CFP = cast(Op); const APFloat &FPVal = CFP->getValueAPF(); + // This also covers armv6-M Execute Only, as armv6-M doesn't have an FPU + if (!ST->hasVFP3Base()) + return SDValue(); + // Prevent floating-point constants from using literal loads // when execute-only is enabled. if (ST->genExecuteOnly()) { @@ -7091,9 +7095,6 @@ } } - if (!ST->hasVFP3Base()) - return SDValue(); - // Use the default (constant pool) lowering for double constants when we have // an SP-only FPU if (IsDouble && !Subtarget->hasFP64())