[all-commits] [llvm/llvm-project] e66592: llvm-reduce: Add values to return reduction (#132686)
Matt Arsenault via All-commits
all-commits at lists.llvm.org
Fri May 2 07:11:36 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: e66592509b7d56c8a6db8883be2257325f1d7b56
https://github.com/llvm/llvm-project/commit/e66592509b7d56c8a6db8883be2257325f1d7b56
Author: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: 2025-05-02 (Fri, 02 May 2025)
Changed paths:
M llvm/include/llvm/IR/Function.h
M llvm/lib/IR/Function.cpp
A llvm/test/tools/llvm-reduce/reduce-instructions-to-return-nonvoid-noncallee-use.ll
A llvm/test/tools/llvm-reduce/reduce-instructions-to-return.ll
M llvm/test/tools/llvm-reduce/reduce-operands-fp.ll
M llvm/test/tools/llvm-reduce/reduce-operands-int.ll
M llvm/test/tools/llvm-reduce/reduce-operands-ptr.ll
M llvm/tools/llvm-reduce/CMakeLists.txt
M llvm/tools/llvm-reduce/DeltaManager.cpp
M llvm/tools/llvm-reduce/DeltaPasses.def
A llvm/tools/llvm-reduce/deltas/ReduceValuesToReturn.cpp
A llvm/tools/llvm-reduce/deltas/ReduceValuesToReturn.h
Log Message:
-----------
llvm-reduce: Add values to return reduction (#132686)
In void functions, try to replace instruction uses
with a new non-void return. If the return type matches
the instruction, also try to directly return it.
This handles most of the cases, but doesn't try to handle
all of the weird exception related terminators.
Also doesn't try to replace argument uses, although it could. We
could also handle cases where we can insert a simple cast to an
original return value. I didn't think too hard about where to put this
in the default pass order. In many cases it obviates the need for most
of the CFG folds, but I've left it near the end initially.
I also think this is too aggressive about removing dead code, and
should leave existing dead code alone. I'm also not sure why we have
both "removeUnreachableBlocks" and EliminateUnreachableBlocks" in Utils.
Fixes #66039, fixes #107327
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list