[llvm] IR: de-duplicate two CmpInst routines (NFC) (PR #116866)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 19 12:40:12 PST 2024


artagnon wrote:

> I think it might make more sense to drop the methods on CmpInst instead? getSignedPredicate and getUnsignedPredicate only make sense for icmps, so I'd expect them to be on ICmpInst only. Or does that make usage awkward somehow?

I think we'd need extra downcasts in many places if we move them to ICmpInst. Besides, there are several functions that are specific to FCmpInst that are also in CmpInst, so I don't see the harm in having these here, and asserting appropriately.

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


More information about the llvm-commits mailing list