[llvm] [X86] Convert FP compares split by a nested logic op to FP logic (PR #226222)

Tim Besard via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 2 05:44:21 PDT 2026


================
@@ -52669,6 +52688,73 @@ static SDValue convertIntLogicToFPLogic(unsigned Opc, const SDLoc &DL, EVT VT,
   assert((Opc == ISD::OR || Opc == ISD::AND || Opc == ISD::XOR) &&
          "Unexpected bit opcode");
 
+  using namespace SDPatternMatch;
+  auto IsLegalFPType = [&](EVT FPVT) {
+    return (Subtarget.hasSSE1() && FPVT == MVT::f32) ||
+           (Subtarget.hasSSE2() && FPVT == MVT::f64) ||
+           (Subtarget.hasFP16() && FPVT == MVT::f16);
----------------
maleadt wrote:

There's only the packed VCMPBF16, and scalar bf16 compares are promoted to f32 today. It needs some extra lowering work, so maybe also better suited for a follow up?

https://github.com/llvm/llvm-project/pull/226222


More information about the llvm-commits mailing list