[SystemZ] Do not use LOC(G) for volatile loads
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 25 Oct 2016 15:39:15 +0000 (15:39 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 25 Oct 2016 15:39:15 +0000 (15:39 +0000)
commit7bdb485e1841ceb8421a1d9e62cf120b9b77f527
tree60a86aa69b26ef9080229743749ccb7d37cde977
parent91cc4a6503fee173c303e510ebc2183b4e7bc29b
[SystemZ] Do not use LOC(G) for volatile loads

It is not safe to use LOAD ON CONDITION to implement access to a memory
location marked "volatile", since the architecture leaves it unspecified
whether or not an access happens if the condition is false.

The current code already appears to care about that:
  def LOC  : CondUnaryRSY<"loc",  0xEBF2, nonvolatile_load, GR32, 4>;

Unfortunately, that "nonvolatile_load" operator is simply ignored
by the CondUnaryRSY class, and there was no test to catch it.

llvm-svn: 285077
llvm/lib/Target/SystemZ/SystemZInstrFormats.td
llvm/test/CodeGen/SystemZ/cond-load-01.ll
llvm/test/CodeGen/SystemZ/cond-load-02.ll