[Lldb-commits] [lldb] 37f5c59 - [lldb] Add missing wasm switch case

2023-02-19 Thread Benjamin Kramer via lldb-commits

Author: Benjamin Kramer
Date: 2023-02-19T10:54:10+01:00
New Revision: 37f5c598a22a0e11d827979c910befb0b57c2033

URL: 
https://github.com/llvm/llvm-project/commit/37f5c598a22a0e11d827979c910befb0b57c2033
DIFF: 
https://github.com/llvm/llvm-project/commit/37f5c598a22a0e11d827979c910befb0b57c2033.diff

LOG: [lldb] Add missing wasm switch case

TypeSystemClang.cpp:4855:13: error: enumeration value 'WasmExternRef' not 
handled in switch [-Werror,-Wswitch]

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index af897a70bd094..bf0dcc3a92576 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -5118,6 +5118,10 @@ lldb::Encoding 
TypeSystemClang::GetEncoding(lldb::opaque_compiler_type_t type,
 case clang::BuiltinType::RvvBool64:
   break;
 
+// WebAssembly builtin types.
+case clang::BuiltinType::WasmExternRef:
+  break;
+
 case clang::BuiltinType::IncompleteMatrixIdx:
   break;
 }



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] 87d02e0 - Recommit "[Support] change StringMap hash function from djbHash to xxHash"

2023-02-19 Thread Erik Desjardins via lldb-commits

Author: Erik Desjardins
Date: 2023-02-19T16:52:26-05:00
New Revision: 87d02e0dfd760de38d092ef69f8a9164f28f2221

URL: 
https://github.com/llvm/llvm-project/commit/87d02e0dfd760de38d092ef69f8a9164f28f2221
DIFF: 
https://github.com/llvm/llvm-project/commit/87d02e0dfd760de38d092ef69f8a9164f28f2221.diff

LOG: Recommit "[Support] change StringMap hash function from djbHash to xxHash"

This reverts commit 37eb9d13f891f7656f811516e765b929b169afe0.

Test failures have been fixed:

- ubsan failure fixed by 72eac42f21c0f45a27f3eaaff9364cbb5189b9e4
- warn-unsafe-buffer-usage-fixits-local-var-span.cpp fixed by
  03cc52dfd1dbb4a59b479da55e87838fb93d2067 (wasn't related)
- test-output-format.ll failure was spurious, build failed at
  https://lab.llvm.org/buildbot/#/builders/54/builds/3545 
(b4431b2d945b6fc19b1a55ac6ce969a8e06e1e93)
  but passed at
  https://lab.llvm.org/buildbot/#/builders/54/builds/3546 
(5ae99be0377248c74346096dc475af254a3fc799)
  which is before my revert
  
https://github.com/llvm/llvm-project/compare/b4431b2d945b6fc19b1a55ac6ce969a8e06e1e93...5ae99be0377248c74346096dc475af254a3fc799

Original commit message:

Depends on https://reviews.llvm.org/D142861.

Alternative to https://reviews.llvm.org/D137601.

xxHash is much faster than djbHash. This makes a simple Rust test case with 
a large constant string 10% faster to compile.

Previous attempts at changing this hash function (e.g. 
https://reviews.llvm.org/D97396) had to be reverted due to breaking tests that 
depended on iteration order.
No additional tests fail with this patch compared to `main` when running 
`check-all` with `-DLLVM_ENABLE_PROJECTS="all"` (on a Linux host), so I hope I 
found everything that needs to be changed.

Differential Revision: https://reviews.llvm.org/D142862

Added: 


Modified: 
clang-tools-extra/test/modularize/ProblemsDisplayLists.modularize
clang/unittests/Basic/SarifTest.cpp
compiler-rt/test/profile/Linux/instrprof-show-debug-info-correlation.c
lldb/test/API/functionalities/gdb_remote_client/TestGDBRemoteClient.py
llvm/lib/Support/StringMap.cpp
llvm/test/DebugInfo/Generic/accel-table-hash-collisions.ll
llvm/test/DebugInfo/Generic/debug-names-hash-collisions.ll
llvm/test/DebugInfo/X86/debug-pubtables-dwarf64.ll
llvm/test/DebugInfo/X86/gnu-public-names-gmlt.ll
llvm/test/DebugInfo/X86/gnu-public-names.ll
llvm/test/tools/dsymutil/ARM/extern-alias.test
llvm/test/tools/llvm-profdata/suppl-instr-with-sample.test
mlir/test/mlir-lsp-server/completion.test

Removed: 




diff  --git a/clang-tools-extra/test/modularize/ProblemsDisplayLists.modularize 
b/clang-tools-extra/test/modularize/ProblemsDisplayLists.modularize
index 31be95c6b6b3c..afe1ece5eec08 100644
--- a/clang-tools-extra/test/modularize/ProblemsDisplayLists.modularize
+++ b/clang-tools-extra/test/modularize/ProblemsDisplayLists.modularize
@@ -12,5 +12,5 @@
 
 # CHECK: These are the combined files, with problem files preceded by #:
 
-# CHECK: {{.*}}Inputs/CompileError/HasError.h
 # CHECK: Inputs/CompileError/Level1A.h
+# CHECK: {{.*}}Inputs/CompileError/HasError.h

diff  --git a/clang/unittests/Basic/SarifTest.cpp 
b/clang/unittests/Basic/SarifTest.cpp
index 06ad4e7a63091..33bccf56babb7 100644
--- a/clang/unittests/Basic/SarifTest.cpp
+++ b/clang/unittests/Basic/SarifTest.cpp
@@ -332,7 +332,7 @@ TEST_F(SarifDocumentWriterTest, checkSerializingArtifacts) {
 TEST_F(SarifDocumentWriterTest, checkSerializingCodeflows) {
   // GIVEN:
   const std::string ExpectedOutput =
-  
R"({"$schema":"https://docs.oasis-open.org/sarif/sarif/v2.1.0/cos02/schemas/sarif-schema-2.1.0.json","runs":[{"artifacts":[{"length":27,"location":{"index":1,"uri":"file:///test-header-1.h"},"mimeType":"text/plain","roles":["resultFile"]},{"length":30,"location":{"index":2,"uri":"file:///test-header-2.h"},"mimeType":"text/plain","roles":["resultFile"]},{"length":28,"location":{"index":3,"uri":"file:///test-header-3.h"},"mimeType":"text/plain","roles":["resultFile"]},{"length":41,"location":{"index":0,"uri":"file:///main.cpp"},"mimeType":"text/plain","roles":["resultFile"]}],"columnKind":"unicodeCodePoints","results":[{"codeFlows":[{"threadFlows":[{"locations":[{"importance":"essential","location":{"message":{"text":"Message
 
#1"},"physicalLocation":{"artifactLocation":{"index":1,"uri":"file:///test-header-1.h"},"region":{"endColumn":8,"endLine":2,"startColumn":1,"startLine":1,{"importance":"important","location":{"message":{"text":"Message
 
#2"},"physicalLocation":{"artifactLocation":{"index":2,"uri":"file:///test-header-2.h"},"region":{"endColumn":8,"endLine":2,"startColumn":1,"startLine":1,{"importance":"unimportant","location":{"message":{"text":"Message
 
#3"},"physicalLocation":{"artifactLocation":{"index":3,"uri":"file:///test-header-3.h"},"region":{"endColumn":8,"endLine":2,"startColumn":1,"startLine":1]}]}],"lev

[Lldb-commits] [PATCH] D144366: [RISCV]Add more pattern for fma ins

2023-02-19 Thread Feng Wang via Phabricator via lldb-commits
wf520gg created this revision.
Herald added subscribers: luke, VincentWu, vkmr, frasercrmck, evandro, 
luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, 
PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, 
shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, 
hiraditya, arichardson.
Herald added a project: All.
wf520gg requested review of this revision.
Herald added subscribers: llvm-commits, lldb-commits, pcwang-thead, eopXD, 
MaskRay.
Herald added projects: LLDB, LLVM.

Consider the following test cases:

double fma_1(double rs1, double rs2, double rs3)
{

  return  -(rs1 * rs2) - rs3;

}
double fma_2(double rs1, double rs2, double rs3)
{

  return  -(rs1 * rs2) + rs3;

}
The compiled assembly code with command --target=riscv64-unknown-elf
-march=rv64g is:
fma_1:
fneg.d  ft0, fa0
fmul.d  ft0, ft0, fa1
fsub.d  fa0, ft0, fa2
ret
fma_2:
fmul.d  ft0, fa0, fa1
fsub.d  fa0, fa2, ft0
ret
Compare with the gcc compiled result:
fma_1:
fnmadd.d  fa0,fa0,fa1,fa2
fma_2:
fnmsub.d  fa0,fa0,fa1,fa2
So I add new patterns for these two scenarios.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D144366

Files:
  lldb/include/lldb/Target/Target.h
  lldb/source/API/SBExpressionOptions.cpp
  lldb/source/Breakpoint/BreakpointLocation.cpp
  lldb/source/Commands/CommandObjectExpression.cpp
  lldb/source/Expression/UserExpression.cpp
  lldb/test/API/commands/expression/po_persistent_result/Makefile
  
lldb/test/API/commands/expression/po_persistent_result/TestPoPersistentResult.py
  lldb/test/API/commands/expression/po_persistent_result/main.m
  llvm/lib/Target/RISCV/RISCVInstrInfoD.td
  llvm/lib/Target/RISCV/RISCVInstrInfoF.td
  llvm/test/CodeGen/RISCV/double-arith.ll
  llvm/test/CodeGen/RISCV/float-arith.ll

Index: llvm/test/CodeGen/RISCV/float-arith.ll
===
--- llvm/test/CodeGen/RISCV/float-arith.ll
+++ llvm/test/CodeGen/RISCV/float-arith.ll
@@ -643,6 +643,27 @@
   ret float %neg
 }
 
+define float @fnmadd_s_4(float %a, float %b, float %c) nounwind {
+; RV32IFD-LABEL: fnmadd_s_4:
+; RV32IFD:   # %bb.0:
+; RV32IFD-NEXT:fcvt.s.w ft0, zero
+; RV32IFD-NEXT:fadd.s ft0, fa0, ft0
+; RV32IFD-NEXT:fnmadd.s fa0, ft0, fa1, fa2
+; RV32IFD-NEXT:ret
+;
+; RV64IFD-LABEL: fnmadd_s_4:
+; RV64IFD:   # %bb.0:
+; RV64IFD-NEXT:fmv.s.x ft0, zero
+; RV64IFD-NEXT:fadd.s ft0, fa0, ft0
+; RV64IFD-NEXT:fnmadd.s fa0, ft0, fa1, fa2
+; RV64IFD-NEXT:ret
+  %a_ = fadd float 0.0, %a
+  %nega = fsub float -0.0, %a_
+  %fmul = fmul float %nega, %b
+  %sub = fsub float %fmul, %c
+  ret float %sub
+}
+
 define float @fnmadd_nsz(float %a, float %b, float %c) nounwind {
 ; RV32IF-LABEL: fnmadd_nsz:
 ; RV32IF:   # %bb.0:
@@ -797,6 +818,16 @@
   ret float %1
 }
 
+define float @fnmsub_s_3(float %a, float %b, float %c) nounwind {
+; CHECKIFD-LABEL: fnmsub_s_3:
+; CHECKIFD:   # %bb.0:
+; CHECKIFD-NEXT:fnmsub.s fa0, fa0, fa1, fa2
+; CHECKIFD-NEXT:ret
+  %1 = fmul float %a, %b
+  %add = fsub float %c, %1
+  ret float %add
+}
+
 define float @fmadd_s_contract(float %a, float %b, float %c) nounwind {
 ; CHECKIF-LABEL: fmadd_s_contract:
 ; CHECKIF:   # %bb.0:
Index: llvm/test/CodeGen/RISCV/double-arith.ll
===
--- llvm/test/CodeGen/RISCV/double-arith.ll
+++ llvm/test/CodeGen/RISCV/double-arith.ll
@@ -693,6 +693,26 @@
   ret double %neg
 }
 
+define double @fnmadd_d_4(double %a, double %b, double %c) nounwind {
+; RV32IFD-LABEL: fnmadd_d_4:
+; RV32IFD:   # %bb.0:
+; RV32IFD-NEXT:fcvt.d.w ft0, zero
+; RV32IFD-NEXT:fadd.d ft0, fa0, ft0
+; RV32IFD-NEXT:fnmadd.d fa0, ft0, fa1, fa2
+; RV32IFD-NEXT:ret
+;
+; RV64IFD-LABEL: fnmadd_d_4:
+; RV64IFD:   # %bb.0:
+; RV64IFD-NEXT:fmv.d.x ft0, zero
+; RV64IFD-NEXT:fadd.d ft0, fa0, ft0
+; RV64IFD-NEXT:fnmadd.d fa0, ft0, fa1, fa2
+; RV64IFD-NEXT:ret
+  %a_ = fadd double 0.0, %a
+  %nega = fsub double -0.0, %a_
+  %fmul = fmul double %nega, %b
+  %sub = fsub double %fmul, %c
+  ret double %sub
+}
 
 define double @fnmadd_nsz(double %a, double %b, double %c) nounwind {
 ; CHECKIFD-LABEL: fnmadd_nsz:
@@ -875,6 +895,16 @@
   ret double %1
 }
 
+define double @fnmsub_d_3(double %a, double %b, double %c) nounwind {
+; CHECKIFD-LABEL: fnmsub_d_3:
+; CHECKIFD:   # %bb.0:
+; CHECKIFD-NEXT:fnmsub.d fa0, fa0, fa1, fa2
+; CHECKIFD-NEXT:ret
+  %1 = fmul double %a, %b
+  %add = fsub double %c, %1
+  ret double %add
+}
+
 define double @fmadd_d_contract(double %a, double %b, double %c) nounwind {
 ; CHECKIFD-LABEL: fmadd_d_contract:
 ; CHECKIFD:   # %bb.0:
Index: llvm/lib/Target/RISCV/RISCVInstrInfoF.td
===
--- llvm/lib/Target/RISCV/RISCVInstrInfoF.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoF.td
@@ -483,6 +483,10 @@
 def : Pat<(any_fma (fneg FPR32:$rs1), FPR32:$

[Lldb-commits] [PATCH] D144366: [RISCV]Add more pattern for fma ins

2023-02-19 Thread Craig Topper via Phabricator via lldb-commits
craig.topper added inline comments.
Herald added subscribers: Michael137, JDevlieghere.



Comment at: lldb/include/lldb/Target/Target.h:416
 
-  void SetResultIsInternal(bool b) { m_result_is_internal = b; }
 

Unrelated?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144366/new/

https://reviews.llvm.org/D144366

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D144366: [RISCV]Add more pattern for fma ins

2023-02-19 Thread Craig Topper via Phabricator via lldb-commits
craig.topper added a comment.

These transforms are not valid without the `contract` fast math flag


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144366/new/

https://reviews.llvm.org/D144366

___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits