[PATCH] D142756: AMDGPU: Try to select fneg modifier from xor

Sebastian Neubauer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 11 05:24:38 PDT 2023


sebastian-ne added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:2568
+  } else {
+    Src = stripBitcast(Src);
+    if (Src.getOpcode() == ISD::XOR) {
----------------
Just guessing into the dark for why post-ra-soft-clause-dbg-info.ll is failing, but it could be because of this stripBitcast.
The code is
```
v1 = global_load_dword
v1_cast = bitcast i32 v1 to float
debug_value(v1_cast)
v_add_f32 v1_cast, v2
```

The cast is stripped here (it wasn’t before), so we get
```
v1 = global_load_dword
v1_cast = bitcast i32 v1 to float
debug_value(v1_cast)
v_add_f32 v1, v2     // <- no cast here anymore
```

and v1_cast is unused, except for the debug_value.

Dead code elimination removes the bitcast, because it has only debug uses and we get
```
v1 = global_load_dword
debug_value(<deleted>)
v_add_f32 v1, v2
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142756/new/

https://reviews.llvm.org/D142756



More information about the llvm-commits mailing list