This extends my previous patches to also optimize overflow-checked multiplies during SelectionDAG.
Details
Diff Detail
Event Timeline
lib/Target/ARM/ARMISelLowering.cpp | ||
---|---|---|
3955 | 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 | I think this comment should be updated after this change. | |
4527 | I think this comment should be updated after this change. | |
test/CodeGen/ARM/su-addsub-overflow.ll | ||
80 | 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 | That's definitely better. Thanks! | |
4479 | Good catch! | |
test/CodeGen/ARM/su-addsub-overflow.ll | ||
80 | 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.
What about