This extends my previous patches to also optimize overflow-checked multiplies during SelectionDAG.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/ARM/ARMISelLowering.cpp | ||
---|---|---|
3955 ↗ | (On Diff #125819) | What about // We generate a SMUL_LOHI and then check if all the bits of the high word // are the same as the sign bit of the low word. |
4479 ↗ | (On Diff #125819) | I think this comment should be updated after this change. |
4527 ↗ | (On Diff #125819) | I think this comment should be updated after this change. |
test/CodeGen/ARM/su-addsub-overflow.ll | ||
80 ↗ | (On Diff #125819) | Looks like we are overloading a bit the name of this test file. Perhaps add a new testfile su-mul-overflow.ll instead? |
lib/Target/ARM/ARMISelLowering.cpp | ||
---|---|---|
3955 ↗ | (On Diff #125819) | That's definitely better. Thanks! |
4479 ↗ | (On Diff #125819) | Good catch! |
test/CodeGen/ARM/su-addsub-overflow.ll | ||
80 ↗ | (On Diff #125819) | Good point. I think I prefer having them all in the same file since they're testing the same sort of things, so I'll rename the file. But I can certainly split it if you think that's best. |
LGTM. Please wait a couple of days before submitting just in case @efriedma has further comments.
FWIW https://bugs.llvm.org/show_bug.cgi?id=37382 was bisected back to this revision which has shown up when we upgraded LLVM in the Rust project
Thanks @alexcrichton . I cannot login to bugzilla yet (I'd reply there instead, hope I can soon). Looks like {S,U}MUL_LOHI are expanded in Thumb1 so a stop-gap approach could be not implementing this optimisation in that subtarget.