[PATCH] D52548: Stop instcombining introducing undef's in div/rem instructions.

Neil Henning via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 26 06:36:42 PDT 2018


sheredom created this revision.
sheredom added reviewers: spatel, lebedev.ri, craig.topper, majnemer.
Herald added a subscriber: llvm-commits.

I found a case where instcombine would introduce an undef into the divisor of a div/rem instruction, which would in turn cause that instruction to be simplified away because 'if any vector component is undef, the whole div/rem is undef.'

This fixes that case by checking whether during mask propagation of a shuffle vector you could introduce an undef to subsequent instructions, and stopping the optimization if any of the subsequent instructions is a div/rem.


Repository:
  rL LLVM

https://reviews.llvm.org/D52548

Files:
  lib/Transforms/InstCombine/InstCombineVectorOps.cpp
  test/Transforms/InstCombine/stop_bad_undef_propagation.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52548.167122.patch
Type: text/x-patch
Size: 16450 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180926/05be7345/attachment.bin>


More information about the llvm-commits mailing list