forked from OSchip/llvm-project
[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:
parent
65abc3a869
commit
bc0d656558
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue