[llvm] [GlobalISel] Migrate remaining generic wip_match_opcode combines to MIR-pattern. (PR #222851)
Yaxun Liu via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 11 07:16:29 PDT 2026
================
@@ -572,3 +572,14 @@ bool AMDGPUCombinerHelper::matchConstantIs32BitMask(Register Reg) const {
// Check if low 32 bits or high 32 bits are all ones.
return MaskLen >= 32 && ((MaskIdx == 0) || (MaskIdx == 64 - MaskLen));
}
+
+bool AMDGPUCombinerHelper::matchBinopWith32BitMask(Register X,
+ Register Y) const {
+ // If both operands are constants, constant_fold_binop can fold the whole
----------------
yxsamliu wrote:
Could you add `G_AND` and `G_OR` tests where both operands are constants? They should confirm that this bailout lets `constant_fold_binop` produce one `G_CONSTANT`.
https://github.com/llvm/llvm-project/pull/222851
More information about the llvm-commits
mailing list