[PATCH] D100015: [debug-info] make fortran CHARACTER(1) type as valid unsigned type

LiuChen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 29 20:41:41 PDT 2021


LiuChen3 added inline comments.


================
Comment at: llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp:180
+  if (isa<DIStringType>(Ty)) {
+    assert((Ty->getSizeInBits()) == 8 && "Not a valid unsigned type!");
+    return true;
----------------
shchenz wrote:
> LiuChen3 wrote:
> > Hi, @shchenz . This assertion make our testcase fail on X86 target. I am not familiar with this part so I have a question here: why the type here must be unsigned? Should this be something like "return Ty->getSizeInBits() == 8; " ?
> > Thanks.
> I added this assertion only for `i8` is because SROA will convert Fortran `CHARACTER(1)` type (`DIStringType`) to `i8`. Do you also get some ` DIStringType` variables being converted to a scalar type, like `i8`, `i16`, `i32`? If so, I think you need to first check if the above conversion is valid or not. if it is valid, then you can change the assertion here.
Our test is too big and I didn't find the root cause now.
I am just confused about the assertion here. If the DIStringType must be i8, I think you should insert assertion after the convert(Maybe in SROA), instead of inserting assertion here. Here should just return false if the type isn't i8.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100015



More information about the llvm-commits mailing list