[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-22 Thread Michele Scandale via cfe-commits
https://github.com/michele-scandale closed https://github.com/llvm/llvm-project/pull/136038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-21 Thread Michele Scandale via cfe-commits
https://github.com/michele-scandale updated https://github.com/llvm/llvm-project/pull/136038 >From 359e31eece5b7ddf4a62074a67947c31f4538ed1 Mon Sep 17 00:00:00 2001 From: Michele Scandale Date: Mon, 21 Apr 2025 12:47:10 -0700 Subject: [PATCH] [clang] Rework `hasBooleanRepresentation`. This is

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-18 Thread Michele Scandale via cfe-commits
https://github.com/michele-scandale updated https://github.com/llvm/llvm-project/pull/136038 >From 17e73775bf3acdece21c5bcd6ce6b5340e5c6f12 Mon Sep 17 00:00:00 2001 From: Michele Scandale Date: Thu, 17 Apr 2025 13:30:04 -0700 Subject: [PATCH] [clang] Rework `hasBooleanRepresentation`. This is

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-18 Thread Michele Scandale via cfe-commits
@@ -2088,13 +2085,22 @@ llvm::Value *CodeGenFunction::EmitToMemory(llvm::Value *Value, QualType Ty) { Value = Builder.CreateBitCast(Value, StoreTy); } + if (Ty->hasBooleanRepresentation() || Ty->isBitIntType()) { michele-scandale wrote: I'll double ch

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-17 Thread Michele Scandale via cfe-commits
@@ -8623,6 +8624,13 @@ inline bool Type::isIntegralOrEnumerationType() const { inline bool Type::isBooleanType() const { if (const auto *BT = dyn_cast(CanonicalType)) return BT->getKind() == BuiltinType::Bool; + if (const EnumType *ET = dyn_cast(CanonicalType)) { +//

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-17 Thread Michele Scandale via cfe-commits
michele-scandale wrote: Putting aside for now the naming issue (https://github.com/llvm/llvm-project/pull/136038#discussion_r2049703902), is there anything left for the changes proposed in this PR? https://github.com/llvm/llvm-project/pull/136038 ___

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-17 Thread Michele Scandale via cfe-commits
@@ -8623,6 +8624,13 @@ inline bool Type::isIntegralOrEnumerationType() const { inline bool Type::isBooleanType() const { if (const auto *BT = dyn_cast(CanonicalType)) return BT->getKind() == BuiltinType::Bool; + if (const EnumType *ET = dyn_cast(CanonicalType)) { +//

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-17 Thread Michele Scandale via cfe-commits
@@ -8623,6 +8624,13 @@ inline bool Type::isIntegralOrEnumerationType() const { inline bool Type::isBooleanType() const { if (const auto *BT = dyn_cast(CanonicalType)) return BT->getKind() == BuiltinType::Bool; + if (const EnumType *ET = dyn_cast(CanonicalType)) { +//

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-17 Thread Michele Scandale via cfe-commits
@@ -2336,16 +2336,9 @@ bool Type::isArithmeticType() const { } bool Type::hasBooleanRepresentation() const { - if (isBooleanType()) -return true; - - if (const EnumType *ET = getAs()) -return ET->getDecl()->getIntegerType()->isBooleanType(); - - if (const AtomicType

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-16 Thread Michele Scandale via cfe-commits
@@ -8623,6 +8624,13 @@ inline bool Type::isIntegralOrEnumerationType() const { inline bool Type::isBooleanType() const { if (const auto *BT = dyn_cast(CanonicalType)) return BT->getKind() == BuiltinType::Bool; + if (const EnumType *ET = dyn_cast(CanonicalType)) { ---

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-16 Thread Michele Scandale via cfe-commits
@@ -8623,6 +8624,13 @@ inline bool Type::isIntegralOrEnumerationType() const { inline bool Type::isBooleanType() const { if (const auto *BT = dyn_cast(CanonicalType)) return BT->getKind() == BuiltinType::Bool; + if (const EnumType *ET = dyn_cast(CanonicalType)) { ---

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-16 Thread Michele Scandale via cfe-commits
https://github.com/michele-scandale edited https://github.com/llvm/llvm-project/pull/136038 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor CodeGen's hasBooleanRepresentation (PR #134159)

2025-04-16 Thread Michele Scandale via cfe-commits
michele-scandale wrote: See https://github.com/llvm/llvm-project/pull/136038 https://github.com/llvm/llvm-project/pull/134159 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Rework `hasBooleanRepresentation`. (PR #136038)

2025-04-16 Thread Michele Scandale via cfe-commits
https://github.com/michele-scandale created https://github.com/llvm/llvm-project/pull/136038 This is a follow-up of 13aac46332f607a38067b5ddd466071683b8c255. This commit adjusts the implementation of `hasBooleanRepresentation` to have a similar behavior as the one of `hasIntegerRepresentation`

[clang] [clang][NFC] Refactor CodeGen's hasBooleanRepresentation (PR #134159)

2025-04-16 Thread Michele Scandale via cfe-commits
michele-scandale wrote: > There is already a precedent (hasPointerRepresentation) for not including > vectors You cannot have vectors of pointers in the C/C++ extensions for vector types. > Also, vectors of Booleans have different considerations that scalar Booleans. > For instance, they are

[clang] [clang][NFC] Refactor CodeGen's hasBooleanRepresentation (PR #134159)

2025-04-15 Thread Michele Scandale via cfe-commits
michele-scandale wrote: Given that there are already similar functions in the `Type` class -- e.g. `has{Signed,Unsigned,}IntegerRepresentation`, `hasFloatingRepresentation` -- it seems a bit inconsistent the definition of `hasBooleanRepresentation`. I would expect that "vector of booleans" to

[clang] [CodeGen] Do not emit call site attributes for LLVM intrinsics. (PR #116881)

2024-11-20 Thread Michele Scandale via cfe-commits
michele-scandale wrote: I understand this is not something recommended. Still there is already code like the one in https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CodeGenModule.cpp#L2887-L2892 ``` void CodeGenModule::SetFunctionAttributes(GlobalDecl GD, llvm::Function *F,

[clang] [CodeGen] Do not emit call site attributes for LLVM intrinsics. (PR #116881)

2024-11-19 Thread Michele Scandale via cfe-commits
https://github.com/michele-scandale closed https://github.com/llvm/llvm-project/pull/116881 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CodeGen] Do not emit call site attributes for LLVM intrinsics. (PR #116881)

2024-11-19 Thread Michele Scandale via cfe-commits
michele-scandale wrote: > Anything we do to make this work better risks being interpreted as treating > this as somehow supported, which it absolutely is not. Alright. I guess I'll close this PR. https://github.com/llvm/llvm-project/pull/116881 ___ c

[clang] [CodeGen] Do not emit call site attributes for LLVM intrinsics. (PR #116881)

2024-11-19 Thread Michele Scandale via cfe-commits
https://github.com/michele-scandale created https://github.com/llvm/llvm-project/pull/116881 When a function is declared with the `asm(...)` attribute to change the mangled name to reference a LLVM intrinsic, the AST->IR translation for the function declaration already skips any function/param

[clang] b7d7c44 - Fix `unsafe-fp-math` attribute emission.

2022-11-14 Thread Michele Scandale via cfe-commits
Author: Michele Scandale Date: 2022-11-14T20:40:57-08:00 New Revision: b7d7c448df9a4679c1dfa079911f863e32d8e41f URL: https://github.com/llvm/llvm-project/commit/b7d7c448df9a4679c1dfa079911f863e32d8e41f DIFF: https://github.com/llvm/llvm-project/commit/b7d7c448df9a4679c1dfa079911f863e32d8e41f.di

[clang] c49cde6 - [Sema] Fix `ExtVectorElementExpr` tree transform for the `isArrow` case.

2022-10-11 Thread Michele Scandale via cfe-commits
Author: Michele Scandale Date: 2022-10-11T13:29:20-07:00 New Revision: c49cde6467f9bf200640db763152a9dc7f009520 URL: https://github.com/llvm/llvm-project/commit/c49cde6467f9bf200640db763152a9dc7f009520 DIFF: https://github.com/llvm/llvm-project/commit/c49cde6467f9bf200640db763152a9dc7f009520.di