Skip to content

Commit ee5408d

Browse files
committed
Use hasFeature and include Zca in 2-byte alignment
1 parent bfe06ab commit ee5408d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bolt/lib/Target/RISCV/RISCVMCPlusBuilder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,10 @@ class RISCVMCPlusBuilder : public MCPlusBuilder {
493493
}
494494

495495
uint16_t getMinFunctionAlignment() const override {
496-
return STI->getFeatureBits()[RISCV::FeatureStdExtC] ? 2 : 4;
496+
if (STI->hasFeature(RISCV::FeatureStdExtC) ||
497+
STI->hasFeature(RISCV::FeatureStdExtZca))
498+
return 2;
499+
return 4;
497500
}
498501
};
499502

0 commit comments

Comments
 (0)