This commit introduces DuplicatedObjectReductionPass and revises
backend implementation to use this new pass implementation.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
pipeline.append(make_unique<DataLayoutConversionPass>());
pipeline.append(make_unique<IndirectCopyEliminationPass>());
pipeline.append(make_unique<IdenticalObjectReductionPass>());
+ pipeline.append(make_unique<DuplicatedObjectReductionPass>());
// Apply transforms in the pipeline
for (uint32_t n = 0; n < pipeline.size(); ++n)
// that share the same bag as their underlying bag
assert(!has_inout_bag(code(sess)->module()));
- reduce_duplicated_object(code(sess));
-
fold_constants(code(sess));
// Eliminate dead object
#define __ENCO_TRANSFORM_DUPLICATED_OBJECT_REDUCTION_H__
#include "Code.h"
+#include "Pass.h"
namespace enco
{
*/
void reduce_duplicated_object(enco::Code *code);
+struct DuplicatedObjectReductionPass final : public Pass
+{
+ PASS_CTOR(DuplicatedObjectReductionPass)
+ {
+ // DO NOTHING
+ }
+
+ void run(const SessionID &sess) const override { reduce_duplicated_object(code(sess)); }
+};
+
} // namespace enco
#endif // __ENCO_TRANSFORM_DUPLICATED_OBJECT_REDUCTION_H__