[PATCH] D95432: AMDGPU/GlobalISel: Combine uniform icmp with one use

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 15:58:15 PST 2021


arsenm added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp:76-77
+  Register Condition = getConditionOp(MI).getReg();
+  if (!isSgprRegBank(Condition) || !MRI.hasOneNonDBGUse(Condition))
+    return false;
+
----------------
I don't think this really needs a one use check. Consider the case where another use already exists without the intermediate casts:

%x:s32 = G_ICMP
%y:s1 = G_TRUNC %x
%z:s32 = G_ZEXT %y
%select0 = G_SELECT %x
%select1 = G_SELECT %z


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95432/new/

https://reviews.llvm.org/D95432



More information about the llvm-commits mailing list