Preserve the order of READ_REGISTER and WRITE_REGISTER
authorHal Finkel <hfinkel@anl.gov>
Mon, 18 May 2015 16:42:10 +0000 (16:42 +0000)
committerHal Finkel <hfinkel@anl.gov>
Mon, 18 May 2015 16:42:10 +0000 (16:42 +0000)
commit292c78ba6815c844a23d8aa42982b7cc8bdad2f9
tree39042c58c6afbc808ede16294c2fc297d4dfa4d3
parent0139af335f59db0d614d6d9b97a53c7e4f60b2c7
Preserve the order of READ_REGISTER and WRITE_REGISTER

At the present time, we don't have a way to represent general dependency
relationships, so everything is represented using memory dependency. In order
to preserve the data dependency of a READ_REGISTER on WRITE_REGISTER, we need
to model WRITE_REGISTER as writing (which we had been doing) and model
READ_REGISTER as reading (which we had not been doing). Fix this, and also the
way that the chain operands were generated at the SDAG level.

Patch by Nicholas Paul Johnson, thanks! Test case by me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237584 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Intrinsics.td
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
test/Transforms/EarlyCSE/read-reg.ll [new file with mode: 0644]