[PATCH] D55616: Emit ASM input in a constant context

2019-04-16 Thread Kamil Rytarowski via Phabricator via cfe-commits
krytarowski added a comment. @void hi, this broke assembly code on NetBSD for various archs and blocks upgrade of the toolchain. Could you please have a look? https://bugs.llvm.org/show_bug.cgi?id=41027 Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/

[PATCH] D55616: Emit ASM input in a constant context

2019-04-16 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Herald added a project: clang. This change apparently introduced a regression: https://bugs.llvm.org/show_bug.cgi?id=41027 Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616

[PATCH] D55616: Emit ASM input in a constant context

2019-01-11 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. > Apologies - the value seems to indeed overflow, but I'm still very confused > how this was affected by this change. What's different is that `setRequiresImmediate` is being set on the constraint where before it wasn't. If no range values are supplied (like in this

[PATCH] D55616: Emit ASM input in a constant context

2019-01-11 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added a comment. Apologies - the value seems to indeed overflow, but I'm still very confused how this was affected by this change. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616

[PATCH] D55616: Emit ASM input in a constant context

2019-01-11 Thread George Karpenkov via Phabricator via cfe-commits
george.karpenkov added a comment. @void @efriedma I can't build XNU anymore after this commit, with an error message: osfmk/i386/genassym.c:298:2: error: value '18446743523953737728' out of range for constraint 'n' DECLAREULL("KERNEL_BASE", KERNEL_BASE);

[PATCH] D55616: Emit ASM input in a constant context

2018-12-18 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D55616#1335587 , @vitalybuka wrote: > Looks like it's broken by this patch > > clang: > /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/tools/clang/lib/AST/ExprConstant.cpp:11055: > llvm::APSInt

[PATCH] D55616: Emit ASM input in a constant context

2018-12-18 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Looks like it's broken by this patch clang: /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm/tools/clang/lib/AST/ExprConstant.cpp:11055: llvm::APSInt clang::Expr::EvaluateKnownConstInt(const clang::ASTContext &, SmallVectorImpl *) const: Assertion `Result &&

[PATCH] D55616: Emit ASM input in a constant context

2018-12-18 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 178793. void added a comment. Fix how prefixes are used in the testcase. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 Files: lib/Basic/TargetInfo.cpp lib/CodeGen/CGStmt.cpp

[PATCH] D55616: Emit ASM input in a constant context

2018-12-18 Thread Bill Wendling via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC349561: Emit ASM input in a constant context (authored by void, committed by ). Changed prior to commit: https://reviews.llvm.org/D55616?vs=178793=178794#toc Repository: rC Clang CHANGES SINCE LAST

[PATCH] D55616: Emit ASM input in a constant context

2018-12-18 Thread Bill Wendling via Phabricator via cfe-commits
void marked an inline comment as done. void added inline comments. Comment at: test/CodeGen/builtin-constant-p.c:2 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O2 | FileCheck --check-prefix=O2 %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown

[PATCH] D55616: Emit ASM input in a constant context

2018-12-18 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: test/CodeGen/builtin-constant-p.c:2 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O2 | FileCheck --check-prefix=O2 %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O0 | FileCheck

[PATCH] D55616: Emit ASM input in a constant context

2018-12-17 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 178582. void added a comment. Reduce duplication by using multiple check prefixes. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 Files: lib/Basic/TargetInfo.cpp

[PATCH] D55616: Emit ASM input in a constant context

2018-12-17 Thread Eli Friedman via Phabricator via cfe-commits
efriedma accepted this revision. efriedma added a comment. This revision is now accepted and ready to land. LGTM with a minor nit, but give a couple days for @jyknight to add any more comments. Comment at: test/CodeGen/builtin-constant-p.c:2 +// RUN: %clang_cc1 -triple

[PATCH] D55616: Emit ASM input in a constant context

2018-12-17 Thread Bill Wendling via Phabricator via cfe-commits
void marked an inline comment as done. void added inline comments. Comment at: test/CodeGen/builtin-constant-p.c:2 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O2 | FileCheck --check-prefix=O2 %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown

[PATCH] D55616: Emit ASM input in a constant context

2018-12-17 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: test/CodeGen/builtin-constant-p.c:2 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O2 | FileCheck --check-prefix=O2 %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s -O0 | FileCheck

[PATCH] D55616: Emit ASM input in a constant context

2018-12-17 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Ping? :-) Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D55616: Emit ASM input in a constant context

2018-12-13 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D55616#1329301 , @jyknight wrote: > This seems like a good start, but not complete. > > "n" and "i" both should require that their argument is a constant expression. > For "n", it actually must be an immediate constant integer,

[PATCH] D55616: Emit ASM input in a constant context

2018-12-13 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 178158. void added a comment. The `n` constriant *requires* a known integer. Therefore, enforce this in both Sema and CodeGen by setting the "requires immediate" flag and evaluating to a known integer instead of random "int".. This doesn't so much address `i`,

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread James Y Knight via Phabricator via cfe-commits
jyknight added a comment. This seems like a good start, but not complete. "n" and "i" both should require that their argument is a constant expression. For "n", it actually must be an immediate constant integer, so setRequiresImmediate() should be used there. For "i", you may use an lvalue

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Addressed Eli's comment. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 177936. void marked an inline comment as done. void added a comment. Don't look at the optimization level here. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616 Files:

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: lib/CodeGen/CGStmt.cpp:1825 +bool Success = false; +if (CGM.getCodeGenOpts().OptimizationLevel > 0) + Success = InputExpr->EvaluateAsInt(Result, getContext()); Checking the optimization level here doesn't

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added a reviewer: rsmith. Herald added a subscriber: cfe-commits. void added subscribers: jyknight, craig.topper. void added a comment. As a side note, the number of ways to evaluate a constant expression are legion in clang. They should really be unified...

[PATCH] D55616: Emit ASM input in a constant context

2018-12-12 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. As a side note, the number of ways to evaluate a constant expression are legion in clang. They should really be unified... Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55616/new/ https://reviews.llvm.org/D55616