https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/145031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi updated
https://github.com/llvm/llvm-project/pull/145031
>From 54296ceadcdf59136f68c1e3132a2528396361d4 Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi
Date: Fri, 20 Jun 2025 01:35:38 +
Subject: [PATCH 1/3] [WPD]: Apply speculative WPD in non-lto mode.
- This p
@@ -2437,8 +2486,12 @@ bool DevirtModule::run() {
.WPDRes[S.first.ByteOffset];
if (tryFindVirtualCallTargets(TargetsForSlot, TypeMemberInfos,
S.first.ByteOffset, ExportSummary)) {
-
- if (!trySingleImplDevirt(ExportSum
@@ -1333,10 +1376,11 @@ bool DevirtModule::trySingleImplDevirt(
if (!IsExported)
return false;
- // If the only implementation has local linkage, we must promote to external
- // to make it visible to thin LTO objects. We can only get here during the
- // ThinLTO expo
@@ -0,0 +1,130 @@
+; -stats requires asserts
+; REQUIRES: asserts
+
+; Check that we can still devirtualize outside LTO mode
+; Check that we skip devirtualization for empty functions outside LTO mode
+
+; RUN: opt -S -passes=wholeprogramdevirt -wholeprogramdevirt-nolto
-pass-rem
@@ -1112,6 +1150,11 @@ bool DevirtModule::tryFindVirtualCallTargets(
// calls to pure virtuals are UB.
if (Fn->getName() == "__cxa_pure_virtual")
continue;
+// In Most cases empty functions will be overridden by the
hassnaaHamdi wrote:
fixed
@@ -1112,6 +1150,11 @@ bool DevirtModule::tryFindVirtualCallTargets(
// calls to pure virtuals are UB.
if (Fn->getName() == "__cxa_pure_virtual")
continue;
+// In Most cases empty functions will be overridden by the
+// implementation of the derived class,
@@ -1091,10 +1127,12 @@ bool DevirtModule::tryFindVirtualCallTargets(
if (!TM.Bits->GV->isConstant())
return false;
-// We cannot perform whole program devirtualization analysis on a vtable
-// with public LTO visibility.
-if (TM.Bits->GV->getVCallVisibil
@@ -794,10 +812,28 @@ PreservedAnalyses WholeProgramDevirtPass::run(Module &M,
return FAM.getResult(F);
};
if (UseCommandLine) {
+if (TestNoLTOMode)
+ // we are outside LTO mode. enable speculative devirtualization:
+ DevirtCheckMode = WPDCheckMode::Fallba
@@ -48,6 +49,13 @@
// is supported.
// - Import phase: (same as with hybrid case above).
//
+// In non-LTO mode:
+// - The pass apply speculative devirtualization without requiring any type of
+// visibility.
+// - Skips other features like virtual constant propagation, unifo
@@ -1629,6 +1630,23 @@
PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
if (!LTOPreLink)
MPM.addPass(RelLookupTableConverterPass());
+ if (PTO.WholeProgramDevirt && LTOPhase == ThinOrFullLTOPhase::None) {
hassnaaHamdi wrote:
I hav
@@ -7847,8 +7847,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction
&JA,
IsDeviceOffloadAction ? D.getLTOMode() : D.getOffloadLTOMode();
auto OtherIsUsingLTO = OtherLTOMode != LTOK_None;
-if ((!IsUsingLTO && !OtherIsUsingLTO) ||
-(IsPS4 &&
@@ -1359,7 +1359,8 @@ void CodeGenModule::EmitVTableTypeMetadata(const
CXXRecordDecl *RD,
// Emit type metadata on vtables with LTO or IR instrumentation.
// In IR instrumentation, the type metadata is used to find out vtable
// definitions (for type profiling) among all
https://github.com/hassnaaHamdi updated
https://github.com/llvm/llvm-project/pull/145031
>From 54296ceadcdf59136f68c1e3132a2528396361d4 Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi
Date: Fri, 20 Jun 2025 01:35:38 +
Subject: [PATCH 1/2] [WPD]: Apply speculative WPD in non-lto mode.
- This p
https://github.com/hassnaaHamdi updated
https://github.com/llvm/llvm-project/pull/145031
>From 54296ceadcdf59136f68c1e3132a2528396361d4 Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi
Date: Fri, 20 Jun 2025 01:35:38 +
Subject: [PATCH 1/2] [WPD]: Apply speculative WPD in non-lto mode.
- This p
@@ -0,0 +1,56 @@
+// Check that speculative devirtualization works without the need for LTO or
visibility.
hassnaaHamdi wrote:
I have separated the tests.
For testing using non-LTO pass pipeline, that will be postponed until I enable
the WPD by default.
https:
@@ -1629,6 +1630,23 @@
PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
if (!LTOPreLink)
MPM.addPass(RelLookupTableConverterPass());
+ if (PTO.WholeProgramDevirt && LTOPhase == ThinOrFullLTOPhase::None) {
+MPM.addPass(WholeProgramDevirtPass(/*E
@@ -1629,6 +1630,23 @@
PassBuilder::buildModuleOptimizationPipeline(OptimizationLevel Level,
if (!LTOPreLink)
MPM.addPass(RelLookupTableConverterPass());
+ if (PTO.WholeProgramDevirt && LTOPhase == ThinOrFullLTOPhase::None) {
hassnaaHamdi wrote:
Hi Te
hassnaaHamdi wrote:
hola! @teresajohnson @pcc
https://github.com/llvm/llvm-project/pull/145031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hassnaaHamdi wrote:
Hi @teresajohnson @pcc
Iād be grateful for your feedback.
https://github.com/llvm/llvm-project/pull/145031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/145031
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hassnaaHamdi wrote:
Some of the open issues related to devirtualization, the WPD pass doesn't get
any GVs out of them, as a result it doesn't work. For such issues, I think WPD
can't help them by any chance. Maybe it's a Clang problem.
https://github.com/llvm/llvm-project/pull/145031
_
hassnaaHamdi wrote:
About the failing test, after modifying the Microsoft ABI to allow emitting
vtable MD -similarly to what I did for Itanium ABI-, I found out that the
GlobalOpt pass can't eliminate the generated unused Vtable aliases because
their linkage is `ExternalLinkage` which is expli
https://github.com/hassnaaHamdi created
https://github.com/llvm/llvm-project/pull/145031
- This patch applies speculative devirtualization in non-lto mode where
visibility is not needed.
- It's still safe to devirtualize becasue we do speculation.
- In non-lto mode, only speculative devirtualiz
hassnaaHamdi wrote:
> > Hi @teresajohnson what do you think? For the case of PGO, I think we may
> > disable it. I think The speculative devirtualization is useful for cases
> > where we don't have enough information.
>
> Yes I think the spec results are promising. I'd suggest also trying with
hassnaaHamdi wrote:
Hi @teresajohnson
what do you think?
For the case of PGO, I think we may disable it. I think The speculative
devirtualization is useful for cases where we don't have enough information.
https://github.com/llvm/llvm-project/pull/141777
__
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hassnaaHamdi wrote:
> This is an interesting idea, thanks for the performance numbers. It could
> also be useful for LTO without whole program visibility enabled, where most
> of the vtables and type tests will end up with public visibility making them
> ineligible for WPD. But I suspect it ma
hassnaaHamdi wrote:
> This is an interesting idea, thanks for the performance numbers. It could
> also be useful for LTO without whole program visibility enabled, where most
> of the vtables and type tests will end up with public visibility making them
> ineligible for WPD. But I suspect it ma
hassnaaHamdi wrote:
Hi
@teresajohnson @pcc @PiJoules @mingmingl-llvm
Any feedback about this? š
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi deleted
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1342,26 +1353,28 @@ bool DevirtModule::trySingleImplDevirt(
// If the only implementation has local linkage, we must promote to external
// to make it visible to thin LTO objects. We can only get here during the
// ThinLTO export phase.
hassnaaHamdi w
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/141777
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi created
https://github.com/llvm/llvm-project/pull/141777
None
>From 702f64a84914d2fe467a12babd99338f2215d425 Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi
Date: Wed, 28 May 2025 14:27:34 +
Subject: [PATCH] Enable WPD without lto
---
clang/lib/CodeGen/CGVTab
https://github.com/hassnaaHamdi closed
https://github.com/llvm/llvm-project/pull/93495
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -118,6 +124,37 @@ llvm::Type *CodeGenTypes::ConvertTypeForMem(QualType T,
bool ForBitField) {
return R;
}
+bool CodeGenTypes::LLVMTypeLayoutMatchesAST(QualType ASTTy,
+llvm::Type *LLVMTy) {
+ CharUnits ASTSize = Context.getTyp
https://github.com/hassnaaHamdi updated
https://github.com/llvm/llvm-project/pull/93495
>From e3f080d3b6b355e0726bc0058129ddd3066dbb2e Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi
Date: Tue, 28 May 2024 01:04:00 +
Subject: [PATCH] [Clang][AArch64][ARM]: Fix Inefficient loads/stores of
_Bit
https://github.com/hassnaaHamdi updated
https://github.com/llvm/llvm-project/pull/93495
>From 6b7cc14e5dcca7416c549bd156585e2a61d4d883 Mon Sep 17 00:00:00 2001
From: Hassnaa Hamdi
Date: Tue, 28 May 2024 01:04:00 +
Subject: [PATCH] [Clang][AArch64][ARM]: Fix Inefficient loads/stores of
_Bit
https://github.com/hassnaaHamdi created
https://github.com/llvm/llvm-project/pull/93495
- Update clang codegen for loads/stores to read/write the legal in-memory
representation for _BitInt(N <= 128) and _BitInt(N <= 64).
- AArch64: for _BitInt(N <= 128) the machine type is the smallest (un)sign
https://github.com/hassnaaHamdi closed
https://github.com/llvm/llvm-project/pull/90105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/90105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/hassnaaHamdi edited
https://github.com/llvm/llvm-project/pull/90105
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -458,6 +458,40 @@ let TargetGuard = "sme2,sme-f64f64" in {
def SVMLS_LANE_VG1x4_F64 : Inst<"svmls_lane_za64[_{d}]_vg1x4", "vm4di", "d",
MergeNone, "aarch64_sme_fmls_lane_vg1x4", [IsStreaming, IsInOutZA],
[ImmCheck<3, ImmCheck0_1>]>;
}
+let TargetGuard = "sme2p1,sme-f16f
@@ -173,6 +173,8 @@ enum ArchExtKind : unsigned {
AEK_SMEF8F16 = 69, // FEAT_SME_F8F16
AEK_SMEF8F32 = 70, // FEAT_SME_F8F32
AEK_SMEFA64 = 71, // FEAT_SME_FA64
+ AEK_JSCVT = 72, // FEAT_JSCVT
+ AEK_FCMA = 73, // FEAT_FCMA
48 matches
Mail list logo