[llvm] [AMDGPU][GISel] Add regbank-aware same_val_zero fold to AMDGPURegBankCombiner (PR #225138)

Chinmay Deshpande via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 13:51:47 PDT 2026


================
@@ -204,6 +204,17 @@ def zext_of_shift_amount_combines : GICombineGroup<[
   canonicalize_zext_lshr, canonicalize_zext_ashr, canonicalize_zext_shl
 ]>;
 
+// Fold (xor x, x) -> 0 and (sub x, x) -> 0.
----------------
chinmaydd wrote:

Why cant we fix the generic rule to handle this ?

Also, needs handling for vector types

https://github.com/llvm/llvm-project/pull/225138


More information about the llvm-commits mailing list