Skip to content

Commit

Permalink
Merged master:e7ed27653292 into amd-gfx:551e5b0eb003
Browse files Browse the repository at this point in the history
Local branch amd-gfx 551e5b0 Merged master:703ef17e7a0a into amd-gfx:5a0cbb904e31
Remote branch master e7ed276 Switch libLLVMFrontendOpenACC to be a regular CMake library and not a "component"
  • Loading branch information
Sw authored and Sw committed Nov 14, 2020
2 parents 551e5b0 + e7ed276 commit 6fabed9
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 38 deletions.
27 changes: 9 additions & 18 deletions clang/lib/CodeGen/CGBuiltin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10748,8 +10748,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vld2q_lane_v: {
llvm::Type *Tys[2] = { VTy, Ops[1]->getType() };
Function *F = CGM.getIntrinsic(Intrinsic::aarch64_neon_ld2lane, Tys);
Ops.push_back(Ops[1]);
Ops.erase(Ops.begin()+1);
std::rotate(Ops.begin() + 1, Ops.begin() + 2, Ops.end());
Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
Ops[3] = Builder.CreateZExt(Ops[3], Int64Ty);
Expand All @@ -10762,8 +10761,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vld3q_lane_v: {
llvm::Type *Tys[2] = { VTy, Ops[1]->getType() };
Function *F = CGM.getIntrinsic(Intrinsic::aarch64_neon_ld3lane, Tys);
Ops.push_back(Ops[1]);
Ops.erase(Ops.begin()+1);
std::rotate(Ops.begin() + 1, Ops.begin() + 2, Ops.end());
Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
Expand All @@ -10777,8 +10775,7 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
case NEON::BI__builtin_neon_vld4q_lane_v: {
llvm::Type *Tys[2] = { VTy, Ops[1]->getType() };
Function *F = CGM.getIntrinsic(Intrinsic::aarch64_neon_ld4lane, Tys);
Ops.push_back(Ops[1]);
Ops.erase(Ops.begin()+1);
std::rotate(Ops.begin() + 1, Ops.begin() + 2, Ops.end());
Ops[1] = Builder.CreateBitCast(Ops[1], Ty);
Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
Expand All @@ -10791,50 +10788,44 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
}
case NEON::BI__builtin_neon_vst2_v:
case NEON::BI__builtin_neon_vst2q_v: {
Ops.push_back(Ops[0]);
Ops.erase(Ops.begin());
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end());
llvm::Type *Tys[2] = { VTy, Ops[2]->getType() };
return EmitNeonCall(CGM.getIntrinsic(Intrinsic::aarch64_neon_st2, Tys),
Ops, "");
}
case NEON::BI__builtin_neon_vst2_lane_v:
case NEON::BI__builtin_neon_vst2q_lane_v: {
Ops.push_back(Ops[0]);
Ops.erase(Ops.begin());
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end());
Ops[2] = Builder.CreateZExt(Ops[2], Int64Ty);
llvm::Type *Tys[2] = { VTy, Ops[3]->getType() };
return EmitNeonCall(CGM.getIntrinsic(Intrinsic::aarch64_neon_st2lane, Tys),
Ops, "");
}
case NEON::BI__builtin_neon_vst3_v:
case NEON::BI__builtin_neon_vst3q_v: {
Ops.push_back(Ops[0]);
Ops.erase(Ops.begin());
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end());
llvm::Type *Tys[2] = { VTy, Ops[3]->getType() };
return EmitNeonCall(CGM.getIntrinsic(Intrinsic::aarch64_neon_st3, Tys),
Ops, "");
}
case NEON::BI__builtin_neon_vst3_lane_v:
case NEON::BI__builtin_neon_vst3q_lane_v: {
Ops.push_back(Ops[0]);
Ops.erase(Ops.begin());
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end());
Ops[3] = Builder.CreateZExt(Ops[3], Int64Ty);
llvm::Type *Tys[2] = { VTy, Ops[4]->getType() };
return EmitNeonCall(CGM.getIntrinsic(Intrinsic::aarch64_neon_st3lane, Tys),
Ops, "");
}
case NEON::BI__builtin_neon_vst4_v:
case NEON::BI__builtin_neon_vst4q_v: {
Ops.push_back(Ops[0]);
Ops.erase(Ops.begin());
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end());
llvm::Type *Tys[2] = { VTy, Ops[4]->getType() };
return EmitNeonCall(CGM.getIntrinsic(Intrinsic::aarch64_neon_st4, Tys),
Ops, "");
}
case NEON::BI__builtin_neon_vst4_lane_v:
case NEON::BI__builtin_neon_vst4q_lane_v: {
Ops.push_back(Ops[0]);
Ops.erase(Ops.begin());
std::rotate(Ops.begin(), Ops.begin() + 1, Ops.end());
Ops[4] = Builder.CreateZExt(Ops[4], Int64Ty);
llvm::Type *Tys[2] = { VTy, Ops[5]->getType() };
return EmitNeonCall(CGM.getIntrinsic(Intrinsic::aarch64_neon_st4lane, Tys),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,18 +837,6 @@ std::string PlatformRemoteGDBServer::MakeUrl(const char *scheme,
return std::string(result.GetString());
}

lldb::ProcessSP PlatformRemoteGDBServer::ConnectProcess(
llvm::StringRef connect_url, llvm::StringRef plugin_name,
lldb_private::Debugger &debugger, lldb_private::Target *target,
lldb_private::Status &error) {
if (!IsRemote() || !IsConnected()) {
error.SetErrorString("Not connected to remote gdb server");
return nullptr;
}
return Platform::ConnectProcess(connect_url, plugin_name, debugger, target,
error);
}

size_t PlatformRemoteGDBServer::ConnectToWaitingProcesses(Debugger &debugger,
Status &error) {
std::vector<std::string> connection_urls;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,6 @@ class PlatformRemoteGDBServer : public Platform, private UserIDResolver {

const lldb::UnixSignalsSP &GetRemoteUnixSignals() override;

lldb::ProcessSP ConnectProcess(llvm::StringRef connect_url,
llvm::StringRef plugin_name,
lldb_private::Debugger &debugger,
lldb_private::Target *target,
lldb_private::Status &error) override;

size_t ConnectToWaitingProcesses(lldb_private::Debugger &debugger,
lldb_private::Status &error) override;

Expand Down
9 changes: 9 additions & 0 deletions lldb/test/Shell/Commands/command-process-connect.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Synchronous
# RUN: %lldb -o 'platform select remote-gdb-server' -o 'process connect connect://localhost:4321' 2>&1 | FileCheck %s

# Asynchronous
# RUN: echo -e 'platform select remote-gdb-server\nprocess connect connect://localhost:4321' | %lldb 2>&1 | FileCheck %s

# CHECK: Platform: remote-gdb-server
# CHECK: Connected: no
# CHECK: error: Failed to connect port
10 changes: 10 additions & 0 deletions llvm/include/llvm/ADT/SmallVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ class SmallVectorTemplateCommon
this->Size = this->Capacity = 0; // FIXME: Setting Capacity to 0 is suspect.
}

void assertSafeToPush(const void *Elt) {
assert(
(Elt < begin() || Elt >= end() || this->size() < this->capacity()) &&
"Attempting to push_back to the vector an element of the vector without"
" enough space reserved");
}

public:
using size_type = size_t;
using difference_type = ptrdiff_t;
Expand Down Expand Up @@ -251,13 +258,15 @@ class SmallVectorTemplateBase : public SmallVectorTemplateCommon<T> {

public:
void push_back(const T &Elt) {
this->assertSafeToPush(&Elt);
if (LLVM_UNLIKELY(this->size() >= this->capacity()))
this->grow();
::new ((void*) this->end()) T(Elt);
this->set_size(this->size() + 1);
}

void push_back(T &&Elt) {
this->assertSafeToPush(&Elt);
if (LLVM_UNLIKELY(this->size() >= this->capacity()))
this->grow();
::new ((void*) this->end()) T(::std::move(Elt));
Expand Down Expand Up @@ -353,6 +362,7 @@ class SmallVectorTemplateBase<T, true> : public SmallVectorTemplateCommon<T> {

public:
void push_back(const T &Elt) {
this->assertSafeToPush(&Elt);
if (LLVM_UNLIKELY(this->size() >= this->capacity()))
this->grow();
memcpy(reinterpret_cast<void *>(this->end()), &Elt, sizeof(T));
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/MC/MCInst.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class MCInst {
MCOperand &getOperand(unsigned i) { return Operands[i]; }
unsigned getNumOperands() const { return Operands.size(); }

void addOperand(const MCOperand &Op) { Operands.push_back(Op); }
void addOperand(const MCOperand Op) { Operands.push_back(Op); }

using iterator = SmallVectorImpl<MCOperand>::iterator;
using const_iterator = SmallVectorImpl<MCOperand>::const_iterator;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Frontend/OpenACC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ set(LLVM_TARGET_DEFINITIONS ${LLVM_MAIN_INCLUDE_DIR}/llvm/Frontend/OpenACC/ACC.t
tablegen(LLVM ACC.cpp --gen-directive-impl)
add_public_tablegen_target(acc_cpp)

add_llvm_component_library(LLVMFrontendOpenACC
add_llvm_library(LLVMFrontendOpenACC
ACC.cpp # Generated by tablegen above

ADDITIONAL_HEADER_DIRS
Expand Down

0 comments on commit 6fabed9

Please sign in to comment.