Jan =?utf-8?q?Górski?= <jan.a.gor...@wp.pl>,
Jan =?utf-8?q?Górski?= <jan.a.gor...@wp.pl>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/133...@github.com>


================
@@ -590,6 +590,29 @@ static void EmitAtomicOp(CodeGenFunction &CGF, AtomicExpr 
*E, Address Dest,
     llvm::LoadInst *Load = CGF.Builder.CreateLoad(Ptr);
     Load->setAtomic(Order, Scope);
     Load->setVolatile(E->isVolatile());
+
+    if (CGF.CGM.getCodeGenOpts().OptimizationLevel == 0) {
+      CGF.Builder.CreateStore(Load, Dest);
+      return;
+    }
+
+    QualType Ty = E->getValueType();
+    if (!Ty->isBooleanType()) {
+      CGF.Builder.CreateStore(Load, Dest);
+      return;
----------------
efriedma-quic wrote:

Using an early return like this is weird; just stick a normal if statement 
around the code that creates the metadata.

https://github.com/llvm/llvm-project/pull/133546
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to