[PATCH] D94450: [LegalizeDAG][RISCV][PowerPC][AMDGPU][WebAssembly] Improve expansion of SETONE/SETUEQ on targets without SETO/SETUO.

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 15 04:00:39 PST 2021


bjope added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3964
 
     assert(!NeedInvert && "Don't know how to invert BR_CC!");
 
----------------
bjope wrote:
> craig.topper wrote:
> > bjope wrote:
> > > NeedInvert is not handled here so this assert started to fail for our OOT target.
> > > 
> > > Haven't really investigate it yet. But should the code here support NeedInvert (or one should tell LegalizeSetCCCondCode above that legalization using NeedInvert isn't allowed).
> > I think it's not possible to invert it if Tmp4.getNode() is true below. But I think it should be false for the case this patch introduced.
> > 
> > So I think we can move the assert into the if at line 3969. And pick ISD::SETEQ instead of ISD::SETNE on line 3973 if NeedInvert is true.
> Right. Thanks!
> I'll play around with that tomorrow.
Proposed a fix: https://reviews.llvm.org/D94762


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94450



More information about the llvm-commits mailing list