[clang] [lld] [llvm] [WebAssembly] Enable nontrapping-fptoint and bulk-memory by default. (PR #112049)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 16 08:11:39 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff f7788618dd24e5366709a70c3e16cd5a0ca0a173 23fec587e7ba2c6bb34aa0a469bc17f9d4cfbb87 --extensions c,cpp -- clang/lib/Basic/Targets/WebAssembly.cpp clang/test/Preprocessor/wasm-target-features.c llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index e7e84ed6b5..65c8947f74 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -565,8 +565,7 @@ static MachineBasicBlock *LowerFPToInt(MachineInstr &MI, DebugLoc DL,
// instuction to handle the zero-length case.
static MachineBasicBlock *LowerMemcpy(MachineInstr &MI, DebugLoc DL,
MachineBasicBlock *BB,
- const TargetInstrInfo &TII,
- bool Int64) {
+ const TargetInstrInfo &TII, bool Int64) {
MachineRegisterInfo &MRI = BB->getParent()->getRegInfo();
MachineOperand DstMem = MI.getOperand(0);
@@ -585,7 +584,8 @@ static MachineBasicBlock *LowerMemcpy(MachineInstr &MI, DebugLoc DL,
MachineBasicBlock *TrueMBB = F->CreateMachineBasicBlock(LLVMBB);
MachineBasicBlock *DoneMBB = F->CreateMachineBasicBlock(LLVMBB);
- unsigned MemoryCopy = Int64 ? WebAssembly::MEMORY_COPY_A64 : WebAssembly::MEMORY_COPY_A32;
+ unsigned MemoryCopy =
+ Int64 ? WebAssembly::MEMORY_COPY_A64 : WebAssembly::MEMORY_COPY_A32;
MachineFunction::iterator It = ++BB->getIterator();
F->insert(It, TrueMBB);
@@ -624,8 +624,7 @@ static MachineBasicBlock *LowerMemcpy(MachineInstr &MI, DebugLoc DL,
// instuction to handle the zero-length case.
static MachineBasicBlock *LowerMemset(MachineInstr &MI, DebugLoc DL,
MachineBasicBlock *BB,
- const TargetInstrInfo &TII,
- bool Int64) {
+ const TargetInstrInfo &TII, bool Int64) {
MachineRegisterInfo &MRI = BB->getParent()->getRegInfo();
MachineOperand Mem = MI.getOperand(0);
@@ -643,7 +642,8 @@ static MachineBasicBlock *LowerMemset(MachineInstr &MI, DebugLoc DL,
MachineBasicBlock *TrueMBB = F->CreateMachineBasicBlock(LLVMBB);
MachineBasicBlock *DoneMBB = F->CreateMachineBasicBlock(LLVMBB);
- unsigned MemoryFill = Int64 ? WebAssembly::MEMORY_FILL_A64 : WebAssembly::MEMORY_FILL_A32;
+ unsigned MemoryFill =
+ Int64 ? WebAssembly::MEMORY_FILL_A64 : WebAssembly::MEMORY_FILL_A32;
MachineFunction::iterator It = ++BB->getIterator();
F->insert(It, TrueMBB);
@@ -664,11 +664,7 @@ static MachineBasicBlock *LowerMemset(MachineInstr &MI, DebugLoc DL,
BuildMI(BB, DL, TII.get(Eqz), EqzReg).add(NoKillLen);
- BuildMI(TrueMBB, DL, TII.get(MemoryFill))
- .add(Mem)
- .add(Dst)
- .add(Val)
- .add(Len);
+ BuildMI(TrueMBB, DL, TII.get(MemoryFill)).add(Mem).add(Dst).add(Val).add(Len);
// Create the CFG triangle.
BuildMI(BB, DL, TII.get(WebAssembly::BR_IF)).addMBB(DoneMBB).addReg(EqzReg);
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.cpp b/llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.cpp
index 48119de121..d51bfeb6d8 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblySelectionDAGInfo.cpp
@@ -32,9 +32,9 @@ SDValue WebAssemblySelectionDAGInfo::EmitTargetCodeForMemcpy(
// Use `MEMCPY` here instead of `MEMORY_COPY` because `memory.copy` traps
// if the pointers are invalid even if the length is zero. `MEMCPY` gets
// extra code to handle this in the way that LLVM IR expects.
- return DAG.getNode(WebAssemblyISD::MEMCPY, DL, MVT::Other,
- {Chain, MemIdx, MemIdx, Dst, Src,
- DAG.getZExtOrTrunc(Size, DL, LenMVT)});
+ return DAG.getNode(
+ WebAssemblyISD::MEMCPY, DL, MVT::Other,
+ {Chain, MemIdx, MemIdx, Dst, Src, DAG.getZExtOrTrunc(Size, DL, LenMVT)});
}
SDValue WebAssemblySelectionDAGInfo::EmitTargetCodeForMemmove(
@@ -62,7 +62,7 @@ SDValue WebAssemblySelectionDAGInfo::EmitTargetCodeForMemset(
// extra code to handle this in the way that LLVM IR expects.
//
// Only low byte matters for val argument, so anyext the i8
- return DAG.getNode(WebAssemblyISD::MEMSET, DL, MVT::Other, Chain, MemIdx,
- Dst, DAG.getAnyExtOrTrunc(Val, DL, MVT::i32),
+ return DAG.getNode(WebAssemblyISD::MEMSET, DL, MVT::Other, Chain, MemIdx, Dst,
+ DAG.getAnyExtOrTrunc(Val, DL, MVT::i32),
DAG.getZExtOrTrunc(Size, DL, LenMVT));
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/112049
More information about the cfe-commits
mailing list