OSDN Git Service

[DAGCombine] visitREM - Don't assume that one divrem isn't driving another
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 13 Mar 2018 17:17:15 +0000 (17:17 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 13 Mar 2018 17:17:15 +0000 (17:17 +0000)
commit38ac5997de8219edc77c91996727b8ebfc2c5db2
tree8e98a70e8de1f3b72cd8dee2f414c1198ca65b75
parent3ca92f8e9ed1274482c15bfec18368c0cc295023
[DAGCombine] visitREM - Don't assume that one divrem isn't driving another

Under some circumstances the divrems won't have been combined together before getting to this code.

So replace the assertion with a if() guard to not expand to X-((X/C)*C) to give the other combine chance to happen.

Reduced from OSS-Fuzz #6883
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6883

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327424 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/combine-srem.ll