mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-13 14:47:00 +00:00
The ConstantExpr::getCast call can cause a CPR to be generated. If so,
strip it off. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11213 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
71151aee60
commit
99d6b8ec95
@ -539,6 +539,10 @@ bool RPR::PeepholeOptimize(BasicBlock *BB, BasicBlock::iterator &BI) {
|
||||
NewCast = new CastInst(CI->getCalledValue(), NewPFunTy,
|
||||
CI->getCalledValue()->getName()+"_c",CI);
|
||||
|
||||
// Strip off unneeded CPR's.
|
||||
if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(NewCast))
|
||||
NewCast = CPR->getValue();
|
||||
|
||||
// Create a new call instruction...
|
||||
CallInst *NewCall = new CallInst(NewCast,
|
||||
std::vector<Value*>(CI->op_begin()+1, CI->op_end()));
|
||||
|
Loading…
Reference in New Issue
Block a user