Current implementation of Instruction::mayReadFromMemory() returns !doesNotAccessMemory() which is !ReadNone. This does not take into account that the writeonly attribute also indicates that the call does not read from memory.
The patch proposes to change the predicate to !doesNotReadMemory() that reflects the intended behavior.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
LGTM with minor test change
llvm/test/Transforms/EarlyCSE/writeonly.ll | ||
---|---|---|
8 | I would loosen this to just CHECK-NOT: store in case of future IR syntax changes |
I would loosen this to just CHECK-NOT: store in case of future IR syntax changes