[PATCH] D108757: [X86][Codegen] PR51615: don't replace wide volatile load with narrow broadcast-from-memory

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 26 06:55:25 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:5049
+  return !Ld->isVolatile() ||
+         Ld->getValueSizeInBits(0) == EltVT.getScalarSizeInBits();
+}
----------------
spatel wrote:
> lebedev.ri wrote:
> > RKSimon wrote:
> > > Can you use normal and simple tests here?
> > We could, but i'm not sure we have to?
> > If the aligned load was already only loading a single element, why not promote it into broadcast?
> We are already checking ISD::isNormalLoad() by calling MayFoldLoad() first, right?
> MemSDNode::isSimple() would add a constraint for an atomic load. I'm not sure about the rules for those. A quick survey of existing uses suggests we do use that in general to be safe - see for example getBROADCAST_LOAD().
I'm vary to change that without a testcast.
Right now verified rejects vector atomic loads:
```
atomic load operand must have integer, pointer, or floating point type!
 <2 x double>  %i = load atomic <2 x double>, <2 x double>* @g0 unordered, align 16
```
so i'm not sure if there is some thing bad wrt atomics.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108757/new/

https://reviews.llvm.org/D108757



More information about the llvm-commits mailing list