[PATCH] D101806: [TargetLowering] Only inspect attributes in the arguments for ArgListEntry

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 29 09:12:44 PDT 2021


uweigand added a comment.

Unfortunately, I now see this patch also caused another regression, this time in the s390x multistage builder.  Again, this was initially hidden by other regressions; now that these are resolved, you can see the problems here (https://lab.llvm.org/buildbot/#/builders/8/builds/1277):
 FAIL: LLVM-Unit::FixedPoint.FixedToFloat
 FAIL: LLVM-Unit::FixedPoint.FloatToFixed
 FAIL: Clang::fixed_point_compound.c
 FAIL: Clang::fixed_point_conversions.c
 FAIL: Clang::fixed_point_conversions_half.c
 FAIL: Clang::fixed_point_conversions_const.c

Comparing the disassembly of the stage2 ADTTests executable before and after this commit, I see that after this commit, some C runtime library calls are made without properly (sign-)extending their arguments.  Specifically, and this explains the reported bugs, the "int" argument in a call to ldexp is no longer sign-extended as it needs to be.   Also (this is probably not related to this bug, but I noticed in the assembly), the "int" argument in a call to fputc is no longer sign-extended.

Both cases appear to be calls that were synthesized by the LLVM middle-end (as opposed to being emitted by the clang front-end).

I notice that the emitLibCall routine in lib/Transforms/Utils/BuildLibCalls.cpp calls inferLibFuncAttributes that will set various of these attributes, including the signext attributes, but it will set them only on the function, not on the call itself.   This seems to contradict the very assumption of this patch.   (But note that I'm not sure if this is the only place that emits library function calls.)

Maybe it would be good to revert this again until all these issues are sorted out?   I would really like to get the s390x build bots all green again soon ...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101806



More information about the llvm-commits mailing list