llvm.org GIT mirror llvm / f4f832c
[ARM] GlobalISel: Fix oversight in G_FCMP legalization We used to forget to erase the original instruction when replacing a G_FCMP true/false. Fix this bug and make sure the tests check for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307639 91177308-0d34-0410-b5e6-96231b3b80d8 Diana Picus 3 years ago
2 changed file(s) with 9 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
294294 "Predicate needs libcalls, but none specified");
295295 MIRBuilder.buildConstant(OriginalResult,
296296 Predicate == CmpInst::FCMP_TRUE ? 1 : 0);
297 MI.eraseFromParent();
297298 return true;
298299 }
299300
336336 ; CHECK-DAG: [[Y:%[0-9]+]](s32) = COPY %r1
337337 %2(s1) = G_FCMP floatpred(true), %0(s32), %1
338338 ; HARD: [[R:%[0-9]+]](s1) = G_FCMP floatpred(true), [[X]](s32), [[Y]]
339 ; SOFT-NOT: G_FCMP
339340 ; SOFT: [[REXT:%[0-9]+]](s32) = G_CONSTANT i32 -1
340341 ; SOFT: [[R:%[0-9]+]](s1) = G_TRUNC [[REXT]](s32)
342 ; SOFT-NOT: G_FCMP
341343 %3(s32) = G_ZEXT %2(s1)
342344 ; CHECK: [[REXT:%[0-9]+]](s32) = G_ZEXT [[R]](s1)
343345 %r0 = COPY %3(s32)
367369 ; CHECK-DAG: [[Y:%[0-9]+]](s32) = COPY %r1
368370 %2(s1) = G_FCMP floatpred(false), %0(s32), %1
369371 ; HARD: [[R:%[0-9]+]](s1) = G_FCMP floatpred(false), [[X]](s32), [[Y]]
372 ; SOFT-NOT: G_FCMP
370373 ; SOFT: [[REXT:%[0-9]+]](s32) = G_CONSTANT i32 0
371374 ; SOFT: [[R:%[0-9]+]](s1) = G_TRUNC [[REXT]](s32)
375 ; SOFT-NOT: G_FCMP
372376 %3(s32) = G_ZEXT %2(s1)
373377 ; CHECK: [[REXT:%[0-9]+]](s32) = G_ZEXT [[R]](s1)
374378 %r0 = COPY %3(s32)
983987 ; HARD-DAG: [[Y:%[0-9]+]](s64) = G_MERGE_VALUES [[Y0]](s32), [[Y1]](s32)
984988 %6(s1) = G_FCMP floatpred(true), %4(s64), %5
985989 ; HARD: [[R:%[0-9]+]](s1) = G_FCMP floatpred(true), [[X]](s64), [[Y]]
990 ; SOFT-NOT: G_FCMP
986991 ; SOFT: [[REXT:%[0-9]+]](s32) = G_CONSTANT i32 -1
987992 ; SOFT: [[R:%[0-9]+]](s1) = G_TRUNC [[REXT]](s32)
993 ; SOFT-NOT: G_FCMP
988994 %7(s32) = G_ZEXT %6(s1)
989995 ; CHECK: [[REXT:%[0-9]+]](s32) = G_ZEXT [[R]](s1)
990996 %r0 = COPY %7(s32)
10261032 ; HARD-DAG: [[Y:%[0-9]+]](s64) = G_MERGE_VALUES [[Y0]](s32), [[Y1]](s32)
10271033 %6(s1) = G_FCMP floatpred(false), %4(s64), %5
10281034 ; HARD: [[R:%[0-9]+]](s1) = G_FCMP floatpred(false), [[X]](s64), [[Y]]
1035 ; SOFT-NOT: G_FCMP
10291036 ; SOFT: [[REXT:%[0-9]+]](s32) = G_CONSTANT i32 0
10301037 ; SOFT: [[R:%[0-9]+]](s1) = G_TRUNC [[REXT]](s32)
1038 ; SOFT-NOT: G_FCMP
10311039 %7(s32) = G_ZEXT %6(s1)
10321040 ; CHECK: [[REXT:%[0-9]+]](s32) = G_ZEXT [[R]](s1)
10331041 %r0 = COPY %7(s32)