Found by PVS Studio
Not familiar with this code; no testcase.
Differential D69741
[Codegen] Both sides of '&&' are same; fixed xbolva00 on Nov 1 2019, 4:38 PM. Authored by
Details Found by PVS Studio Not familiar with this code; no testcase.
Diff Detail
Event TimelineComment Actions BTW, is anybody interested to help with fixing errs/warnings found by PVS Studio? List is huuuge. Comment Actions This might be trickier than it looks as its causing buildbot timeouts due to infinite loop in some llvm-tblgen calls (RISCVGenGlobalISel.inc is the one I've noticed). Comment Actions Expired timeouts were sadly caused by other commit, after that commit was reverted, major buildbots are green. RISCV folks should look at it if this exposed bugs.. cc @asb @simoncook Comment Actions But http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/10228 is red due to this patch for sure.. sad. Gonna revert this one. Comment Actions It seems that x86 is ok, aarch64 is broken too. @t.p.northover http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/24174/steps/annotate/logs/stdio Comment Actions Oh! @krasimir tried to fix it too some time ago (https://reviews.llvm.org/D61632) and failed with same error - RISCV to blame :)
Comment Actions Maybe someone from RISC-V could try to figure out what pattern it is that's causing the problem? Perhaps one approach could be to bisect over RISC-V commits with this patch applied and seeing where the timeouts start? Comment Actions There is no official riscv buildbot? I think it is mandatory to have a buildbot for official (non experimental) target. Comment Actions The RISC-V backend is now enabled by default, so general buildbot builders are building the RISC-V backend. |
I'm not familiar with this part of TableGen, but trying to narrow down what about RISCV causes this issue, it seems that patterns that have sext_inreg nodes cause this infinite loop, whereby this comparison now fails, and we fall into line 490 and remove modes.
Reading the comment above, it reads to me like this comparison should instead be if either S or B contains an integer mode, rather than if both do? If I change both this and line 486 to || rather than && in addition to this change then the infinite loop disappears. I ran make check-llvm with that change, and I don't see any regression tests failing.