tstellar added inline comments.
Comment at: cfe/trunk/lib/Basic/Targets.cpp:2037-2038
-static const LangAS::Map AMDGPUPrivateIsZeroMap = {
-4, // Default
-1, // opencl_global
-3, // opencl_local
-2, // opencl_constant
-4, // opencl_generic
-1, // c
This revision was automatically updated to reflect the committed changes.
Closed by commit rL303370: CodeGen: Cast alloca to expected address space
(authored by yaxunl).
Changed prior to commit:
https://reviews.llvm.org/D32248?vs=99204&id=99479#toc
Repository:
rL LLVM
https://reviews.llvm.o
yaxunl added a comment.
Any further comments? Thanks.
https://reviews.llvm.org/D32248
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
Looks great, thank you for being patient.
https://reviews.llvm.org/D32248
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://list
yaxunl added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7294
llvm::PointerType *T, QualType QT) const override;
+
};
yaxunl wrote:
> rjmccall wrote:
> > Spurious newline?
> will remove it.
Sorry this line is needed to separate it from the nex
yaxunl updated this revision to Diff 99204.
yaxunl marked 4 inline comments as done.
yaxunl added a comment.
Herald added a subscriber: nhaehnle.
Removed special handling of OpenCL from getTargetAddressSpace.
https://reviews.llvm.org/D32248
Files:
include/clang/AST/ASTContext.h
include/clan
yaxunl marked 14 inline comments as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CodeGenTypes.cpp:95
-
/// isRecordLayoutComplete - Return true if the specified type is already
Anastasia wrote:
> Why this change?
Will undo it.
rjmccall added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:411
+CodeGen::CodeGenFunction &CGF, llvm::Value *Src, unsigned SrcAddr,
+unsigned DestAddr, llvm::Type *DestTy, bool isNonNull) const {
// Since target may map different address spaces in AST to the
Anastasia added inline comments.
Comment at: lib/CodeGen/CodeGenTypes.cpp:95
-
/// isRecordLayoutComplete - Return true if the specified type is already
Why this change?
Comment at: lib/CodeGen/TargetInfo.cpp:411
+CodeGen::CodeGenFunctio
rjmccall added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7296
+ unsigned getASTAllocaAddressSpace() const override {
+return LangAS::Count + getABIInfo().getDataLayout().getAllocaAddrSpace();
+ }
yaxunl wrote:
> rjmccall wrote:
> > yaxunl wrot
yaxunl added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7296
+ unsigned getASTAllocaAddressSpace() const override {
+return LangAS::Count + getABIInfo().getDataLayout().getAllocaAddrSpace();
+ }
rjmccall wrote:
> yaxunl wrote:
> > rjmccall wrot
rjmccall added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7296
+ unsigned getASTAllocaAddressSpace() const override {
+return LangAS::Count + getABIInfo().getDataLayout().getAllocaAddrSpace();
+ }
yaxunl wrote:
> rjmccall wrote:
> > Can we rena
yaxunl updated this revision to Diff 99149.
yaxunl marked an inline comment as done.
yaxunl added a comment.
Revised by John's comments.
https://reviews.llvm.org/D32248
Files:
include/clang/AST/ASTContext.h
include/clang/AST/Type.h
include/clang/Basic/AddressSpaces.h
include/clang/Basic
yaxunl marked 13 inline comments as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7296
+ unsigned getASTAllocaAddressSpace() const override {
+return LangAS::Count + getABIInfo().getDataLayout().getAllocaAddrSpace();
+ }
rjmccal
rjmccall added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1120
+address.getPointer()->getType()->getPointerElementType()->getPointerTo(
+getContext().getTargetAddressSpace(T.getAddressSpace())),
+/*non-null*/ true);
A lot of t
yaxunl updated this revision to Diff 99099.
yaxunl added a comment.
Revised by John's comments.
https://reviews.llvm.org/D32248
Files:
include/clang/AST/Type.h
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenModule.cpp
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1119
+ T.getAddressSpace(), address.getPointer()->getType()->
+ getPointerElementType()->getPointerTo(getContext().getTargetAddressSpace(
+ T.getAddressSpace())), true);
rjmccall
yaxunl updated this revision to Diff 99094.
yaxunl added a comment.
Fix format.
https://reviews.llvm.org/D32248
Files:
include/clang/AST/Type.h
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenTypes.cpp
lib/CodeGen/Tar
rjmccall added a comment.
Looking good. We had some overlapping patches and comments there, so I want to
make sure you didn't miss my comment on EmitAutoVarAlloca.
Comment at: lib/Sema/SemaDecl.cpp:7205
+}
+assert (T.getAddressSpace() != LangAS::opencl_constant);
+
yaxunl updated this revision to Diff 99061.
yaxunl added a comment.
Fix diagnostic for global addr
https://reviews.llvm.org/D32248
Files:
include/clang/AST/Type.h
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenTypes.cp
rjmccall added inline comments.
Comment at: lib/Sema/SemaDecl.cpp:7210
+ return;
+}
}
err_opencl_function_variable seems like a better diagnostic, at least for
opencl_global. You can fall back on this more general diagnostic for other
address space
yaxunl updated this revision to Diff 99056.
yaxunl marked an inline comment as done.
yaxunl added a comment.
diagnose automatic var with invalid addr space for OpenCL.
https://reviews.llvm.org/D32248
Files:
include/clang/AST/Type.h
include/clang/Basic/DiagnosticSemaKinds.td
lib/CodeGen/CG
rjmccall added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1115
+ assert(T.getAddressSpace() == LangAS::Default ||
+ T.getQualifiers().hasTargetSpecificAddressSpace());
+ auto Addr = getTargetHooks().performAddrSpaceCast(*this,
yaxunl wrote:
> t
yaxunl marked 2 inline comments as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1115
+ assert(T.getAddressSpace() == LangAS::Default ||
+ T.getQualifiers().hasTargetSpecificAddressSpace());
+ auto Addr = getTargetHooks().performAddrSpaceCast(*t
t-tye added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1115
+ assert(T.getAddressSpace() == LangAS::Default ||
+ T.getQualifiers().hasTargetSpecificAddressSpace());
+ auto Addr = getTargetHooks().performAddrSpaceCast(*this,
Should allowing spec
yaxunl updated this revision to Diff 99014.
yaxunl added a comment.
Removed adjustAddrSpaceForAutoVar and use performAddrSpaceCast instead.
https://reviews.llvm.org/D32248
Files:
include/clang/AST/Type.h
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenTypes.cpp
rjmccall added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7291
+ Address adjustAddrSpaceForAutoVar(Address A, const VarDecl *VD,
+ CodeGen::CodeGenFunction &CGF) const override;
};
yaxunl wrote:
> rjmccall wrote:
> > yaxunl wrote:
> > > rjmcca
yaxunl added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7291
+ Address adjustAddrSpaceForAutoVar(Address A, const VarDecl *VD,
+ CodeGen::CodeGenFunction &CGF) const override;
};
rjmccall wrote:
> yaxunl wrote:
> > rjmccall wrote:
> > > How ab
rjmccall added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7291
+ Address adjustAddrSpaceForAutoVar(Address A, const VarDecl *VD,
+ CodeGen::CodeGenFunction &CGF) const override;
};
yaxunl wrote:
> rjmccall wrote:
> > How about, instead of intr
yaxunl added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7291
+ Address adjustAddrSpaceForAutoVar(Address A, const VarDecl *VD,
+ CodeGen::CodeGenFunction &CGF) const override;
};
rjmccall wrote:
> How about, instead of introducing a second met
rjmccall added inline comments.
Comment at: lib/CodeGen/TargetInfo.cpp:7291
+ Address adjustAddrSpaceForAutoVar(Address A, const VarDecl *VD,
+ CodeGen::CodeGenFunction &CGF) const override;
};
How about, instead of introducing a second method, we just cha
yaxunl updated this revision to Diff 98314.
yaxunl added a comment.
Revised by reviewers' comments.
https://reviews.llvm.org/D32248
Files:
include/clang/AST/Type.h
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CodeGenTypes.cpp
lib/CodeGen/TargetInfo.cpp
lib/CodeGen/TargetInfo.h
test/CodeGen/ad
yaxunl marked 2 inline comments as done.
yaxunl added inline comments.
Comment at: test/CodeGenCXX/amdgcn-automatic-variable.cpp:25
+ // CHECK: store i32 2, i32* %[[r1]]
+ int lv1;
+ lv1 = 1;
yaxunl wrote:
> Anastasia wrote:
> > I am wondering if all these dif
yaxunl marked 18 inline comments as done.
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1115
+ if (AddrTy->getAddressSpace() != ExpectedAddrSpace &&
+ Ty.getAddressSpace() != LangAS::opencl_constant) {
+address = Address(Builder.CreateAddrSpaceCast(Ad
t-tye added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1115
+ if (AddrTy->getAddressSpace() != ExpectedAddrSpace &&
+ Ty.getAddressSpace() != LangAS::opencl_constant) {
+address = Address(Builder.CreateAddrSpaceCast(Addr,
Anastasia wrote:
> Do
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address sp
Anastasia added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address
rjmccall added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address sp
rjmccall added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address
Anastasia added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1115
+ if (AddrTy->getAddressSpace() != ExpectedAddrSpace &&
+ Ty.getAddressSpace() != LangAS::opencl_constant) {
+address = Address(Builder.CreateAddrSpaceCast(Addr,
Do you need to che
Anastasia added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address sp
rjmccall added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1118
+AddrTy->getElementType()->getPointerTo(ExpectedAddrSpace)),
+address.getAlignment());
+ }
This is a lot of work to be doing in a pretty common routine for the benefit of
on
yaxunl added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address sp
t-tye added inline comments.
Comment at: lib/CodeGen/CGDecl.cpp:1105-1119
+ // Alloca always returns a pointer in alloca address space, which may
+ // be different from the type defined by the language. For example,
+ // in C++ the auto variables are in the default address spa
yaxunl created this revision.
Alloca always returns a pointer in alloca address space, which may
be different from the type defined by the language. For example,
in C++ the auto variables are in the default address space. Therefore
cast alloca to the expected address space when necessary.
https:
47 matches
Mail list logo