[PATCH] D125795: [IR] Remove support for extractvalue constant expression

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 08:01:07 PDT 2022


nikic added a comment.

In D125795#3598460 <https://reviews.llvm.org/D125795#3598460>, @nhaehnle wrote:

> I'm in favor of doing this, and the change looks mostly straightforward. However, I wonder if, since it is a breaking change in the C ABI, we shouldn't have at least one release cycle where `LLVMConstExtractValue` (and other functions that are planned to be removed) are marked as deprecated.

I don't think that's necessary. Per https://llvm.org/docs/DeveloperPolicy.html#c-api-changes C API stability is "best effort", presumably exactly for cases like this (the underlying functionality that is being exported simply no longer exists). I don't think unavoidable changes to the C API should hold back changes, especially as the impact on the C and C++ APIs is the same here. Of course, we should have a release note for the change, which I have now added.

Something we should consider though is whether we need to export any additional APIs -- and I think, in this case we probably should. Without LLVMConstExtractValue, there is no longer a good way to get an element from a constant aggregate. Weirdly, the C API does export the ConstantDataSequential-specific getElementAsConstant() method, but not the general getAggregateElement() method. We probably should export that one.

Less relevant for extractvalue, but possibly for other constant expressions, do we need to export any of the `ConstantFoldXYZ` APIs? Those would be the fallible replacements for `LLVMConstXYZ`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125795/new/

https://reviews.llvm.org/D125795



More information about the llvm-commits mailing list