[all-commits] [llvm/llvm-project] daa5da: [flang] Don't blow up when combining mixed COMPLEX...

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed Sep 13 16:34:37 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: daa5da063ae8b39efa7368475f33db3313b41e30
      https://github.com/llvm/llvm-project/commit/daa5da063ae8b39efa7368475f33db3313b41e30
  Author: Peter Klausler <35819229+klausler at users.noreply.github.com>
  Date:   2023-09-13 (Wed, 13 Sep 2023)

  Changed paths:
    M flang/include/flang/Evaluate/tools.h
    M flang/lib/Evaluate/tools.cpp
    A flang/test/Evaluate/bug65142.f90

  Log Message:
  -----------
  [flang] Don't blow up when combining mixed COMPLEX operations (#66235)

Expression processing applies some straightforward rewriting of mixed
complex/real and complex/integer operations to avoid having to promote
the real/integer operand to complex and then perform a complex
operation; for example, (a,b)+x becomes (a+x,b) rather than (a,b)+(x,0).
But this can blow up the expression representation when the complex
operand cannot be duplicated cheaply. So apply this technique only to
complex operands that are appropriate to duplicate.

Fixes https://github.com/llvm/llvm-project/issues/65142.




More information about the All-commits mailing list