[llvm] [InlineCost] Simplify extractvalue across callsite (PR #145054)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 20 09:09:51 PDT 2025


================
@@ -2287,9 +2316,18 @@ bool CallAnalyzer::visitStore(StoreInst &I) {
 }
 
 bool CallAnalyzer::visitExtractValue(ExtractValueInst &I) {
-  // Constant folding for extract value is trivial.
-  if (simplifyInstruction(I))
-    return true;
+  Value *Op = I.getAggregateOperand();
+
+  // Special handling, because we want to simplify extractvalue with a
+  // potential insertvalue from the caller.
+  if (Value *SimpleOp = getSimplifiedValueUnchecked(Op)) {
----------------
fhahn wrote:

It would be good to split off the change from constant -> constant and then improve extract value handling in a separate pqtch

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


More information about the llvm-commits mailing list