[PATCH] D159406: [SelectionDAG] Generalise SelectionDAG::computeOverflowKind to support other opcodes

Mohamed Atef via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 4 08:22:33 PDT 2023


elhewaty marked 2 inline comments as done.
elhewaty added a comment.

In D159406#4637304 <https://reviews.llvm.org/D159406#4637304>, @RKSimon wrote:

>> As I am a complete beginner with LLVM how can write tests? Is there any tutorial or example?
>
> In this case the best reference tests are probably in combine-mulo.ll and xmulo.ll in the llvm-project/llvm/test/CodeGen/X86/ folder
>
> I think you're only missing test coverage for the computeOverflowForSignedMul "SignBits == BitWidth + 1" knownbits cases.

What about the test coverage for the rest of the functions?

> You could investigate how InstCombine handles these cases - look inside llvm-project\llvm\test\Transforms\InstCombine for smul.overflow tests - you could try disabling the "SignBits == BitWidth + 1" handling in ValueTracking.cpp and then see which tests change/fail  with `ninja check-llvm-transforms-instcombine` - you might then be able to convert some of those to combine-mulo.ll / xmulo.ll

I think I will try this now


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D159406/new/

https://reviews.llvm.org/D159406



More information about the llvm-commits mailing list