[llvm-dev] Selection DAG chain question

Matt Arsenault via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 16 14:04:44 PDT 2020



> On Jul 16, 2020, at 17:00, Hendrik Greving <hgreving at google.com> wrote:
> 
> > No, non-sideeffecting operations can be legalized as compiler-rt calls
> 
> Right, but not as "regular" nodes with side-effects? I guess you could search and analyze the DAG manually but that seems hacky. Maybe something that one day LLVM could support natively.


You can’t add arbitrary chains or glue to the regular nodes, but you can define a custom node you select the same way with your chain/glue. You don’t need to preprocess the IR and can do in the custom lowering. This is what AMDGPU does for FDIV (see AMDGPUISD::FMA_W_CHAIN). GlobalISel avoids these complications by not having nodes or chains, and just instructions with side effects, so in that sense this is a solved problem.

-Matt


More information about the llvm-dev mailing list