[PATCH] D151883: [SDAG] Fix incorrect use of undef for boolean contents (PR63055)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 05:38:51 PDT 2023


nikic created this revision.
nikic added reviewers: craig.topper, RKSimon, goldstein.w.n.
Herald added subscribers: StephenFan, pengfei, hiraditya.
Herald added a project: All.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

FoldSetCC() returns UNDEF in a number of cases. However, the SetCC result must follow BooleanContents. Unless the type is a pre-legalization i1 or we have UndefinedBooleanContents, the use of UNDEF will not uphold the requirement that the top bits are either zero or match the low bit. In such cases, return zero instead.

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


https://reviews.llvm.org/D151883

Files:
  llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  llvm/test/CodeGen/ARM/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll
  llvm/test/CodeGen/ARM/hoist-and-by-const-from-shl-in-eqcmp-zero.ll
  llvm/test/CodeGen/X86/avx512-insert-extract.ll
  llvm/test/CodeGen/X86/setcc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151883.527375.patch
Type: text/x-patch
Size: 7756 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230601/10299570/attachment.bin>


More information about the llvm-commits mailing list