Depending on the compare code that can be either an argument of
sext or negate of it. This helps to avoid v_cndmask_b64 instruction
for sext. A reversed value can be further simplified and folded into
its parent comparison if possible.
Details
Diff Detail
Event Timeline
There are already an extensive number of combines that do this sort of thing in the generic DAGcombiner. Have you looked into why those aren't working? I know some are broken because they don't properly check the TargetBooalenContents
These patterns are quite specific to our way of bool deserialization. Moreover, just like previous it is not always beneficial to do, it all depends where do we expect to have initial bool value.
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
5143 | I don't think it is useful check the GT/LT cases. I would expect those to fold to eq/ne the bool value already |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
5127–5135 | I agree, but I have seen a real case where it was swapped. |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
5143 | It is not folded. At least not always. |
Deserialized isn't the right word. I think you mean an i1 which must be an in SGPR/condition register. Maybe isBoolSGPR or something?