This is an archive of the discontinued LLVM Phabricator instance.

[mips] [IAS] Fix expansion of LASym with negative offset.
AbandonedPublic

Authored by tomatabacu on Apr 29 2015, 9:16 AM.

Details

Reviewers
dsanders
Summary

If the RHS is a MCConstantExpr and we are subtracting it, we switch the MCBinaryExpr to be the
addition of the negated RHS MCConstantExpr with the unchanged LHS.

Diff Detail

Event Timeline

dsanders requested changes to this revision.Jun 1 2015, 5:49 AM
dsanders edited edge metadata.
dsanders added inline comments.
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
2646–2661

At first glance, this doesn't seem like the right thing to do. Could you explain why we can't support 'Sym - Constant'?

I suspect you may be trying to work around problems caused by the broken code on lines 2530-2555. If that's the case then we should fix the root cause instead.

test/MC/Mips/mips-expansions.s
61–76

The expression should be the same for both %hi and %lo. What happens when a carry bit crosses between bit 16 and bit 15?

This revision now requires changes to proceed.Jun 1 2015, 5:49 AM
tomatabacu updated this revision to Diff 27509.Jun 11 2015, 8:30 AM
tomatabacu edited edge metadata.

Rebased (for Sean Bruno's convenience).

tomatabacu abandoned this revision.Jun 25 2015, 6:33 AM

Abandoned because evaluateRelocExpr() needs to be rewritten anyway.