Index: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp =================================================================== --- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -7103,6 +7103,18 @@ } } + Value *CanonLHS, *CanonRHS; + if (match(Op0, m_Intrinsic(m_Value(CanonLHS)))) { + if (CanonLHS == Op1) { + // (canonicalize(x) == x) => (x == x) + return new FCmpInst(Pred, Op1, Op1, "", &I); + } + + // (canonicalize(x) == canonicalize(y)) => (x == y) + if (match(Op1, m_Intrinsic(m_Value(CanonRHS)))) + return new FCmpInst(Pred, CanonLHS, CanonRHS, "", &I); + } + if (I.getType()->isVectorTy()) if (Instruction *Res = foldVectorCmp(I, Builder)) return Res; Index: llvm/test/Transforms/InstCombine/canonicalize.ll =================================================================== --- llvm/test/Transforms/InstCombine/canonicalize.ll +++ llvm/test/Transforms/InstCombine/canonicalize.ll @@ -7,9 +7,7 @@ define i1 @canonicalize_oeq_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_oeq_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -20,9 +18,7 @@ define i1 @canonicalize_oeq_canonicalize_f32_flags(float %x, float %y) { ; CHECK-LABEL: @canonicalize_oeq_canonicalize_f32_flags( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp nsz oeq float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp nsz oeq float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -33,9 +29,7 @@ define <2 x i1> @canonicalize_oeq_canonicalize_v2f32(<2 x float> %x, <2 x float> %y) { ; CHECK-LABEL: @canonicalize_oeq_canonicalize_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq <2 x float> [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq <2 x float> [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) @@ -46,9 +40,7 @@ define i1 @canonicalize_ueq_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_ueq_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -59,9 +51,7 @@ define <2 x i1> @canonicalize_ueq_canonicalize_v2f32(<2 x float> %x, <2 x float> %y) { ; CHECK-LABEL: @canonicalize_ueq_canonicalize_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq <2 x float> [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq <2 x float> [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) @@ -72,9 +62,7 @@ define i1 @canonicalize_one_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_one_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -85,9 +73,7 @@ define <2 x i1> @canonicalize_one_canonicalize_v2f32(<2 x float> %x, <2 x float> %y) { ; CHECK-LABEL: @canonicalize_one_canonicalize_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp one <2 x float> [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp one <2 x float> [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) @@ -98,9 +84,7 @@ define i1 @canonicalize_une_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_une_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -111,9 +95,7 @@ define <2 x i1> @canonicalize_une_canonicalize_v2f32(<2 x float> %x, <2 x float> %y) { ; CHECK-LABEL: @canonicalize_une_canonicalize_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp une <2 x float> [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp une <2 x float> [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) @@ -124,9 +106,7 @@ define i1 @canonicalize_ogt_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_ogt_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -137,9 +117,7 @@ define i1 @canonicalize_oge_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_oge_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -150,9 +128,7 @@ define i1 @canonicalize_olt_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_olt_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -163,9 +139,7 @@ define i1 @canonicalize_ole_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_ole_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -176,9 +150,7 @@ define i1 @canonicalize_ord_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_ord_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -189,9 +161,7 @@ define i1 @canonicalize_ugt_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_ugt_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -202,9 +172,7 @@ define i1 @canonicalize_uge_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_uge_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -215,9 +183,7 @@ define i1 @canonicalize_ult_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_ult_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -228,9 +194,7 @@ define i1 @canonicalize_ule_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_ule_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -241,9 +205,7 @@ define i1 @canonicalize_uno_canonicalize_f32(float %x, float %y) { ; CHECK-LABEL: @canonicalize_uno_canonicalize_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CANON_Y:%.*]] = call float @llvm.canonicalize.f32(float [[Y:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[CANON_X]], [[CANON_Y]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[X:%.*]], [[Y:%.*]] ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -258,8 +220,7 @@ define i1 @canonicalize_oeq_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_oeq_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -269,8 +230,7 @@ define i1 @canonicalize_oeq_arg_f32_flags(float %x) { ; CHECK-LABEL: @canonicalize_oeq_arg_f32_flags( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp nsz oeq float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp nsz ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -280,8 +240,7 @@ define i1 @canonicalize_oeq_arg_f32_commute(float %x) { ; CHECK-LABEL: @canonicalize_oeq_arg_f32_commute( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -291,8 +250,7 @@ define <2 x i1> @canonicalize_oeq_arg_v2f32(<2 x float> %x) { ; CHECK-LABEL: @canonicalize_oeq_arg_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq <2 x float> [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord <2 x float> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) @@ -302,8 +260,7 @@ define <2 x i1> @canonicalize_oeq_arg_v2f32_commute(<2 x float> %x) { ; CHECK-LABEL: @canonicalize_oeq_arg_v2f32_commute( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq <2 x float> [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord <2 x float> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) @@ -313,9 +270,7 @@ define i1 @canonicalize_ueq_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_ueq_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[CANON_X]], [[X]] -; CHECK-NEXT: ret i1 [[CMP]] +; CHECK-NEXT: ret i1 true ; %canon.x = call float @llvm.canonicalize.f32(float %x) %cmp = fcmp ueq float %canon.x, %x @@ -324,9 +279,7 @@ define <2 x i1> @canonicalize_ueq_arg_v2f32(<2 x float> %x) { ; CHECK-LABEL: @canonicalize_ueq_arg_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq <2 x float> [[CANON_X]], [[X]] -; CHECK-NEXT: ret <2 x i1> [[CMP]] +; CHECK-NEXT: ret <2 x i1> ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) %cmp = fcmp ueq <2 x float> %canon.x, %x @@ -335,9 +288,7 @@ define i1 @canonicalize_one_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_one_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[CANON_X]], [[X]] -; CHECK-NEXT: ret i1 [[CMP]] +; CHECK-NEXT: ret i1 false ; %canon.x = call float @llvm.canonicalize.f32(float %x) %cmp = fcmp one float %canon.x, %x @@ -346,9 +297,7 @@ define <2 x i1> @canonicalize_one_arg_v2f32(<2 x float> %x) { ; CHECK-LABEL: @canonicalize_one_arg_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp one <2 x float> [[CANON_X]], [[X]] -; CHECK-NEXT: ret <2 x i1> [[CMP]] +; CHECK-NEXT: ret <2 x i1> zeroinitializer ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) %cmp = fcmp one <2 x float> %canon.x, %x @@ -357,8 +306,7 @@ define i1 @canonicalize_une_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_une_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -368,8 +316,7 @@ define <2 x i1> @canonicalize_une_arg_v2f32(<2 x float> %x) { ; CHECK-LABEL: @canonicalize_une_arg_v2f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp une <2 x float> [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp uno <2 x float> [[X:%.*]], zeroinitializer ; CHECK-NEXT: ret <2 x i1> [[CMP]] ; %canon.x = call <2 x float> @llvm.canonicalize.v2f32(<2 x float> %x) @@ -379,9 +326,7 @@ define i1 @canonicalize_ogt_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_ogt_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[CANON_X]], [[X]] -; CHECK-NEXT: ret i1 [[CMP]] +; CHECK-NEXT: ret i1 false ; %canon.x = call float @llvm.canonicalize.f32(float %x) %cmp = fcmp ogt float %canon.x, %x @@ -390,8 +335,7 @@ define i1 @canonicalize_oge_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_oge_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -401,9 +345,7 @@ define i1 @canonicalize_olt_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_olt_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[CANON_X]], [[X]] -; CHECK-NEXT: ret i1 [[CMP]] +; CHECK-NEXT: ret i1 false ; %canon.x = call float @llvm.canonicalize.f32(float %x) %cmp = fcmp olt float %canon.x, %x @@ -412,8 +354,7 @@ define i1 @canonicalize_ole_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_ole_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -423,8 +364,7 @@ define i1 @canonicalize_ord_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_ord_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -434,8 +374,7 @@ define i1 @canonicalize_ugt_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_ugt_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -445,9 +384,7 @@ define i1 @canonicalize_uge_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_uge_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[CANON_X]], [[X]] -; CHECK-NEXT: ret i1 [[CMP]] +; CHECK-NEXT: ret i1 true ; %canon.x = call float @llvm.canonicalize.f32(float %x) %cmp = fcmp uge float %canon.x, %x @@ -456,8 +393,7 @@ define i1 @canonicalize_ult_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_ult_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x) @@ -467,9 +403,7 @@ define i1 @canonicalize_ule_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_ule_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[CANON_X]], [[X]] -; CHECK-NEXT: ret i1 [[CMP]] +; CHECK-NEXT: ret i1 true ; %canon.x = call float @llvm.canonicalize.f32(float %x) %cmp = fcmp ule float %canon.x, %x @@ -478,8 +412,7 @@ define i1 @canonicalize_uno_arg_f32(float %x) { ; CHECK-LABEL: @canonicalize_uno_arg_f32( -; CHECK-NEXT: [[CANON_X:%.*]] = call float @llvm.canonicalize.f32(float [[X:%.*]]) -; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[CANON_X]], [[X]] +; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[X:%.*]], 0.000000e+00 ; CHECK-NEXT: ret i1 [[CMP]] ; %canon.x = call float @llvm.canonicalize.f32(float %x)