Skip to content

Commit 74bcf6c

Browse files
committed
re,ove wip_match_opcode from GICombineRule
1 parent 4187949 commit 74bcf6c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

llvm/include/llvm/Target/GlobalISel/Combine.td

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,10 +397,15 @@ def commute_shift : GICombineRule<
397397
(apply [{ Helper.applyBuildFn(*${d}, ${matchinfo}); }])>;
398398

399399
// Fold (shift (trunc (shift x, C1)), C2) -> trunc (shift x, (C1 + C2))
400+
def shift_right_op : GICombinePatFrag<
401+
(outs root:$dst), (ins),
402+
!foreach(op,
403+
[G_LSHR, G_ASHR],
404+
(pattern (op $dst, $shifted, $amt)))>;
400405
def shift_of_trunc_of_shift_matchdata : GIDefMatchData<"ShiftOfTruncOfShift">;
401406
def shift_of_trunc_of_shift : GICombineRule<
402-
(defs root:$root, shift_of_trunc_of_shift_matchdata:$matchinfo),
403-
(match (wip_match_opcode G_LSHR, G_ASHR):$root,
407+
(defs root:$dst, shift_of_trunc_of_shift_matchdata:$matchinfo),
408+
(match (shift_right_op $dst):$root,
404409
[{ return Helper.matchShiftOfTruncOfShift(*${root}, ${matchinfo}); }]),
405410
(apply [{ Helper.applyShiftOfTruncOfShift(*${root}, ${matchinfo}); }])>;
406411

0 commit comments

Comments
 (0)