mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 12:16:08 +00:00

This removes the insertvalue constant expression, as part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179. This is very similar to the extractvalue removal from D125795. insertvalue is also not supported in bitcode, so no auto-ugprade is necessary. ConstantExpr::getInsertValue() can be replaced with IRBuilder::CreateInsertValue() or ConstantFoldInsertValueInstruction(), depending on whether a constant result is required (with the latter being fallible). The ConstantExpr::hasIndices() and ConstantExpr::getIndices() methods also go away here, because there are no longer any constant expressions with indices. Differential Revision: https://reviews.llvm.org/D128719
16 lines
535 B
LLVM
16 lines
535 B
LLVM
; RUN: split-file %s %t
|
|
; RUN: not llvm-as < %t/extractvalue.ll 2>&1 | FileCheck %s --check-prefix=EXTRACTVALUE
|
|
; RUN: not llvm-as < %t/insertvalue.ll 2>&1 | FileCheck %s --check-prefix=INSERTVALUE
|
|
|
|
;--- extractvalue.ll
|
|
define i32 @extractvalue() {
|
|
; EXTRACTVALUE: error: extractvalue constexprs are no longer supported
|
|
ret i32 extractvalue ({i32} {i32 3}, 0)
|
|
}
|
|
|
|
;--- insertvalue.ll
|
|
define {i32} @insertvalue() {
|
|
; INSERTVALUE: error: insertvalue constexprs are no longer supported
|
|
ret {i32} insertvalue ({i32} poison, i32 3, 0)
|
|
}
|