[llvm] [AMDGPU] Remove unnecessary add instructions in ctlz.i8 (PR #77615)

Leon Clark via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 08:59:20 PST 2024


================
@@ -3062,6 +3071,26 @@ static bool isCttzOpc(unsigned Opc) {
   return Opc == ISD::CTTZ || Opc == ISD::CTTZ_ZERO_UNDEF;
 }
 
+SDValue AMDGPUTargetLowering::lowerCTLZResults(SDValue Op,
+                                               SelectionDAG &DAG) const {
+  auto SL = SDLoc(Op);
+  auto Arg = Op.getOperand(0u);
+  auto ResultVT = Op.getValueType();
+
+  if (!(ResultVT == MVT::i8 || ResultVT == MVT::i16))
----------------
PeddleSpam wrote:

This function is also called for `ctlz.i64` since it's marked for custom lowering.

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


More information about the llvm-commits mailing list