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

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 14:16:21 PDT 2021


aprantl 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;
----------------
LiuChen3 wrote:
> 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.
We have many tools like delta (https://web.archive.org/web/20200701152100/http://delta.tigris.org/) bugpoint, and llvm-reduce available which can automate the process of reducing a testcase.


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