[llvm] [SelectionDAG] Handle more opcodes in canCreateUndefOrPoison (PR #84921)

Björn Pettersson via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 12:03:53 PDT 2024


================
@@ -5091,8 +5101,18 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
   case ISD::BITCAST:
   case ISD::BUILD_VECTOR:
   case ISD::BUILD_PAIR:
+  case ISD::SELECT:
----------------
bjope wrote:

Thanks! After several years I still did not know that `select` could have flags.
I really think that we shuold document such things also for ISD opcodes (at least in ISDOpcodes.h).

I'll try to add an assert here to make sure that none of the instructions in the group have flags. And then I'll move the handling of SELECT further down in this switch, to make sure that we consider the flags in some way.

https://github.com/llvm/llvm-project/pull/84921


More information about the llvm-commits mailing list