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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 12 00:13:50 PST 2024


================
@@ -3062,6 +3068,25 @@ static bool isCttzOpc(unsigned Opc) {
   return Opc == ISD::CTTZ || Opc == ISD::CTTZ_ZERO_UNDEF;
 }
 
+void AMDGPUTargetLowering::replaceCTLZResults(
+    SDValue Op, SelectionDAG &DAG, SmallVectorImpl<SDValue> &Results) const {
+  auto SL = SDLoc(Op);
+  auto Arg = Op.getOperand(0u);
+  auto ResultVT = Op.getValueType();
+
+  if (ResultVT != MVT::i8)
----------------
arsenm wrote:

You will see the same issue for i16 for targets where i16 is not legal. e.g. -mcpu=hawaii 

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


More information about the llvm-commits mailing list