[RISCV] Fix mistake in RISCVTTIImpl::getIntImmCostInst.

zext.w requires Zba not Zbb. The test was also wrong, but had the
correct comment.
This commit is contained in:
Craig Topper 2022-07-14 16:41:40 -07:00
parent 65abc3a869
commit bc0d656558
2 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ InstructionCost RISCVTTIImpl::getIntImmCostInst(unsigned Opcode, unsigned Idx,
if (Imm == UINT64_C(0xffff) && ST->hasStdExtZbb())
return TTI::TCC_Free;
// zext.w
if (Imm == UINT64_C(0xffffffff) && ST->hasStdExtZbb())
if (Imm == UINT64_C(0xffffffff) && ST->hasStdExtZba())
return TTI::TCC_Free;
LLVM_FALLTHROUGH;
case Instruction::Add:

View File

@ -65,7 +65,7 @@ define i64 @test7(i64 %a) nounwind {
}
; Check that we don't hoist zext.w with Zba.
define i64 @test8(i64 %a) nounwind "target-features"="+zbb" {
define i64 @test8(i64 %a) nounwind "target-features"="+zba" {
; CHECK-LABEL: test8
; CHECK: and i64 %a, 4294967295
%1 = and i64 %a, 4294967295