Details
Diff Detail
Event Timeline
- Added an assert in performLDNT1Combine to check hasBF16() is true where the type is a bfloat16
| llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
|---|---|---|
| 12076–12077 | No need to set up a variable when it is used only once. Please move it inside the assertion. | |
| llvm/lib/Target/AArch64/AArch64SVEInstrInfo.td | ||
| 1526 | [HasBF16, HasSVE], same for the Predicates below. | |
| llvm/test/CodeGen/AArch64/sve-intrinsics-ld1-addressing-mode-reg-imm.ll | ||
| 1 | Nit: as I mentioned in https://reviews.llvm.org/D82492#inline-758743, maybe it is worth extracting the bf16 tests in a separate *-bfloat.ll file as we have done for the ACLEs. | |
- Moved hasBF16() check into the assert in performLDNT1Combine
- Added HasSVE to the Predicates
- Added a function attribute for the bfloat tests
| llvm/test/CodeGen/AArch64/sve-intrinsics-ld1-addressing-mode-reg-imm.ll | ||
|---|---|---|
| 1 | I've added a function attribute for the bfloat16 functions, the same as the tests added in D82429 | |
| llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
|---|---|---|
| 12078–12080 | nit: maybe it's just me but this hurts my head, can we not just write: if (VT == MVT::nxv8bf16)
assert(
static_cast<const AArch64Subtarget &>(DAG.getSubtarget()).hasBF16() &&
"Unsupported type (BF16)"); | |
| llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
|---|---|---|
| 12078–12080 | I think you should return SDValue() here instead. | |
| llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
|---|---|---|
| 12078–12080 | Some reasoning to my above statement: | |
| llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
|---|---|---|
| 12078–12080 | Thanks for explaining this @sdesmalen, I've removed these asserts and replaced them with return SDValue() as suggested in https://reviews.llvm.org/rG6b313f198c95218b953f2c992f702f178c61cd1d | |
No need to set up a variable when it is used only once. Please move it inside the assertion.