[all-commits] [llvm/llvm-project] 5013c8: [GlobalOpt][Evaluator] Don't evaluate calls with s...

Nikita Popov via All-commits all-commits at lists.llvm.org
Thu Dec 12 01:45:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5013c81b781eb95af8e429956d63c8f9c16a4647
      https://github.com/llvm/llvm-project/commit/5013c81b781eb95af8e429956d63c8f9c16a4647
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-12-12 (Thu, 12 Dec 2024)

  Changed paths:
    M llvm/include/llvm/Transforms/Utils/Evaluator.h
    M llvm/lib/Transforms/Utils/Evaluator.cpp
    M llvm/test/Transforms/GlobalOpt/evaluate-call-errors.ll
    M llvm/test/Transforms/GlobalOpt/evaluate-constfold-call.ll
    A llvm/test/Transforms/GlobalOpt/evaluate-ret-void-mismatch.ll

  Log Message:
  -----------
  [GlobalOpt][Evaluator] Don't evaluate calls with signature mismatch (#119548)

The global ctor evaluator tries to evalute function calls where the call
function type and function type do not match, by performing bitcasts.
This currently causes a crash when calling a void function with non-void
return type.

I've opted to remove this functionality entirely rather than fixing this
specific case. With opaque pointers, there shouldn't be a legitimate use
case for this anymore, as we don't need to look through pointer type
casts. Doing other bitcasts is very iffy because it ignores ABI
considerations. We should at least leave adjusting the signatures to
make them line up to InstCombine (which also does some iffy things, but
is at least somewhat more constrained).

Fixes https://github.com/llvm/llvm-project/issues/118725.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list