[PATCH] D24822: [SelectionDAG] Enable division-by-constant optimization for wide types

Alexei Starovoitov via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 13:40:50 PDT 2016


ast requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: test/CodeGen/BPF/sdiv_error.ll:3
@@ -2,3 +2,3 @@
 ; RUN: FileCheck %s < %t1
-; CHECK: Unsupport signed division
+; CHECK: Cannot select: t27: i64,i64 = smul_lohi
 
----------------
nhaehnle wrote:
> ast wrote:
> > 'cannot select' is unreadable to C programmer comparing to 'Unsupported signed div'.
> > Usability of BPF is the hardest problem we're facing, so we don't want to lose those error messages. Hence similar to the SDIV error, can you please add the same error for SMUL_LOHI in BPFDAGToDAGISel::Select() ?
> > Also keeping the same hint "Please convert to unsigned div/mod".
> > Thanks
> Hmm, relying on backend error messages for usability is maybe not the best idea...
> 
> Not sure how to change this. Perhaps adding an isSigned parameter to isIntDivCheap?
it's not the matter of optimization. There is no sdiv instruction. So please keep the backend error.


https://reviews.llvm.org/D24822





More information about the llvm-commits mailing list