[llvm] [SDAG] Use shifts if ISD::MUL is illegal when lowering ISD::CTPOP (PR #86505)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 28 06:39:43 PDT 2024
================
@@ -6365,7 +6365,12 @@ LegalizerHelper::lowerBitCount(MachineInstr &MI) {
// Shift count result from 8 high bits to low bits.
auto C_SizeM8 = B.buildConstant(Ty, Size - 8);
- if (isSupported({TargetOpcode::G_MUL, {Ty, Ty}})) {
+
+ auto IsMulSupported = [this](const LLT Ty) {
+ auto Action = LI.getAction({TargetOpcode::G_MUL, {Ty, Ty}}).Action;
----------------
arsenm wrote:
Mul only has a single type index
```suggestion
auto Action = LI.getAction({TargetOpcode::G_MUL, {Ty}}).Action;
```
https://github.com/llvm/llvm-project/pull/86505
More information about the llvm-commits
mailing list