This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix assert failure with indexed loads.
ClosedPublic

Authored by ibadawi on Jul 5 2016, 9:18 AM.

Details

Reviewers
t.p.northover
Summary

We take the 0th result from OrOpd0, which is not necessarily correct if it
produces multiple results -- for example, in this new test case, OrOpd0 is an
indexed load, and we want the 1st result.

Fix by remembering the original SDValue instead of making a new one.

n.b. This is a fix for this assert failure:

llc: /scratch/2/llvm-upstream/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:1993: bool isBitfieldPositioningOp(llvm::SelectionDAG*, llvm::SDValue, bool, llvm::SDValue&, int&, int&): Assertion `BitWidth == 32 || BitWidth == 64' failed.
...snip...
#9 0x0000000000f7bf97 isBitfieldPositioningOp(llvm::SelectionDAG*, llvm::SDValue, bool, llvm::SDValue&, int&, int&) /scratch/2/llvm-upstream/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:1995:0
#10 0x0000000000f7cdbd tryBitfieldInsertOpFromOr(llvm::SDNode*, llvm::APInt const&, llvm::SelectionDAG*) /scratch/2/llvm-upstream/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp:2200:0

Diff Detail

Event Timeline

ibadawi updated this revision to Diff 62758.Jul 5 2016, 9:18 AM
ibadawi retitled this revision from to [AArch64] Fix assert failure with indexed loads..
ibadawi updated this object.
ibadawi added a reviewer: t.p.northover.
ibadawi added a subscriber: llvm-commits.
t.p.northover accepted this revision.Jul 5 2016, 10:08 AM
t.p.northover edited edge metadata.

This looks fine to me.

Tim.

This revision is now accepted and ready to land.Jul 5 2016, 10:08 AM

Thanks Tim. This is my first time contributing so I don't have commit access. Can you commit it for me?

ibadawi closed this revision.Jul 5 2016, 11:18 AM

Committed as r274567.