<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61099>61099</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
possibility of duplicate calls.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ParkHanbum
</td>
</tr>
</table>
<pre>
[ if (!L->isLoopSimplifyForm()) {](https://github.com/llvm/llvm-project/blob/25af6507e773f34a1b43f837eec918786619c545/llvm/lib/Transforms/Scalar/LoopFlatten.cpp#L384)
in this line, it check this Loop whether simplify form or not. however, isLoopSimplifyForm doesn't seem to be needed because it's called inside the next condition check, isCanonical.
see below call flow :
```
bool Loop::isCanonical(ScalarEvolution &SE) const {
InductionDescriptor IndDesc;
if (!getInductionDescriptor(SE, IndDesc))
return false;
...
bool Loop::getInductionDescriptor(ScalarEvolution &SE,
InductionDescriptor &IndDesc) const {
if (PHINode *IndVar = getInductionVariable(SE))
return InductionDescriptor::isInductionPHI(IndVar, this, &SE, IndDesc);
return false;
}
PHINode *Loop::getInductionVariable(ScalarEvolution &SE) const {
if (!isLoopSimplifyForm())
return nullptr;
```
isCanonical -> getInductionDescriptor -> getInductionVariable -> isLoopSimplifyForm
if isLoopSimplifyForm has returned false, isCanonical also return false.
so, I think it is not necessary first check whether this Loop isLoopSimplifyForm or not.
how do you think?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVV1vqzgQ_TXOy-giYvMRHnjobYpaqVpV6uq-GzMEbx0b2abZ_PuV-bihLVvtSlUJeDxzzpnxMXdOnjRiSdKfJD3u-OA7Y8sXbt8eua6H8642zbUk8ZHEdyT9CSBbIPRA6P75B2EP0j0b07_Kc69ke62MPY-LBaEFkDykJPTQed87wu4IrQitTtJ3Qx0Jcya0Uup9efzorfkLhSe0qpWpCa1oytssjXPMc9ayhO_rhLUHliOKYn_ID1m2L0SapKs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