Revert "[AArch64][GlobalISel] Legalize ctpop s128"
This reverts commit 97e95fea53fc403c2a12e356dc835fc922123575.
It broke test/CodeGen/Mips/GlobalISel/llvm-ir/ctpop.ll. Not sure why I didn't see that.
diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
index 8286f4f..38b2b23 100644
--- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
@@ -5656,15 +5656,7 @@
auto LoCTPOP = MIRBuilder.buildCTPOP(DstTy, UnmergeSrc.getReg(0));
auto HiCTPOP = MIRBuilder.buildCTPOP(DstTy, UnmergeSrc.getReg(1));
-
- LLT CountTy = LLT::scalar(Log2_64_Ceil(SrcTy.getSizeInBits()));
- if (CountTy.getSizeInBits() < DstTy.getSizeInBits()) {
- LoCTPOP = MIRBuilder.buildTrunc(CountTy, LoCTPOP);
- HiCTPOP = MIRBuilder.buildTrunc(CountTy, HiCTPOP);
- auto Add = MIRBuilder.buildAdd(CountTy, HiCTPOP, LoCTPOP);
- MIRBuilder.buildZExt(DstReg, Add);
- } else
- MIRBuilder.buildAdd(DstReg, HiCTPOP, LoCTPOP);
+ MIRBuilder.buildAdd(DstReg, HiCTPOP, LoCTPOP);
MI.eraseFromParent();
return Legalized;