llvm2alive: hoist all aggregate phi eval to BB edge
MODIFY
llvm_util/llvm2alive.cpp
llvm_util/llvm2alive.cpp
@@ -56,16 +56,7 @@ FpExceptionMode parse_exceptions(llvm::Instruction &i) {
}
bool has_constant_expr(llvm::Value *val) {
- if (isa<llvm::ConstantExpr>(val))
- return true;
-
- if (auto *agg = dyn_cast<llvm::ConstantAggregate>(val)) {
- for (auto &op : agg->operands()) {
- if (has_constant_expr(op))
- return true;
- }
- }
- return false;
+ return isa<llvm::ConstantExpr, llvm::ConstantAggregate>(val);
}
unsigned constexpr_idx;

llvm2alive: hoist all aggregate phi eval to BB edge