mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
bug 122:
- Minimize redundant isa<GlobalValue> usage git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14948 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -82,9 +82,8 @@ bool IPCP::processFunction(Function &F) {
|
||||
if (*AI == &F) return false; // Passes the function into itself
|
||||
|
||||
if (!ArgumentConstants[i].second) {
|
||||
if (isa<Constant>(*AI) || isa<GlobalValue>(*AI)) {
|
||||
if (isa<Constant>(*AI)) {
|
||||
Constant *C = dyn_cast<Constant>(*AI);
|
||||
if (!C) C = ConstantPointerRef::get(cast<GlobalValue>(*AI));
|
||||
|
||||
if (!ArgumentConstants[i].first)
|
||||
ArgumentConstants[i].first = C;
|
||||
@@ -114,9 +113,6 @@ bool IPCP::processFunction(Function &F) {
|
||||
if (!ArgumentConstants[i].second && !AI->use_empty()) {
|
||||
assert(ArgumentConstants[i].first && "Unknown constant value!");
|
||||
Value *V = ArgumentConstants[i].first;
|
||||
if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V))
|
||||
V = CPR->getValue();
|
||||
|
||||
AI->replaceAllUsesWith(V);
|
||||
++NumArgumentsProped;
|
||||
MadeChange = true;
|
||||
|
Reference in New Issue
Block a user