Details
Diff Detail
Event Timeline
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
8621 | This swap is hard to follow. It's not immediately clear to me why this would be commuted in != subcarry case. What happens in the sub (subcarry, subcarry) case? I think it would be clearer to just explicitly handle the two cases | |
8625 | This needs a comment with the commuted case | |
8626–8627 | This can use C->isNullValue() instead of getZExtValue | |
test/CodeGen/AMDGPU/combine-cond-add-sub.ll | ||
151 | Maybe add a test where both operands to a sub are subcarry |
lib/Target/AMDGPU/SIISelLowering.cpp | ||
---|---|---|
8621 | It really does not matter what is the RHS, it can be anything including subcarry. | |
test/CodeGen/AMDGPU/combine-cond-add-sub.ll | ||
151 | That is really no different from any other instruction but complicates the test a lot since we cannot get subcarry right from the IR. |
Actually I think it is still wrong. In the commuted case carry must be added, not subtracted:
x - (y - 0 - cc) => x - y + cc
I will just disable it for commuted case.
test/CodeGen/AMDGPU/combine-cond-add-sub.ll | ||
---|---|---|
131–133 | This needs operand checks |
This swap is hard to follow. It's not immediately clear to me why this would be commuted in != subcarry case. What happens in the sub (subcarry, subcarry) case? I think it would be clearer to just explicitly handle the two cases