[all-commits] [llvm/llvm-project] b3c55b: [SelectionDAG] Handle more opcodes in canCreateUnd...

Björn Pettersson via All-commits all-commits at lists.llvm.org
Sun Apr 28 22:57:11 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b3c55b707110084a9f50a16aade34c3be6fa18da
      https://github.com/llvm/llvm-project/commit/b3c55b707110084a9f50a16aade34c3be6fa18da
  Author: Björn Pettersson <bjorn.a.pettersson at ericsson.com>
  Date:   2024-04-29 (Mon, 29 Apr 2024)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/AMDGPU/div_i128.ll
    M llvm/test/CodeGen/AMDGPU/rem_i128.ll
    M llvm/test/CodeGen/X86/div-rem-pair-recomposition-signed.ll
    M llvm/test/CodeGen/X86/freeze-binary.ll
    M llvm/test/CodeGen/X86/midpoint-int-vec-512.ll

  Log Message:
  -----------
  [SelectionDAG] Handle more opcodes in canCreateUndefOrPoison (#84921)

[SelectionDAG] Handle more opcodes in canCreateUndefOrPoison

Handle SELECT_CC similarly as SETCC.

Handle these operations that only propagate poison/undef based on the
input operands:
  SADDSAT, UADDSAT, SSUBSAT, USUBSAT, MULHU, MULHS,
  SMIN, SMAX, UMIN, UMAX

These operations may create poison based on shift amount and exact
flag being violated:
  SRL, SRA

One goal here is to allow pushing freeze through these operations
when allowed, as well as letting analyses such as
isGuaranteedNotToBeUndefOrPoison to not break on such operations.

Since some problems have been observed with pushing freeze through
SRA/SRL we block that explicitly in DAGCombiner::visitFreeze now.
That way we can still model SRA/SRL properly in
SelectionDAG::canCreateUndefOrPoison, e.g. when used by
isGuaranteedNotToBeUndefOrPoison, even if we do not want to push
freeze through those instructions.



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