[llvm] [SandboxIR] Implement UnaryInstruction class (PR #101541)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 1 12:03:43 PDT 2024
aeubanks wrote:
> > I'm not sure this is useful. UnaryInstruction doesn't expose any new common methods for people to use,
>
> Yeah it's not super useful, but it is another way to check if an instruction has a single operand. I don't feel too strongly about keeping though. On the other hand it's not a huge burden to add it in either. There are just a handful of instructions that inherit from it.
Having multiple ways of checking if an instruction has a single operand is worse than just having one way, and checking if an instruction has exactly one operand doesn't seem super useful/generic. Any code we can avoid adding is good.
> It makes SandboxIR closer to LLVM-IR.
Sure but it's really just used as an internal implementation detail to share some allocation code. There are some places throughout LLVM that check for UnaryInstruction, but there are better ways to do what they want to do.
https://github.com/llvm/llvm-project/pull/101541
More information about the llvm-commits
mailing list