This is an archive of the discontinued LLVM Phabricator instance.

[mips][FastISel] Fix code generation for logical-ops by zero-extending constant operands.
AbandonedPublic

Authored by vkalintiris on Jul 26 2015, 12:09 PM.

Details

Reviewers
dsanders
Summary

For logical operations we should materialize the zero-extension of its
constant operand. Previously, we would sign-extend the operand and
materialize that into a register.

The new constants in logopm.ll match the constants that are generated without
FastISel.

Diff Detail

Event Timeline

vkalintiris retitled this revision from to [mips][FastISel] Fix code generation for logical-ops by zero-extending constant operands..
vkalintiris updated this object.
vkalintiris added a reviewer: dsanders.
vkalintiris added a subscriber: llvm-commits.
dsanders edited edge metadata.Jul 27 2015, 6:36 AM

Could you show me the test case that required this change? The test cases in the patch aren't affected by whether the constant is sign or zero extended.

I suspect that (like an earlier bug in our fast isel involving shifts IIRC) the bug may be that an IR instruction that consumes the result of these bitwise operations is failing to emit a necessary zero extend prior to using it. For example, a comparison might not be zero extending to GPR-width before using it in setlt or similar.

vkalintiris abandoned this revision.Jul 29 2015, 7:38 AM

Abandon this review request in favour of D11592. As I explain in the new revision, this patch would simply hide the real cause of the bug.