[FLANG]Add maxval simplification support
authorMats Petersson <mats.petersson@arm.com>
Fri, 29 Jul 2022 19:19:04 +0000 (20:19 +0100)
committerMats Petersson <mats.petersson@arm.com>
Wed, 24 Aug 2022 13:08:19 +0000 (14:08 +0100)
commitafa520ab34803c82587ea6759bfd352579f741b4
treebb065b34c3f5f9884bec9ee609c836c2db3f5e7e
parent3e84cdbee467f97026f1ad421abcaf9b862c1ff4
[FLANG]Add maxval simplification support

Add simplifcation pass for MAXVAL intrinsic function

This refactors some of the code to allow variation on the
initialization value and operation performed within the loop,
reusing the majority of code for both SUM and MAXVAL.

Adding tests for the test-cases that produce different output
than the SUM function.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D132234
flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
flang/test/Transforms/simplifyintrinsics.fir