I'm somewhat unhappy with needing to do this. Ideally we could
unconditionally turn all of these into fnegs, but that's going
to confuse other integer patterns that want to look for xor. We
either have to complicate those, or special case this.
Details
- Reviewers
foad Pierre-vh sebastian-ne rampitec rovka scott.linder jmmartinez - Group Reviewers
Restricted Project
Diff Detail
Unit Tests
Event Timeline
This does break /llvm/test/CodeGen/AMDGPU/post-ra-soft-clause-dbg-info.ll for reasons I don't understand (the register references go to undef)
ping
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | ||
---|---|---|
2568 | It would work but adds code in the common case |
llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp | ||
---|---|---|
2568 | Just guessing into the dark for why post-ra-soft-clause-dbg-info.ll is failing, but it could be because of this stripBitcast. 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 |
Can we just do the stripBitcast call earlier? (at Src = In)
That way it simplifies the condition a bit (you can have a if/else if)