[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for FP atomics

2021-08-12 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 365855. gandhi21299 added a comment. - eliminated unsafe hardware remarks in SIISelLowering.cpp - updated cas loop remark and corresponding tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ ht

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for FP atomics

2021-08-12 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 365859. gandhi21299 added a comment. removed AMDGPU check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 Files: clang/test/CodeGenCUDA/fp-atomics-optremarks.cu

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-12 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked 2 inline comments as done. gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:631 +"at " + << (AI->getSyncScopeID() ? "system" : "single thread") + << " memory scope"); --

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-12 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:631 +"at " + << (AI->getSyncScopeID() ? "system" : "single thread") + << " memory scope"); rampitec wrote: > gandhi21299 wrote

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-12 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:631 +"at " + << (AI->getSyncScopeID() ? "system" : "single thread") + << " memory scope"); rampitec wrote: > gandhi21299 wrote

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366112. gandhi21299 added a comment. requested changes from reviewer - added memory scope tests and updated remarks and tests accordingly - still working on clang/test/CodeGenCUDA/fp-atomics-optremarks.cu and clang/test/CodeGenOpenCL/atomics-remarks-gfx9

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: clang/test/CodeGenCUDA/fp-atomics-optremarks.cu:10 + +// GFX90A-CAS: A compare and swap loop was generated for an atomic operation at system memory scope +// GFX90A-CAS-LABEL: _Z14atomic_add_casPf rampitec wrote: >

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:618 expandAtomicRMWToCmpXchg(AI, createCmpXchgInstFun); + Ctx.getSyncScopeNames(SSNs); + auto MemScope = SSNs[AI->getSyncScopeID()].empty() rampitec wrote: > Onl

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: clang/test/CodeGenCUDA/fp-atomics-optremarks.cu:10 + +// GFX90A-CAS: A compare and swap loop was generated for an atomic operation at system memory scope +// GFX90A-CAS-LABEL: _Z14atomic_add_casPf rampitec wrote: >

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked 4 inline comments as done. gandhi21299 added inline comments. Comment at: clang/test/CodeGenCUDA/fp-atomics-optremarks.cu:10 + +// GFX90A-CAS: A compare and swap loop was generated for an atomic operation at system memory scope +// GFX90A-CAS-LABEL: _Z14atomic

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366131. gandhi21299 added a comment. - corrected atomics-remarks-gfx90a.cl test to emit remark as well Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 Files: cl

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366127. gandhi21299 added a comment. - corrected remarks by replacing the operation name and updated tests accordingly - code format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://review

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366132. gandhi21299 marked 3 inline comments as done. gandhi21299 added a comment. no way to pass memory_scope in `__atomic_fetch_add(...)`, discarded the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked an inline comment as done. gandhi21299 added inline comments. Comment at: clang/test/CodeGenCUDA/fp-atomics-optremarks.cu:10 + +// GFX90A-CAS: A compare and swap loop was generated for an atomic operation at system memory scope +// GFX90A-CAS-LABEL: _Z14atomic

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked an inline comment as done. gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:585 + TLI->shouldExpandAtomicRMWInIR(AI, ORE); + OptimizationRemark Remark(DEBUG_TYPE, "Passed", AI->getFunction()); + switch (Kind) { ---

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366294. gandhi21299 added a comment. - added clang/test/CodeGenCUDA/fp-atomics-optremarks.cu back - moved `Remark` declaration into the `else` block Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/

[PATCH] D106891: [AMDGPU] [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366301. gandhi21299 added a comment. - rebased against main branch - cleaned up code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 Files: clang/test/CodeGenCU

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:622 +return OptimizationRemark(DEBUG_TYPE, "Passed", AI->getFunction()) + << "A compare and swap loop was generated for an " + << AI->getOperationName(AI->getO

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366311. gandhi21299 added a comment. - eliminated irrelevant changes to this patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 Files: llvm/lib/CodeGen/Atomi

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366338. gandhi21299 added a comment. - replaced the OpenCL test - renamed filenames - added 'atomic' to the remark and tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.or

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366349. gandhi21299 marked an inline comment as done. gandhi21299 added a comment. - adding more tests in clang/test/CodeGenOpenCL/atomics-remarks-gfx90a.cl for various scopes, memory_scope_work_item is called out as invalid by the compiler so excluded t

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366343. gandhi21299 added a comment. - removed StringExtras.h inclusion Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 Files: clang/test/CodeGenCUDA/atomics-re

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366357. gandhi21299 marked an inline comment as done. gandhi21299 added a comment. - combined all tests into one Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 F

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Thanks a lot for the review! I will merge this patch in as soon as the CI passes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGc4e5425aa579: [Remarks] Emit optimization remarks for atomics generating CAS loop (authored by gandhi21299). Repository: rG LLVM Github Monorepo

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366455. gandhi21299 added a comment. - changed type of ORE from OptimizationRemarkEmitter* to std::shared_ptr and construct it within AtomicExpandPass, this solution is implemented to address for the regressions in many backends due to prerequisite pass

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366463. gandhi21299 added a comment. Herald added a subscriber: nemanjai. - fixed breaking tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 Files: clang/te

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked an inline comment as done. gandhi21299 added a comment. @xbolva00 is concerned about Dominator Tree Construction Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. I will actually revert my changes back with only the tests updated to see if the times are reasonable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 ___

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a subscriber: nikic. gandhi21299 added a comment. Also, @nikic suggested to construct ORE here if we cannot usefully preserve them. I am not sure if preserving the information is useful though. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366467. gandhi21299 added a comment. reverting changes back to declaring ORE using `getAnalysis` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 Files: clang/te

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. @xbolva00 I timed X86/opt-pipeline.ll passes and DTC executed in 0.1% of the total compile time. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 _

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-15 Thread Anshil Gandhi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG435785214f73: [Remarks] Emit optimization remarks for atomics generating CAS loop (authored by gandhi21299). Changed prior to commit: https://reviews.llvm.org/D106891?vs=366467&id=366475#toc Repository

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Okay, sorry about that. Thanks for reverting my commit. I will use a unique_ptr and wait for another approval. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 ___

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366504. gandhi21299 added a comment. reverting type of ORE from `OptimizationRemarkEmitter * ` back to `std::unique_ptr ` and constructing it in AtomicExpand to avoid DTC and LI overhead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366507. gandhi21299 added a reviewer: nikic. gandhi21299 added a comment. - removing analysis requirement as requested + nikic Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366514. gandhi21299 added a comment. - fixing breaking tests by eliminating passes that are no longer in the pass pipelines Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.or

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366517. gandhi21299 added a comment. - eliminated changes in PowerPC/O3 -pipeline.ll, as requested Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ http

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Any ideas on what could be causing the failure in windows pre-merge checks? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 ___ cfe

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Alright, please let me know if this patch is good for merge at your convenience. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 __

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:175 + ORE = std::make_unique(&F); auto &TM = TPC->getTM(); rampitec wrote: > Is there a reason to construct it upfront and not just use a local variable > only when needed

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: llvm/lib/CodeGen/AtomicExpandPass.cpp:175 + ORE = std::make_unique(&F); auto &TM = TPC->getTM(); rampitec wrote: > gandhi21299 wrote: > > rampitec wrote: > > > Is there a reason to construct it upfront and not

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366683. gandhi21299 added a comment. - ORE does not need to be a pointer anymore, it is constructed as local variable with this patch as requested by reviewer. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Will do, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106891/new/ https://reviews.llvm.org/D106891 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://li

[PATCH] D108150: [Remarks] Emit optimization remarks for atomics generating hardware instructions

2021-08-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 created this revision. gandhi21299 added reviewers: rampitec, arsenm, b-sumner. Herald added subscribers: foad, kerbowa, jfb, hiraditya, Anastasia, nhaehnle, jvesely. gandhi21299 requested review of this revision. Herald added subscribers: llvm-commits, cfe-commits, wdng. Herald added

[PATCH] D106891: [Remarks] Emit optimization remarks for atomics generating CAS loop

2021-08-17 Thread Anshil Gandhi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf22ba5187350: [Remarks] Emit optimization remarks for atomics generating CAS loop (authored by gandhi21299). Changed prior to commit: https://reviews.llvm.org/D106891?vs=366683&id=366735#toc Repository

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-17 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366751. gandhi21299 added a comment. - added more tests - addressed feedback from reviewer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 Files: clang/test/Cod

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-17 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366752. gandhi21299 added a comment. - corrected an argument in AtomicExpand pass Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 Files: clang/test/CodeGenOpenC

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-17 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked 5 inline comments as done. gandhi21299 added inline comments. Comment at: clang/test/CodeGenOpenCL/atomics-remarks-gfx90a.cl:9 +// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -triple=amdgcn-amd-amdhsa -target-cpu gfx90a \ +// RUN: -Rpass=si-lower -munsafe-fp-atomi

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-17 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366765. gandhi21299 marked 2 inline comments as done. gandhi21299 added a comment. - split the OpenCL test into two for brevity - fixed a mistake in SIISelLowering as pointed out by reviewer - added the missing -munsafe-fp-atomics flag Repository: rG L

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-17 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-17 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked 3 inline comments as done. gandhi21299 added inline comments. Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:12195 + if (!fpModeMatchesGlobalFPAtomicMode(RMW)) +return reportUnsafeHWInst(RMW, AtomicExpansionKind::None); ra

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 366958. gandhi21299 added a comment. - requested changes from reviewer Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 Files: clang/test/CodeGenOpenCL/atomics-c

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 367000. gandhi21299 marked an inline comment as done. gandhi21299 added a comment. - corrected AtomicExpansionKind return value in SIISelLowering as pointed out by reviewer - eliminated previous function declaration which is not defined/used anymore Rep

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. @rampitec Which part of the logic is wrong? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 ___ cfe-commits mailing list cfe-commit

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. My understanding is that since we are reporting unsafe expansion into hw instructions, `fpModeMatchesGlobalFPAtomicMode(RMW)` must be false to match the logic. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 367042. gandhi21299 added a comment. - corrected logic for ORE in SIISelLowering.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 Files: clang/test/CodeGenOp

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 367273. gandhi21299 marked an inline comment as done. gandhi21299 added a comment. - code refactor Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 Files: clang/

[PATCH] D108150: [Remarks] [AMDGPU] Emit optimization remarks for atomics generating hardware instructions

2021-08-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked an inline comment as done. gandhi21299 added a comment. Thanks for the review, I will merge this in as soon as the CI passes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108150/new/ https://reviews.llvm.org/D108150 ___

[PATCH] D92956: Fix range-loop-analysis checks for trivial copyability

2021-02-25 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. I tried to implement a fix by using the `hasCopyAssignmentWithConstParam()` method (instead of `hasNonTrivialCopyConstructor()`), the same test fails. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92956/new/ https://re

[PATCH] D113925: [HIP] Add HIP scope atomic operations

2021-11-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 created this revision. gandhi21299 added reviewers: yaxunl, b-sumner, t-tye, tra, rjmccall. Herald added subscribers: dexonsmith, Anastasia. gandhi21299 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Add an AtomicScopeModel for

[PATCH] D113925: [HIP] Add HIP scope atomic operations

2021-11-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 387395. gandhi21299 added a comment. clang-formatted code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113925/new/ https://reviews.llvm.org/D113925 Files: clang/include/clang/AST/Expr.h clang/include/

[PATCH] D113925: [HIP] Add HIP scope atomic operations

2021-11-15 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 387396. gandhi21299 added a comment. reapplied clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113925/new/ https://reviews.llvm.org/D113925 Files: clang/include/clang/AST/Expr.h clang/includ

[PATCH] D113925: [HIP] Add HIP scope atomic operations

2021-11-16 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 387668. gandhi21299 marked an inline comment as done. gandhi21299 added a comment. - removed debug code - some macro definitions need to be defined for HIP-only compilation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

[PATCH] D113925: [HIP] Add HIP scope atomic operations

2021-11-18 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. @yaxunl thanks for the review! My Github account is locked unfortunately so I will have to ask you to push this commit to the main branch. Thank you! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113925/new/ https://re

[PATCH] D92956: Fix range-loop-analysis checks for trivial copyability

2021-11-21 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 accepted this revision. gandhi21299 added a comment. This revision is now accepted and ready to land. LGTM, thanks for the bug fix! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92956/new/ https://reviews.llvm.org/D92956 __

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-24 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 created this revision. gandhi21299 added reviewers: yaxunl, b-sumner, t-tye, tra, rjmccall. gandhi21299 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Introduce __hip_atomic_load, __hip_atomic_store and __hip_atomic_compare_ex

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-24 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 389577. gandhi21299 added a comment. removed changes in atomic-ops.cl, CUDA test may be sufficient. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114553/new/ https://reviews.llvm.org/D114553 Files: clang

[PATCH] D113925: [HIP] Add HIP scope atomic operations

2021-11-24 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:5587 // the GNU atomics specification, but we enforce it, because if we didn't it // would be very confusing. FIXME: For whom? How so? Diag(ExprRange.getBegin(), diag::err_atomic_op_ne

[PATCH] D113925: [HIP] Add HIP scope atomic operations

2021-11-24 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:5587 // the GNU atomics specification, but we enforce it, because if we didn't it // would be very confusing. FIXME: For whom? How so? Diag(ExprRange.getBegin(), diag::err_atomic_op_ne

[PATCH] D114025: [clang][NFC] Inclusive terms: replace some uses of sanity in clang

2021-11-24 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: clang/lib/Sema/SemaChecking.cpp:5536 +// GCC does not enforce these rules for GNU atomics, but we do, because if +// we didn't it would be very confusing. FIXME: For whom? How so? auto IsAllowedValueType = [&](QualType

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-25 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 389833. gandhi21299 added a comment. - added order argument in the builtins and changed the tests accordingly - adding Sema test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114553/new/ https://reviews.llv

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-25 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 389834. gandhi21299 added a comment. - applied clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114553/new/ https://reviews.llvm.org/D114553 Files: clang/include/clang/AST/Expr.h clang/includ

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-25 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Passed internal CI Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114553/new/ https://reviews.llvm.org/D114553 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-26 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 390093. gandhi21299 added a comment. addressed feedback including - correction of function signatures - checking for order combinations - correcting expected store atomic instruction - using predefined macros for memory order Repository: rG LLVM Githu

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-26 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 390094. gandhi21299 added a comment. applied clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114553/new/ https://reviews.llvm.org/D114553 Files: clang/include/clang/AST/Expr.h clang/include/

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-29 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 390377. gandhi21299 added a comment. - replaced integers with memory order macros in SemaCUDA/atomic-ops.cu Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114553/new/ https://reviews.llvm.org/D114553 Files:

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-29 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Thanks for the review, I will merge this patch in. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114553/new/ https://reviews.llvm.org/D114553 ___ cfe-commits mailing list cfe

[PATCH] D114553: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in HIP-clang

2021-11-29 Thread Anshil Gandhi via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdf0560ca0018: [HIP] Add atomic load, atomic store and atomic cmpxchng_weak builtin support in… (authored by gandhi21299). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews

[PATCH] D146840: [AMDGPU] Replace target feature for global fadd32

2023-03-24 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 created this revision. gandhi21299 added reviewers: foad, arsenm, rampitec, Joe_Nash. Herald added subscribers: kosarev, StephenFan, kerbowa, tpr, dstuttard, yaxunl, jvesely, kzhuravl. Herald added a project: All. gandhi21299 requested review of this revision. Herald added subscribers:

[PATCH] D146840: [AMDGPU] Replace target feature for global fadd32

2023-03-28 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 509066. gandhi21299 added a comment. - gfx908 does not support return version of the builtin Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146840/new/ https://reviews.llvm.org/D146840 Files: clang/includ

[PATCH] D146840: [AMDGPU] Replace target feature for global fadd32

2023-03-28 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 509067. gandhi21299 added a comment. - removed builtins-amdgcn-gfx908.cl Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146840/new/ https://reviews.llvm.org/D146840 Files: clang/include/clang/Basic/Builti

[PATCH] D146840: [AMDGPU] Replace target feature for global fadd32

2023-03-28 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 509127. gandhi21299 added a comment. - Adding tests for gfx90a and gfx940 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146840/new/ https://reviews.llvm.org/D146840 Files: clang/include/clang/Basic/Built

[PATCH] D146840: [AMDGPU] Replace target feature for global fadd32

2023-03-28 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Sounds good, thanks the review @rampitec Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D146840/new/ https://reviews.llvm.org/D146840 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D146840: [AMDGPU] Replace target feature for global fadd32

2023-03-28 Thread Anshil Gandhi via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa955a3189637: [AMDGPU] Replace target feature for global fadd32 (authored by gandhi21299). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D99812: [PowerPC] [GlobalISel] Implementation of formal arguments lowering in the IRTranslator for the PPC backend

2021-04-09 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. @arsenm Yea, I am sorry about that. Looks like I am still not using arc properly Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99812/new/ https://reviews.llvm.org/D99812 ___

[PATCH] D99812: [PowerPC] [GlobalISel] Implementation of formal arguments lowering in the IRTranslator for the PPC backend

2021-04-09 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 336249. gandhi21299 added a comment. - enclosing classes in PPCCallLowering,h within the llvm namespace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99812/new/ https://reviews.llvm.org/D99812 Files: llv

[PATCH] D99812: [PowerPC] [GlobalISel] Implementation of formal arguments lowering in the IRTranslator for the PPC backend

2021-04-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 marked 2 inline comments as done. gandhi21299 added a comment. I am looking towards more feedback on this patch, please do follow up at your convenience. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99812/new/ https://reviews.llvm.org

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-10-08 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 377922. gandhi21299 added a comment. refreshing patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109707/new/ https://reviews.llvm.org/D109707 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/test/

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-10-08 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 378218. gandhi21299 added a comment. added -nogpulib and -nogpuinc flags to amdgpu-alias-undef-symbols.cu Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109707/new/ https://reviews.llvm.org/D109707 Files:

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-10-08 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109707/new/ https://reviews.llvm.org/D109707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-10-08 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Passed internal CI Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109707/new/ https://reviews.llvm.org/D109707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-10-12 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added inline comments. Comment at: llvm/test/CodeGen/AMDGPU/inline-calls.ll:3 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck %s -; RUN: llc -march=r600 -mcpu=redwood -verify-machineinstrs < %s | FileCheck %s @tstellar

[PATCH] D111734: [HIP] Relax conditions for address space cast in builtin args

2021-10-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 created this revision. gandhi21299 added a reviewer: yaxunl. gandhi21299 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Allow (implicit) address space casting between LLVM-equivalent target address spaces. Repository: rG LL

[PATCH] D111734: [HIP] Relax conditions for address space cast in builtin args

2021-10-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 379419. gandhi21299 added a comment. removed irrelevant lines in the test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111734/new/ https://reviews.llvm.org/D111734 Files: clang/lib/Sema/SemaExpr.cpp c

[PATCH] D111734: [HIP] Relax conditions for address space cast in builtin args

2021-10-13 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 379444. gandhi21299 marked an inline comment as done. gandhi21299 added a comment. adding codegen test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111734/new/ https://reviews.llvm.org/D111734 Files: cl

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-10-14 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 updated this revision to Diff 379530. gandhi21299 added a comment. add a restrictions to what architecture AlwaysInliner should run on, updated the inline-calls.ll test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109707/new/ https:/

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-10-14 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Passed ePSDB Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109707/new/ https://reviews.llvm.org/D109707 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.

[PATCH] D111734: [HIP] Relax conditions for address space cast in builtin args

2021-10-14 Thread Anshil Gandhi via Phabricator via cfe-commits
gandhi21299 added a comment. Passed internal CI, still working on a Sema test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111734/new/ https://reviews.llvm.org/D111734 ___ cfe-commits mailing list cfe-

<    1   2   3   >