[PATCH] D54546: [ARM] Don't expand sdiv when optimising for minsize
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 20 11:57:16 PST 2018
efriedma added inline comments.
================
Comment at: lib/Target/ARM/ARMISelLowering.cpp:7806
+ const ARMSubtarget& ST = static_cast<const ARMSubtarget&>(DAG.getSubtarget());
+ const bool hasDivide = ST.isThumb() ? ST.hasDivideInThumbMode()
+ : ST.hasDivideInARMMode();
----------------
ARM mode? It looks like the rest of the function doesn't handle it correctly, and you don't have any tests.
================
Comment at: test/CodeGen/ARM/sdiv-opt-size.ll:11
+; V6M: .file {{.*}}
+; V6M-NOT: sdiv
+
----------------
Could you also check that we don't generate any libcalls for v6m?
================
Comment at: test/CodeGen/ARM/sdiv-opt-size.ll:18
+; CHECK-NEXT: sdiv r0, r0, r1
+; CHECK-NEXT: sxth r0, r0
+; CHECK-NEXT: bx lr
----------------
This sxth is redundant? Probably need to implement ComputeNumSignBits for SDIV, or something like that.
https://reviews.llvm.org/D54546
More information about the llvm-commits
mailing list