diff options
author | Nikita Popov <npopov@redhat.com> | 2022-05-17 15:45:52 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2022-06-28 10:40:17 +0200 |
commit | 5548e807b5777fdda167b6795e0e05432a6163f1 (patch) | |
tree | 9f69c8fa4f86aff55e52e531cfbd0637d1289160 /llvm/lib/IR/Core.cpp | |
parent | ab7218277c801836eb700626bc4aebf47dd2095b (diff) | |
download | llvm-5548e807b5777fdda167b6795e0e05432a6163f1.zip llvm-5548e807b5777fdda167b6795e0e05432a6163f1.tar.gz llvm-5548e807b5777fdda167b6795e0e05432a6163f1.tar.bz2 |
[IR] Remove support for extractvalue constant expression
This removes the extractvalue constant expression, as part of
https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179.
extractvalue is already not supported in bitcode, so we do not need
to worry about bitcode auto-upgrade.
Uses of ConstantExpr::getExtractValue() should be replaced with
IRBuilder::CreateExtractValue() (if the fact that the result is
constant is not important) or ConstantFoldExtractValueInstruction()
(if it is). Though for this particular case, it is also possible
and usually preferable to use getAggregateElement() instead.
The C API function LLVMConstExtractValue() is removed, as the
underlying constant expression no longer exists. Instead,
LLVMBuildExtractValue() should be used (which will constant fold
or create an instruction). Depending on the use-case,
LLVMGetAggregateElement() may also be used instead.
Differential Revision: https://reviews.llvm.org/D125795
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r-- | llvm/lib/IR/Core.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp index 5f6b2ef..4b9189c 100644 --- a/llvm/lib/IR/Core.cpp +++ b/llvm/lib/IR/Core.cpp @@ -1875,12 +1875,6 @@ LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorAConstant, IntMask)); } -LLVMValueRef LLVMConstExtractValue(LLVMValueRef AggConstant, unsigned *IdxList, - unsigned NumIdx) { - return wrap(ConstantExpr::getExtractValue(unwrap<Constant>(AggConstant), - makeArrayRef(IdxList, NumIdx))); -} - LLVMValueRef LLVMConstInsertValue(LLVMValueRef AggConstant, LLVMValueRef ElementValueConstant, unsigned *IdxList, unsigned NumIdx) { |