[PATCH] D113105: [InstCombine] Extend stacksave/restore elimination

Itay Bookstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 3 07:50:25 PDT 2021


nextsilicon-itay-bookstein created this revision.
nextsilicon-itay-bookstein added reviewers: lebedev.ri, majnemer.
Herald added a subscriber: hiraditya.
nextsilicon-itay-bookstein requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Previously, InstCombine detected a pair of llvm.stacksave/stackrestore
instructions that are adjacent modulo debug instructions in order to
eliminate the llvm.stackrestore. This precludes situations where
intervening instructions (e.g. loads) preclude the llvm.stacksave and
llvm.stackrestore from becoming adjacent. This commit extends the logic
and allows for eliminating the llvm.stackrestore when the range of
instructions between them does not include any alloca or side-effect
causing instructions.

Signed-off-by: Itay Bookstein <itay.bookstein at nextsilicon.com>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113105

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/test/Transforms/InstCombine/stacksaverestore.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113105.384436.patch
Type: text/x-patch
Size: 4599 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211103/06cbf666/attachment.bin>


More information about the llvm-commits mailing list