[PATCH] D37317: [X86] Don't pull carry through X86ISD::ADD carryin, -1 if we can't guranteed we're really using the carry flag from the add.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 15:05:32 PDT 2017


craig.topper created this revision.

Prior to this patch we had a DAG combine that tried to bypass an X86ISD::ADD with -1 being added to the carry flag of some previous operation. We would then pass the carry flag directly to user.

But this is only safe if the user is looking for the carry flag and not the zero flag.

So we need to only do this combine in a context where we know what flag the consumer is using.

Fixes PR34381.


https://reviews.llvm.org/D37317

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/pr34381.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37317.113322.patch
Type: text/x-patch
Size: 6161 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170830/7195b514/attachment.bin>


More information about the llvm-commits mailing list