[llvm] [RISC-V] Fix outliner candidate analysis (PR #177126)
Pengcheng Wang via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 21 18:50:00 PST 2026
================
@@ -3653,6 +3653,22 @@ static bool cannotInsertTailCall(const MachineBasicBlock &MBB) {
}
static bool analyzeCandidate(outliner::Candidate &C) {
+ // If the expansion register for tail calls is live across the candidate
+ // outlined call site, we cannot outline that candidate as the expansion
+ // would clobber the register.
+ // TODO: Should this check only be done if the outlined sequence returns?
+ const TargetRegisterInfo *TRI = C.getMF()->getSubtarget().getRegisterInfo();
+ const TargetSubtargetInfo &STI = C.getMBB()->getParent()->getSubtarget();
----------------
wangpc-pp wrote:
I think we can just make `analyzeCandidate` a method in `RISCVInstrInfo` so that we can get these `*Info` directly.
https://github.com/llvm/llvm-project/pull/177126
More information about the llvm-commits
mailing list