Files
Jacob Young 7a1499f14e [SystemZ] Fix assertion failures during DAG combine (#215027)
Repro:

```llvm
target triple = "s390x-linux-gnu"

define <2 x half> @fabs_v2f16(<2 x half> %arg) "target-cpu"="z16" {
  %bits = bitcast <2 x half> %arg to <2 x i16>
  %is_neg = icmp slt <2 x i16> %bits, zeroinitializer
  %neg = fneg <2 x half> %arg
  %res = select <2 x i1> %is_neg, <2 x half> %neg, <2 x half> %arg
  ret <2 x half> %res
}
```
```console
$ llc fp-half-vector-abs.ll
llc: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7343: SDValue llvm::SelectionDAG::getNode(unsigned int, const SDLoc &, EVT, SDValue, const SDNodeFlags): Assertion `N1.getValueType().bitsGT(VT) && "Invalid truncate node, src < dst!"' failed.
```

Previously this code would generate:

    i16 = bitcast f16
    i32 = truncate i16

Which would immediately assert due to the invalid truncate, but even
with that fixed it would assert later due to the illegal i16. Instead,
use the same lowering as `LowerOperationWrapper` for the bitcast.

(cherry picked from commit 1c518910af602a246cbf7cd4fe90c4fbd15a758c)
2026-08-20 21:09:43 +00:00
..
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…