aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/ConstantFold.cpp
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2023-03-06 10:46:22 +0100
committerNikita Popov <npopov@redhat.com>2023-03-16 10:32:08 +0100
commitbbfb13a5ffbccf1759ca6b75262a3ffdbe20496e (patch)
tree7b86a9e7b80e0b6684cd784606065d471f85c471 /llvm/lib/IR/ConstantFold.cpp
parentb293c6280d06f49c5ca7290855911341ab0bdffa (diff)
downloadllvm-bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e.zip
llvm-bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e.tar.gz
llvm-bbfb13a5ffbccf1759ca6b75262a3ffdbe20496e.tar.bz2
[ConstExpr] Remove select constant expression
This removes the select constant expression, as part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179. Uses of this expressions have already been removed in advance, so this just removes related infrastructure and updates tests. Differential Revision: https://reviews.llvm.org/D145382
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r--llvm/lib/IR/ConstantFold.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp
index 553bc1e..59131a42 100644
--- a/llvm/lib/IR/ConstantFold.cpp
+++ b/llvm/lib/IR/ConstantFold.cpp
@@ -593,17 +593,6 @@ Constant *llvm::ConstantFoldSelectInstruction(Constant *Cond,
if (isa<UndefValue>(V1) && NotPoison(V2)) return V2;
if (isa<UndefValue>(V2) && NotPoison(V1)) return V1;
- if (ConstantExpr *TrueVal = dyn_cast<ConstantExpr>(V1)) {
- if (TrueVal->getOpcode() == Instruction::Select)
- if (TrueVal->getOperand(0) == Cond)
- return ConstantExpr::getSelect(Cond, TrueVal->getOperand(1), V2);
- }
- if (ConstantExpr *FalseVal = dyn_cast<ConstantExpr>(V2)) {
- if (FalseVal->getOpcode() == Instruction::Select)
- if (FalseVal->getOperand(0) == Cond)
- return ConstantExpr::getSelect(Cond, V1, FalseVal->getOperand(2));
- }
-
return nullptr;
}