File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
llvm/include/llvm/Target/GlobalISel Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff 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)))>;
400405def shift_of_trunc_of_shift_matchdata : GIDefMatchData<"ShiftOfTruncOfShift">;
401406def 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
You can’t perform that action at this time.
0 commit comments