[llvm] [BPF] TableGen-erate SDNode descriptions (PR #166499)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 20:34:33 PST 2025


yonghong-song wrote:

> > Do you know why we do not have problems before for BR_CC/MRMCPY?
> 
> SelectionDAG is very permissive about such inconsistencies. Fixing it to be more robust is my end goal.
> 
> > Looks like WASM is correct and the other three need update...
> 
> LanaiISD::BR_CC uses SDNPInGlue because it "glues" a comparison to the branch. In BPF comparison and branch a fused into one BPFISD::BR_CC node (same as LoongArch).
> 
> ARMISD::MEMCPY is indeed incorrect in that it shouldn't have SDNPInGlue. I'm not sure if it needs an out glue, but at least its presence is consistent with C++ code.
> 
> Whether or not to use glue operands/results is really target-dependent.

But for BPFmemcpy, currently we have
```
def BPFmemcpy       : SDNode<"BPFISD::MEMCPY", SDT_BPFMEMCPY,
                             [SDNPHasChain, SDNPInGlue, SDNPOutGlue,
                              SDNPMayStore, SDNPMayLoad]>;
```
It is used in custom inserter:

```
let usesCustomInserter = 1, isCodeGenOnly = 1 in {
    def MEMCPY : Pseudo<
      (outs),
      (ins GPR:$dst, GPR:$src, i64imm:$len, i64imm:$align, variable_ops),
      "#memcpy dst: $dst, src: $src, len: $len, align: $align",
      [(BPFmemcpy GPR:$dst, GPR:$src, imm:$len, imm:$align)]>;
} 
```

This patch only removes SNDPInGlue, I think we should remove SNDPOutGlue as well. WDYT?



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


More information about the llvm-commits mailing list