mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Add Constant Hoisting Pass
Retry commit r200022 with a fix for the build bot errors. Constant expressions have (unlike instructions) module scope use lists and therefore may have users in different functions. The fix is to simply ignore these out-of-function uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200034 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -158,6 +158,16 @@ unsigned TargetTransformInfo::getIntImmCost(const APInt &Imm, Type *Ty) const {
|
||||
return PrevTTI->getIntImmCost(Imm, Ty);
|
||||
}
|
||||
|
||||
unsigned TargetTransformInfo::getIntImmCost(unsigned Opcode, const APInt &Imm,
|
||||
Type *Ty) const {
|
||||
return PrevTTI->getIntImmCost(Opcode, Imm, Ty);
|
||||
}
|
||||
|
||||
unsigned TargetTransformInfo::getIntImmCost(Intrinsic::ID IID, const APInt &Imm,
|
||||
Type *Ty) const {
|
||||
return PrevTTI->getIntImmCost(IID, Imm, Ty);
|
||||
}
|
||||
|
||||
unsigned TargetTransformInfo::getNumberOfRegisters(bool Vector) const {
|
||||
return PrevTTI->getNumberOfRegisters(Vector);
|
||||
}
|
||||
@@ -541,7 +551,17 @@ struct NoTTI LLVM_FINAL : ImmutablePass, TargetTransformInfo {
|
||||
}
|
||||
|
||||
unsigned getIntImmCost(const APInt &Imm, Type *Ty) const LLVM_OVERRIDE {
|
||||
return 1;
|
||||
return TCC_Basic;
|
||||
}
|
||||
|
||||
unsigned getIntImmCost(unsigned Opcode, const APInt &Imm,
|
||||
Type *Ty) const LLVM_OVERRIDE {
|
||||
return TCC_Free;
|
||||
}
|
||||
|
||||
unsigned getIntImmCost(Intrinsic::ID IID, const APInt &Imm,
|
||||
Type *Ty) const LLVM_OVERRIDE {
|
||||
return TCC_Free;
|
||||
}
|
||||
|
||||
unsigned getNumberOfRegisters(bool Vector) const LLVM_OVERRIDE {
|
||||
|
||||
Reference in New Issue
Block a user