[PATCH] D14035: Fix llc crash processing S/UREM for -Oz builds caused by rL250825.

Steve King via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 23 17:42:03 PDT 2015


srking created this revision.
srking added reviewers: tyomitch, rengolin.
srking added a subscriber: llvm-commits.
srking set the repository for this revision to rL LLVM.

When taking the remainder of a value divided by a constant, visitREM() attempts to convert the REM to a longer but faster sequence of instructions.  This conversion calls combine() on a speculative DIV instruction.  Commit rL250825 may cause this combine() to return a DIVREM, corrupting nearby nodes.  Flow eventually hits unreachable().

This patch adds a test case and a check to prevent visitREM() from trying to convert the REM instruction in cases where a DIVREM is possible.

Repository:
  rL LLVM

http://reviews.llvm.org/D14035

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/Generic/urem_crash.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14035.38285.patch
Type: text/x-patch
Size: 4605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151024/dd434be8/attachment.bin>


More information about the llvm-commits mailing list