[PATCH] D118787: [flang] Lower integer constant code for STOP stmt

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 2 09:57:24 PST 2022


kiranchandramohan added inline comments.


================
Comment at: flang/test/Lower/stop-statement.f90:27
+ ! CHECK-DAG: %[[c42:.*]] = arith.constant 42 : i32
+ ! CHECK-DAG: %[[false:.*]] = arith.constant false
+ ! CHECK: fir.call @_Fortran{{.*}}StopStatement(%[[c42]], %[[false]], %[[false]])
----------------
clementval wrote:
> kiranchandramohan wrote:
> > Assuming the convert is removed by the canonicalize pass and that we don't have enough support for other types for the convert to be retained.
> Not sure I follow your comment here. The output of `./bin/bbc -emit-fir` (without `--canonicalize `)  is the following: 
> 
> ```
> func @_QPss() {
>   %c42_i32 = arith.constant 42 : i32
>   %false = arith.constant false
>   %false_0 = arith.constant false
>   %0 = fir.call @_FortranAStopStatement(%c42_i32, %false, %false_0) : (i32, i1, i1) -> none
>   fir.unreachable
> ^bb1:  // no predecessors
>   return
> }
> ```
> 
> So there is no convert.. Do you have smth else?
Sorry, I completely missed the point that `createConvert` function checks whether the source and dest types are different and then only inserts the convert.

A test with a convert would be great. But if there is not enough infra that is OK.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118787/new/

https://reviews.llvm.org/D118787



More information about the llvm-commits mailing list