@@ -430,12 +430,6 @@ def binop_right_undef_to_undef: GICombineRule<
430430 [{ return Helper.matchOperandIsUndef(*${root}, 2); }]),
431431 (apply [{ Helper.replaceInstWithUndef(*${root}); }])>;
432432
433- def binop_right_poison_to_poison
434- : GICombineRule<(defs root:$root),
435- (match(wip_match_opcode G_SHL, G_ASHR, G_LSHR):$root,
436- [{ return Helper.matchOperandIsPoison(*${root}, 2); }]),
437- (apply [{ Helper.replaceInstWithPoison(*${root}); }])>;
438-
439433def unary_undef_to_zero: GICombineRule<
440434 (defs root:$root),
441435 (match (wip_match_opcode G_ABS):$root,
@@ -453,17 +447,6 @@ def unary_undef_to_undef : GICombineRule<
453447 (match (unary_undef_to_undef_frags $dst)),
454448 (apply [{ Helper.replaceInstWithUndef(*${dst}.getParent()); }])>;
455449
456- def unary_poison_to_poison_frags
457- : GICombinePatFrag<(outs root:$dst), (ins),
458- !foreach(op,
459- [G_TRUNC, G_BITCAST, G_ANYEXT, G_PTRTOINT,
460- G_INTTOPTR, G_FPTOSI, G_FPTOUI],
461- (pattern(op $dst, $x), (G_POISON $x)))>;
462- def unary_poison_to_poison
463- : GICombineRule<
464- (defs root:$dst), (match(unary_poison_to_poison_frags $dst)),
465- (apply [{ Helper.replaceInstWithPoison(*${dst}.getParent()); }])>;
466-
467450// Instructions where if any source operand is undef, the instruction can be
468451// replaced with undef.
469452def propagate_undef_any_op: GICombineRule<
@@ -472,15 +455,6 @@ def propagate_undef_any_op: GICombineRule<
472455 [{ return Helper.matchAnyExplicitUseIsUndef(*${root}); }]),
473456 (apply [{ Helper.replaceInstWithUndef(*${root}); }])>;
474457
475- // Instructions where if any source operand is poison, the instruction can be
476- // replaced with poison.
477- def propagate_poison_any_op
478- : GICombineRule<
479- (defs root:$root),
480- (match(wip_match_opcode G_ADD, G_SUB, G_XOR):$root,
481- [{ return Helper.matchAnyExplicitUseIsPoison(*${root}); }]),
482- (apply [{ Helper.replaceInstWithPoison(*${root}); }])>;
483-
484458// Instructions where if all source operands are undef, the instruction can be
485459// replaced with undef.
486460def propagate_undef_all_ops: GICombineRule<
@@ -489,15 +463,6 @@ def propagate_undef_all_ops: GICombineRule<
489463 [{ return Helper.matchAllExplicitUsesAreUndef(*${root}); }]),
490464 (apply [{ Helper.replaceInstWithUndef(*${root}); }])>;
491465
492- // Instructions where if all source operands are poison, the instruction can be
493- // replaced with poison.
494- def propagate_poison_all_ops
495- : GICombineRule<
496- (defs root:$root),
497- (match(wip_match_opcode G_SHUFFLE_VECTOR, G_BUILD_VECTOR):$root,
498- [{ return Helper.matchAllExplicitUsesArePoison(*${root}); }]),
499- (apply [{ Helper.replaceInstWithPoison(*${root}); }])>;
500-
501466// Replace a G_SHUFFLE_VECTOR with an undef mask with a G_IMPLICIT_DEF.
502467def propagate_undef_shuffle_mask: GICombineRule<
503468 (defs root:$root),
@@ -689,13 +654,6 @@ def erase_undef_store : GICombineRule<
689654 (apply [{ Helper.eraseInst(*${root}); }])
690655>;
691656
692- // Erase stores of poison values.
693- def erase_poison_store
694- : GICombineRule<(defs root:$root),
695- (match(wip_match_opcode G_STORE):$root,
696- [{ return Helper.matchPoisonStore(*${root}); }]),
697- (apply [{ Helper.eraseInst(*${root}); }])>;
698-
699657def simplify_add_to_sub_matchinfo: GIDefMatchData<"std::tuple<Register, Register>">;
700658def simplify_add_to_sub: GICombineRule <
701659 (defs root:$root, simplify_add_to_sub_matchinfo:$info),
@@ -2023,11 +1981,6 @@ def undef_combines : GICombineGroup<[undef_to_fp_zero, undef_to_int_zero,
20231981 erase_undef_store,
20241982 insert_extract_vec_elt_out_of_bounds]>;
20251983
2026- def poison_combines
2027- : GICombineGroup<[binop_right_poison_to_poison, unary_poison_to_poison,
2028- propagate_poison_any_op, propagate_poison_all_ops,
2029- erase_poison_store]>;
2030-
20311984def identity_combines : GICombineGroup<[select_same_val, right_identity_zero,
20321985 binop_same_val, binop_left_to_zero,
20331986 binop_right_to_zero, p2i_to_i2p,
@@ -2083,7 +2036,7 @@ def all_combines : GICombineGroup<[integer_reassoc_combines, trivial_combines,
20832036 vector_ops_combines, freeze_combines, cast_combines,
20842037 insert_vec_elt_combines, extract_vec_elt_combines, combines_for_extload,
20852038 combine_extracted_vector_load,
2086- undef_combines, poison_combines, identity_combines, phi_combines,
2039+ undef_combines, identity_combines, phi_combines,
20872040 simplify_add_to_sub, hoist_logic_op_with_same_opcode_hands, shifts_too_big,
20882041 reassocs, ptr_add_immed_chain, cmp_combines,
20892042 shl_ashr_to_sext_inreg, neg_and_one_to_sext_inreg, sext_inreg_of_load,
0 commit comments