khchen added a comment.

> Store to null will be changed to unreachable, so all instructions after vleff 
> intrinsic call will be deleted and it causes runtime errors. If destination 
> to store is null, we won't extract and store the new vl.



> Yes, but only for vleff instructions, since it has two outputs actually. And 
> this behavior is compatible with GCC. If necessary, I will propose it to 
> rvv-intrinsic-doc.

Compiling with -O0, I didn't see this behavior, so are you trying to make the 
optimized code behavior is compatible with GCC?

In addition, it seems this behavior also exist in scalar code, do we also need 
to make the scalar result is compatible with GCC?
ex.

  int foo (int j){
      int *k = nullptr;
      *k = 10;
      return 100;
  }

compiling with `-O3`, llvm generates empty function but gcc generates

  foo(int):
          sw      zero,0(zero)
          ebreak

https://godbolt.org/z/46vGrzs49

Please correct me if I misunderstand something, thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126461

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to