[PATCH] D44957: [PeepholeOptimizer] Fix infinite recusion in CopyRewriter.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 14:18:37 PDT 2018


efriedma created this revision.
efriedma added reviewers: bruno, qcolombet, MatzeB.
Herald added a subscriber: javed.absar.

CopyRewriter::getNewSource calls itself, with no obvious limit to the amount of allowed recursion. Limit it to recursing once, which should catch the obvious cases without the potential infinite recursion.

Arbitrarily limiting the recursion to one isn't ideal, but I'm not sure what the intended limit is, and there aren't any regression tests for more complicated cases.


Repository:
  rL LLVM

https://reviews.llvm.org/D44957

Files:
  lib/CodeGen/PeepholeOptimizer.cpp
  test/CodeGen/AArch64/peephole-recursion.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44957.139999.patch
Type: text/x-patch
Size: 4374 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180327/54f465d6/attachment.bin>


More information about the llvm-commits mailing list