[llvm] [InstCombine] Fold "extract (select (cond, insert(agg, elem), FV))" (PR #115969)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 12 18:22:09 PST 2024


================
@@ -1692,7 +1692,25 @@ Instruction *InstCombinerImpl::FoldOpIntoSelect(Instruction &Op, SelectInst *SI,
 
   Value *TV = SI->getTrueValue();
   Value *FV = SI->getFalseValue();
-  if (!(isa<Constant>(TV) || isa<Constant>(FV)))
+  if ((Op.getOpcode() == Instruction::ExtractValue) &&
----------------
dtcxzyw wrote:

```suggestion
  if (Op.getOpcode() == Instruction::ExtractValue &&
```

https://github.com/llvm/llvm-project/pull/115969


More information about the llvm-commits mailing list