[all-commits] [llvm/llvm-project] 2e2663: [IR] document and update ctlz/cttz intrinsics to o...

Sanjay Patel via All-commits all-commits at lists.llvm.org
Sun Jan 23 08:23:06 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e26633af0c88ea23e3e8783ef60e621f282d3fb
      https://github.com/llvm/llvm-project/commit/2e26633af0c88ea23e3e8783ef60e621f282d3fb
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2022-01-23 (Sun, 23 Jan 2022)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/intrinsic-select.ll
    M llvm/test/Transforms/InstCombine/intrinsics.ll
    M llvm/test/Transforms/InstSimplify/ConstProp/bitcount.ll

  Log Message:
  -----------
  [IR] document and update ctlz/cttz intrinsics to optionally return poison rather than undef

The behavior in Analysis (knownbits) implements poison semantics already,
and we expect the transforms (for example, in instcombine) derived from
those semantics, so this patch changes the LangRef and remaining code to
be consistent. This is one more step in removing "undef" from LLVM.

Without this, I think https://github.com/llvm/llvm-project/issues/53330
has a legitimate complaint because that report wants to allow subsequent
code to mask off bits, and that is allowed with undef values. The clang
builtins are not actually documented anywhere AFAICT, but we might want
to add that to remove more uncertainty.

Differential Revision: https://reviews.llvm.org/D117912




More information about the All-commits mailing list