[PATCH] D118632: [Clang][OpenMP] Add the codegen support for `atomic compare`

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 21 17:54:09 PST 2022


ABataev added inline comments.


================
Comment at: clang/test/OpenMP/atomic_compare_codegen.cpp:1990
+// CHECK-NEXT:    [[DD:%.*]] = alloca double, align 8
+// CHECK-NEXT:    [[TMP0:%.*]] = load i8, i8* [[CE]], align 1
+// CHECK-NEXT:    [[TMP1:%.*]] = atomicrmw umin i8* [[CX]], i8 [[TMP0]] monotonic, align 1
----------------
tianshilei1992 wrote:
> tianshilei1992 wrote:
> > ABataev wrote:
> > > tianshilei1992 wrote:
> > > > ABataev wrote:
> > > > > tianshilei1992 wrote:
> > > > > > tianshilei1992 wrote:
> > > > > > > tianshilei1992 wrote:
> > > > > > > > I think the `store` here is redundant. Is it because I'm using `CGF.EmitScalarExpr`?
> > > > > > > Oh, shoot. `load` here, instead of `store`.
> > > > > > And here. @ABataev 
> > > > > Yes, because of EmitScalarExpr
> > > > Can we somehow avoid the `load` here?
> > > Do you need EmitScalarExpr?
> > So it is a rvalue scalar here. What alternative do we have then?
> I have to get it passed to IRBuilder, which accepts a `llvm::Value *`.
Modify irbuilder to not require it in some cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118632



More information about the cfe-commits mailing list