[flang]Avoid asking for operands when there are none
authorMats Petersson <mats.petersson@arm.com>
Tue, 9 Aug 2022 15:51:00 +0000 (16:51 +0100)
committerMats Petersson <mats.petersson@arm.com>
Wed, 17 Aug 2022 11:31:42 +0000 (12:31 +0100)
commit726786083f1bdf8c073ea6c75b321d26719981ab
tree95a3ebbf9e07cb2364a04d1c9f12944c66a1c4f7
parent8375c3124df48dd863cc9fcbe36e67628bc27bf3
[flang]Avoid asking for operands when there are none

Fix one encountered (issue #57072) and two potential scenarios where the
code would ask for an operand that isn't there.

Add test for the encountered case.

Reviewed By: vzakhari

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