@@ -430,12 +430,6 @@ def binop_right_undef_to_undef: GICombineRule<
430
430
[{ return Helper.matchOperandIsUndef(*${root}, 2); }]),
431
431
(apply [{ Helper.replaceInstWithUndef(*${root}); }])>;
432
432
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
-
439
433
def unary_undef_to_zero: GICombineRule<
440
434
(defs root:$root),
441
435
(match (wip_match_opcode G_ABS):$root,
@@ -453,17 +447,6 @@ def unary_undef_to_undef : GICombineRule<
453
447
(match (unary_undef_to_undef_frags $dst)),
454
448
(apply [{ Helper.replaceInstWithUndef(*${dst}.getParent()); }])>;
455
449
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
-
467
450
// Instructions where if any source operand is undef, the instruction can be
468
451
// replaced with undef.
469
452
def propagate_undef_any_op: GICombineRule<
@@ -472,15 +455,6 @@ def propagate_undef_any_op: GICombineRule<
472
455
[{ return Helper.matchAnyExplicitUseIsUndef(*${root}); }]),
473
456
(apply [{ Helper.replaceInstWithUndef(*${root}); }])>;
474
457
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
-
484
458
// Instructions where if all source operands are undef, the instruction can be
485
459
// replaced with undef.
486
460
def propagate_undef_all_ops: GICombineRule<
@@ -489,15 +463,6 @@ def propagate_undef_all_ops: GICombineRule<
489
463
[{ return Helper.matchAllExplicitUsesAreUndef(*${root}); }]),
490
464
(apply [{ Helper.replaceInstWithUndef(*${root}); }])>;
491
465
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
-
501
466
// Replace a G_SHUFFLE_VECTOR with an undef mask with a G_IMPLICIT_DEF.
502
467
def propagate_undef_shuffle_mask: GICombineRule<
503
468
(defs root:$root),
@@ -689,13 +654,6 @@ def erase_undef_store : GICombineRule<
689
654
(apply [{ Helper.eraseInst(*${root}); }])
690
655
>;
691
656
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
-
699
657
def simplify_add_to_sub_matchinfo: GIDefMatchData<"std::tuple<Register, Register>">;
700
658
def simplify_add_to_sub: GICombineRule <
701
659
(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,
2023
1981
erase_undef_store,
2024
1982
insert_extract_vec_elt_out_of_bounds]>;
2025
1983
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
-
2031
1984
def identity_combines : GICombineGroup<[select_same_val, right_identity_zero,
2032
1985
binop_same_val, binop_left_to_zero,
2033
1986
binop_right_to_zero, p2i_to_i2p,
@@ -2083,7 +2036,7 @@ def all_combines : GICombineGroup<[integer_reassoc_combines, trivial_combines,
2083
2036
vector_ops_combines, freeze_combines, cast_combines,
2084
2037
insert_vec_elt_combines, extract_vec_elt_combines, combines_for_extload,
2085
2038
combine_extracted_vector_load,
2086
- undef_combines, poison_combines, identity_combines, phi_combines,
2039
+ undef_combines, identity_combines, phi_combines,
2087
2040
simplify_add_to_sub, hoist_logic_op_with_same_opcode_hands, shifts_too_big,
2088
2041
reassocs, ptr_add_immed_chain, cmp_combines,
2089
2042
shl_ashr_to_sext_inreg, neg_and_one_to_sext_inreg, sext_inreg_of_load,
0 commit comments