[fir] Add fir.cmpc conversion
authorDiana Picus <diana.picus@linaro.org>
Tue, 16 Nov 2021 10:17:29 +0000 (10:17 +0000)
committerDiana Picus <diana.picus@linaro.org>
Tue, 16 Nov 2021 12:26:27 +0000 (12:26 +0000)
commitf1dfc0275c543db14b1723ee2e33f0910dcc7f24
tree99d8a962e52f42cd67aed7a5a1df7039bc0752a7
parent738e7f1231949ec248c1d8d154783338215613d1
[fir] Add fir.cmpc conversion

This patch adds the codegen for fir.cmpc. The real and imaginary parts
are extracted and compared separately. For the .EQ. predicate the
results are AND'd, for the .NE. predicate the results are OR'd, and for
other predicates we keep only the result on the real parts.

This patch is part of the upstreaming effort from fir-dev.

Differential Revision: https://reviews.llvm.org/D113976

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Jean Perier <jperier@nvidia.com>
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/test/Fir/convert-to-llvm.fir