Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
3112 ↗ | (On Diff #166934) | You're ignoring this comment - consult simplifyDivRem inside InstructionSimplify.cpp which shows the issue |
IIRC last time I started looking at this a load of tests failed in other targets, including some reduced test cases that needed fixing.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
3112 ↗ | (On Diff #166934) | Seems like we don't even need the X /, % 1 -> X fold here. With or without - tests are not affected, this was folded even before this patch. |
test/CodeGen/X86/pr38539.ll | ||
---|---|---|
6 ↗ | (On Diff #166962) | @craig.topper will be able to confirm but it might be that you need to (locally) revert the fix for PR38539, apply your DAGCombiner.cpp patch and then run bugpoint to reduce the original fuzz code again: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8882 |
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
3103 ↗ | (On Diff #166962) | Please don't remove this comment without actually fixing the underlying problem (in a separate patch).
Here are test cases you can add/use to confirm the difference between llc and opt for the boolean patterns: define i1 @bool_udiv(i1 %x, i1 %y) { %r = udiv i1 %x, %y ret i1 %r } define i1 @bool_sdiv(i1 %x, i1 %y) { %r = sdiv i1 %x, %y ret i1 %r } define i1 @bool_urem(i1 %x, i1 %y) { %r = urem i1 %x, %y ret i1 %r } define i1 @bool_srem(i1 %x, i1 %y) { %r = srem i1 %x, %y ret i1 %r } define <4 x i1> @boolvec_udiv(<4 x i1> %x, <4 x i1> %y) { %r = udiv <4 x i1> %x, %y ret <4 x i1> %r } define <4 x i1> @boolvec_sdiv(<4 x i1> %x, <4 x i1> %y) { %r = sdiv <4 x i1> %x, %y ret <4 x i1> %r } define <4 x i1> @boolvec_urem(<4 x i1> %x, <4 x i1> %y) { %r = urem <4 x i1> %x, %y ret <4 x i1> %r } define <4 x i1> @boolvec_srem(<4 x i1> %x, <4 x i1> %y) { %r = srem <4 x i1> %x, %y ret <4 x i1> %r } |
test/CodeGen/X86/pr38539.ll | ||
---|---|---|
6 ↗ | (On Diff #166962) | I reverted https://reviews.llvm.org/rL339945 and I ran llvm-lit on pr38539.ll - test passed... (flags-copy-lowering.mir failed). Something else between that commit and top of trunk must fix it too. So I think we should either remove test file or modify it with no worries. |
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
3103 ↗ | (On Diff #166962) | I will revert that comment removal.. Anyway, I see // fold (sdiv X, 1) -> X if (N1C && N1C->isOne()) return N0; in visitS(U)DIV so.. do you suggest to unify it and move it here? |
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
3103 ↗ | (On Diff #166962) | Yes, I think that's a good change - reduce code duplication and more efficient (for urem/srem). You can do that cleanup first as an NFC patch. Then, add the functionality for bool types as a follow-up. (Both changes are independent of this patch.) |