mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Have a few places that want to simplify phi nodes use SimplifyInstruction
rather than calling hasConstantValue. No intended functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119352 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -46,9 +46,10 @@
|
||||
#include "llvm/LLVMContext.h"
|
||||
#include "llvm/Type.h"
|
||||
#include "llvm/Analysis/AliasAnalysis.h"
|
||||
#include "llvm/Analysis/ScalarEvolution.h"
|
||||
#include "llvm/Analysis/Dominators.h"
|
||||
#include "llvm/Analysis/InstructionSimplify.h"
|
||||
#include "llvm/Analysis/LoopPass.h"
|
||||
#include "llvm/Analysis/ScalarEvolution.h"
|
||||
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
|
||||
#include "llvm/Transforms/Utils/Local.h"
|
||||
#include "llvm/Support/CFG.h"
|
||||
@@ -268,7 +269,7 @@ ReprocessLoop:
|
||||
PHINode *PN;
|
||||
for (BasicBlock::iterator I = L->getHeader()->begin();
|
||||
(PN = dyn_cast<PHINode>(I++)); )
|
||||
if (Value *V = PN->hasConstantValue(DT)) {
|
||||
if (Value *V = SimplifyInstruction(PN, 0, DT)) {
|
||||
if (AA) AA->deleteValue(PN);
|
||||
PN->replaceAllUsesWith(V);
|
||||
PN->eraseFromParent();
|
||||
@@ -448,7 +449,7 @@ static PHINode *FindPHIToPartitionLoops(Loop *L, DominatorTree *DT,
|
||||
for (BasicBlock::iterator I = L->getHeader()->begin(); isa<PHINode>(I); ) {
|
||||
PHINode *PN = cast<PHINode>(I);
|
||||
++I;
|
||||
if (Value *V = PN->hasConstantValue(DT)) {
|
||||
if (Value *V = SimplifyInstruction(PN, 0, DT)) {
|
||||
// This is a degenerate PHI already, don't modify it!
|
||||
PN->replaceAllUsesWith(V);
|
||||
if (AA) AA->deleteValue(PN);
|
||||
|
||||
Reference in New Issue
Block a user