[llvm] [X86]Add NO_REVERSE attribute to X86 RMW instrs in memfold table (PR #67288)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 02:49:34 PDT 2023


================
@@ -433,7 +433,9 @@ void X86FoldTablesEmitter::addEntryWithFlags(FoldTable &Table,
   // the unfolded load size will be based on the register size. If that’s bigger
   // than the memory operand size, the unfolded load will load more memory and
   // potentially cause a memory fault.
-  if (getRegOperandSize(RegOpRec) > getMemOperandSize(MemOpRec))
+  // And X86 would not unfold RMW instrs.
+  if (getRegOperandSize(RegOpRec) > getMemOperandSize(MemOpRec) ||
+      &Table == &Table2Addr)
----------------
RKSimon wrote:

Is that the best we can do? Just bailing based on which table we're emitting seems very coarse. 

https://github.com/llvm/llvm-project/pull/67288


More information about the llvm-commits mailing list