[PATCH] D106754: [RISCV] Restrict performANY_EXTENDCombine to prevent an infinite loop.
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 26 04:01:11 PDT 2021
frasercrmck added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5802
+ // infinite combine loops like PR51206.
+ bool HasCopyToRegUser = false;
+ for (SDNode::use_iterator UI = N->use_begin(), UE = N->use_end(); UI != UE;
----------------
I'd probably suggest
```
if (!any_of(N->uses(),
[](SDNode *User) { return User->getOpcode() == ISD::CopyToReg; }))
return SDValue();
```
which I believe is equivalent.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106754/new/
https://reviews.llvm.org/D106754
More information about the llvm-commits
mailing list