[llvm] [AMDGPU][GIsel][NPM] Port AMDGPUPostLegalizerCombiner to NPM (PR #216274)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 02:40:37 PDT 2026


================
@@ -442,11 +444,33 @@ bool AMDGPUPostLegalizerCombinerImpl::matchCombine_s_mul_u64(
 // Pass boilerplate
 // ================
 
-class AMDGPUPostLegalizerCombiner : public MachineFunctionPass {
+static bool
+runCombiner(MachineFunction &MF, GISelValueTracking *VT,
+            MachineDominatorTree *MDT,
+            const AMDGPUPostLegalizerCombinerImplRuleConfig &RuleConfig,
+            bool EnableOpt) {
+  const Function &F = MF.getFunction();
+  const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
+  const AMDGPULegalizerInfo *LI =
+      static_cast<const AMDGPULegalizerInfo *>(ST.getLegalizerInfo());
+
+  CombinerInfo CInfo(/*AllowIllegalOps*/ false, /*ShouldLegalizeIllegal*/ true,
+                     LI, EnableOpt, F.hasOptSize(), F.hasMinSize());
----------------
arsenm wrote:

```suggestion
  CombinerInfo CInfo(/*AllowIllegalOps=*/ false, /*ShouldLegalizeIllegal=*/ true,
                     LI, EnableOpt, F.hasOptSize(), F.hasMinSize());
```

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


More information about the llvm-commits mailing list