When the folding is performed in place, the ::fold function does not populate
its results argument to indicate that. (In the folding hook for single-result
operations, the result of the original operation is expected to be returned,
but it is then ignored by the wrapper.) OperationFolder::create would
erronously rely on the _operation_ having zero results instead of on the
_folding_ producing zero new results to populate the list of results with those
of the original operation. This would lead to a crash for single-result ops
with in-place folds where the first result is accessed uncondtionally because
the list of results was not properly populated. Use the list of values produced
by the folding instead.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Nit: && "single operand op").