[flang-commits] [lldb] [mlir] [polly] [lld] [libcxx] [flang] [llvm] [clang] [compiler-rt] [openmp] [libc] [WebAssembly] Correctly consider signext/zext arg flags at function declaration (PR #77281)

Alex Bradbury via flang-commits flang-commits at lists.llvm.org
Tue Jan 9 02:00:05 PST 2024


asb wrote:

In case anyone was wondering how this is handled in SelectionDAG, I believe it's covered by CallLoweringInfo ultimately determining if an arg is sext/zext through CallBase::paramHasAttr, which does indeed check both the callsite and the called function (if it's a direct call of course). Indeed, I think you could just switch to using paramHasAttr in this patch and get the desired behaviour (which seems to be what ARMFastISel does in its `SelectCall` implementation).

Although this does fix a real bug, I'd strongly advise that a bug be filed against whatever code generated produced a call lacking the matching signext/zeroext attribute as the caller. I don't believe that in general LLVM is particularly well tested or robust against such inconsistencies, so it's likely to run into bugs.

https://github.com/llvm/llvm-project/pull/77281


More information about the flang-commits mailing list