[flang-commits] [flang] [Flang] Allow Intrinsic simpification with min/maxloc dim and scalar result. (PR #75820)

David Green via flang-commits flang-commits at lists.llvm.org
Fri Dec 22 03:41:41 PST 2023


davemgreen wrote:

The dim we could add a check for to make sure it is a constant. There is only really one valid value (=1) for the dim in this case, so it assumes that the runtime value is correct (and constants are already validated earlier). You would end up losing the performance for the non-constant case where you know there was only one valid value. I will defer to the others who know more about flang to weigh in on whether that might be better. Mask might be more difficult than dim to detect statically.

At least in llvm/clang I believe it is common to say that with/without debug info should not change the generated code. It could perhaps be something that behaves differently at -O0 vs -O2 for example, and from a quick test I just ran it appears that might already be the case. The lack of optimizations means we always generate the runtime call that performs the relevant checks.

https://github.com/llvm/llvm-project/pull/75820


More information about the flang-commits mailing list