In order to avoid a number of redundant sign/zero-extensions, we have
to custom combine AssertSext on our target and fold a generic pattern
in the target independent DAG combiner for the SIGN_EXTEND_INREG node.
Depends on D10970
Paths
| Differential D16220
[mips] Fix RetCC_MipsN to promote types smaller than i64 to GPR-width. AbandonedPublic Authored by vkalintiris on Jan 15 2016, 7:09 AM.
Details
Diff Detail Event Timelinevkalintiris retitled this revision from to [mips] Fix RetCC_MipsN to promote types smaller than i64 to GPR-width.. vkalintiris updated this object. vkalintiris added a parent revision: D10970: [mips] Promote the result of SETCC nodes to GPR width.. vkalintiris added a child revision: D16221: [mips] Promote SETCC operands to i64 for 64-bit ISAs..Jan 15 2016, 7:23 AM dsanders edited edge metadata. Comment ActionsWell caught. It turns out we've been falling through to the O32 handler in some cases. There's a few changes that don't look right to me and I've commented on these below. I'd like to explain one set of the comments in advance. Up until select-flt.ll I've pointed out a number of redundant instructions. These look like regressions but it's possible that we've always emitted some of them and have just not mentioned them in the test. Could you check whether these are regressions or not?
This revision now requires changes to proceed.Jan 29 2016, 9:30 AM vkalintiris added a parent revision: D16803: Use ComputeNumSignBits to fold (sext_inreg (trunc x)) -> (trunc x).Feb 2 2016, 4:48 AM vkalintiris edited edge metadata. vkalintiris marked 23 inline comments as done. Comment ActionsAddressed Daniel's comments. As far as I can tell, almost all of our redundant sign-extensions come from the
sdardis added a child revision: D17068: [mips][microMIPS] Fix for "Cannot copy registers" assertion.Feb 18 2016, 6:08 AM
Revision Contents
Diff 44983 lib/CodeGen/SelectionDAG/DAGCombiner.cpp
lib/Target/Mips/MipsCallingConv.td
lib/Target/Mips/MipsISelLowering.cpp
test/CodeGen/Mips/atomic.ll
test/CodeGen/Mips/cconv/return.ll
test/CodeGen/Mips/delay-slot-kill.ll
test/CodeGen/Mips/fcmp.ll
test/CodeGen/Mips/llvm-ir/add.ll
test/CodeGen/Mips/llvm-ir/and.ll
test/CodeGen/Mips/llvm-ir/ashr.ll
test/CodeGen/Mips/llvm-ir/lshr.ll
test/CodeGen/Mips/llvm-ir/mul.ll
test/CodeGen/Mips/llvm-ir/or.ll
test/CodeGen/Mips/llvm-ir/ret.ll
test/CodeGen/Mips/llvm-ir/sdiv.ll
test/CodeGen/Mips/llvm-ir/select-flt.ll
test/CodeGen/Mips/llvm-ir/select-int.ll
test/CodeGen/Mips/llvm-ir/select.ll
test/CodeGen/Mips/llvm-ir/shl.ll
test/CodeGen/Mips/llvm-ir/srem.ll
test/CodeGen/Mips/llvm-ir/sub.ll
test/CodeGen/Mips/llvm-ir/udiv.ll
test/CodeGen/Mips/llvm-ir/urem.ll
test/CodeGen/Mips/llvm-ir/xor.ll
test/CodeGen/Mips/msa/basic_operations.ll
test/CodeGen/Mips/named-register-n32.ll
|
I think we can do better here. We really want to know whether the sign bit that sext_in_reg will replicate is any one of the sign-bits that ComputeNumSignBits reports so I believe the condition should be:
In any case I'd suggest posting this as a separate patch without the '[mips]' tag since this affects all targets.