Skip to content

Commit 7aa382f

Browse files
authored
[RISCV] Zicfilp implies Zicsr. (#93143)
The Zicfilp extension depends on the Zicsr extension. Ref: https://github.com/riscv/riscv-cfi/blob/main/src/cfi_forward.adoc
1 parent af68120 commit 7aa382f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

llvm/lib/Target/RISCV/RISCVFeatures.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ def HasStdExtZimop : Predicate<"Subtarget->hasStdExtZimop()">,
152152

153153
def FeatureStdExtZicfilp
154154
: RISCVExperimentalExtension<"zicfilp", 0, 4,
155-
"'Zicfilp' (Landing pad)">;
155+
"'Zicfilp' (Landing pad)",
156+
[FeatureStdExtZicsr]>;
156157
def HasStdExtZicfilp : Predicate<"Subtarget->hasStdExtZicfilp()">,
157158
AssemblerPredicate<(all_of FeatureStdExtZicfilp),
158159
"'Zicfilp' (Landing pad)">;

llvm/test/CodeGen/RISCV/attributes.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
; RV32ZACAS: .attribute 5, "rv32i2p1_a2p1_zacas1p0"
390390
; RV32ZALASR: .attribute 5, "rv32i2p1_zalasr0p1"
391391
; RV32ZAMA16B: .attribute 5, "rv32i2p1_zama16b1p0"
392-
; RV32ZICFILP: .attribute 5, "rv32i2p1_zicfilp0p4"
392+
; RV32ZICFILP: .attribute 5, "rv32i2p1_zicfilp0p4_zicsr2p0"
393393
; RV32ZABHA: .attribute 5, "rv32i2p1_a2p1_zabha1p0"
394394
; RV32SSNPM: .attribute 5, "rv32i2p1_ssnpm0p8"
395395
; RV32SMNPM: .attribute 5, "rv32i2p1_smnpm0p8"
@@ -520,7 +520,7 @@
520520
; RV64ZVFBFWMA: .attribute 5, "rv64i2p1_f2p2_zicsr2p0_zfbfmin1p0_zve32f1p0_zve32x1p0_zvfbfmin1p0_zvfbfwma1p0_zvl32b1p0"
521521
; RV64ZACAS: .attribute 5, "rv64i2p1_a2p1_zacas1p0"
522522
; RV64ZALASR: .attribute 5, "rv64i2p1_zalasr0p1"
523-
; RV64ZICFILP: .attribute 5, "rv64i2p1_zicfilp0p4"
523+
; RV64ZICFILP: .attribute 5, "rv64i2p1_zicfilp0p4_zicsr2p0"
524524
; RV64ZABHA: .attribute 5, "rv64i2p1_a2p1_zabha1p0"
525525
; RV64SSNPM: .attribute 5, "rv64i2p1_ssnpm0p8"
526526
; RV64SMNPM: .attribute 5, "rv64i2p1_smnpm0p8"

llvm/test/MC/RISCV/attribute-arch.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@
397397
# CHECK: attribute 5, "rv32i2p1_xcvbi1p0"
398398

399399
.attribute arch, "rv32i_zicfilp0p4"
400-
# CHECK: attribute 5, "rv32i2p1_zicfilp0p4"
400+
# CHECK: attribute 5, "rv32i2p1_zicfilp0p4_zicsr2p0"
401401

402402
.attribute arch, "rv32i_zicfiss0p4"
403403
# CHECK: .attribute 5, "rv32i2p1_zicfiss0p4_zicsr2p0_zimop1p0"

0 commit comments

Comments
 (0)