llvm.org GIT mirror llvm / 320c630
Renaming: isTriviallyReMaterializable -> hasNoSideEffects isReallyTriviallyReMaterializable -> isTriviallyReMaterializable git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44702 91177308-0d34-0410-b5e6-96231b3b80d8 Bill Wendling 11 years ago
5 changed file(s) with 16 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
287287 return get(Opcode).Flags & M_HAS_OPTIONAL_DEF;
288288 }
289289
290 /// isTriviallyReMaterializable - Return true if the instruction is trivially
290 /// hasNoSideEffects - Return true if the instruction is trivially
291291 /// rematerializable, meaning it has no side effects and requires no operands
292292 /// that aren't always available.
293 bool isTriviallyReMaterializable(MachineInstr *MI) const {
293 bool hasNoSideEffects(MachineInstr *MI) const {
294294 return (MI->getInstrDescriptor()->Flags & M_REMATERIALIZIBLE) &&
295 isReallyTriviallyReMaterializable(MI);
295 isTriviallyReMaterializable(MI);
296296 }
297297
298298 protected:
299 /// isReallyTriviallyReMaterializable - For instructions with opcodes for
300 /// which the M_REMATERIALIZABLE flag is set, this function tests whether the
301 /// instruction itself is actually trivially rematerializable, considering
302 /// its operands. This is used for targets that have instructions that are
303 /// only trivially rematerializable for specific uses. This predicate must
304 /// return false if the instruction has any side effects other than
305 /// producing a value, or if it requres any address registers that are not
306 /// always available.
307 virtual bool isReallyTriviallyReMaterializable(MachineInstr *MI) const {
299 /// isTriviallyReMaterializable - For instructions with opcodes for which the
300 /// M_REMATERIALIZABLE flag is set, this function tests whether the
301 /// instruction itself is actually trivially rematerializable, considering its
302 /// operands. This is used for targets that have instructions that are only
303 /// trivially rematerializable for specific uses. This predicate must return
304 /// false if the instruction has any side effects other than producing a
305 /// value, or if it requres any address registers that are not always
306 /// available.
307 virtual bool isTriviallyReMaterializable(MachineInstr *MI) const {
308308 return true;
309309 }
310310
612612 return false;
613613
614614 isLoad = false;
615 if (tii_->isTriviallyReMaterializable(MI)) {
615 if (tii_->hasNoSideEffects(MI)) {
616616 isLoad = MI->getInstrDescriptor()->Flags & M_LOAD_FLAG;
617617 return true;
618618 }
119119 if (TID->ImplicitUses || !I.getNumOperands()) return false;
120120
121121 MachineOpCode Opcode = TID->Opcode;
122 return TII->isTriviallyReMaterializable(&I) &&
122 return TII->hasNoSideEffects(&I) &&
123123 // FIXME: Below necessary?
124124 !(TII->isReturn(Opcode) ||
125125 TII->isTerminatorInstr(Opcode) ||
115115 }
116116
117117
118 bool X86InstrInfo::isReallyTriviallyReMaterializable(MachineInstr *MI) const {
118 bool X86InstrInfo::isTriviallyReMaterializable(MachineInstr *MI) const {
119119 switch (MI->getOpcode()) {
120120 default: break;
121121 case X86::MOV8rm:
238238 unsigned& destReg) const;
239239 unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
240240 unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
241 bool isReallyTriviallyReMaterializable(MachineInstr *MI) const;
241 bool isTriviallyReMaterializable(MachineInstr *MI) const;
242242
243243 /// convertToThreeAddress - This method must be implemented by targets that
244244 /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target