[all-commits] [llvm/llvm-project] 1d5d12: [ConstantFolding] Consolidate poison propagation f...

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jul 4 00:16:49 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1d5d1256487c1574e5a8addcf27983fd569966e5
      https://github.com/llvm/llvm-project/commit/1d5d1256487c1574e5a8addcf27983fd569966e5
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2025-07-04 (Fri, 04 Jul 2025)

  Changed paths:
    M llvm/include/llvm/Analysis/ValueTracking.h
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/InstSimplify/fold-intrinsics.ll
    M llvm/unittests/Analysis/ValueTrackingTest.cpp

  Log Message:
  -----------
  [ConstantFolding] Consolidate poison propagation for intrinsics (#146878)

This consolidates the "fold poison arg to poison result" constant
folding logic for intrinsics, based on a common
intrinsicPropagatesPoison() helper, which is also used for poison
propagation reasoning in ValueTracking. This ensures that the set of
supported intrinsics is consistent.

This add ucmp, scmp, smul.fix, smul.fix.sat, canonicalize and sqrt to
the intrinsicPropagatesPoison list, as these were handled by
ConstantFolding but not ValueTracking. The ctpop test is an example of
the converse, where it was handled by ValueTracking but not
ConstantFolding.



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