llvm.org GIT mirror llvm / 37f32ee
Eliminate an unnecessary SelectionDAG dependency in getOptimalMemOpType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101531 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 9 years ago
5 changed file(s) with 16 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
631631 /// non-scalar-integer type, e.g. empty string source, constant, or loaded
632632 /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
633633 /// constant so it does not need to be loaded.
634 /// It returns EVT::Other if SelectionDAG should be responsible for
635 /// determining the type.
634 /// It returns EVT::Other if the type should be determined using generic
635 /// target-independent logic.
636636 virtual EVT getOptimalMemOpType(uint64_t Size,
637637 unsigned DstAlign, unsigned SrcAlign,
638638 bool NonScalarIntSafe, bool MemcpyStrSrc,
639 SelectionDAG &DAG) const {
639 MachineFunction &MF) const {
640640 return MVT::Other;
641641 }
642642
55485548 /// non-scalar-integer type, e.g. empty string source, constant, or loaded
55495549 /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
55505550 /// constant so it does not need to be loaded.
5551 /// It returns EVT::Other if SelectionDAG should be responsible for
5552 /// determining the type.
5551 /// It returns EVT::Other if the type should be determined using generic
5552 /// target-independent logic.
55535553 EVT PPCTargetLowering::getOptimalMemOpType(uint64_t Size,
55545554 unsigned DstAlign, unsigned SrcAlign,
55555555 bool NonScalarIntSafe,
55565556 bool MemcpyStrSrc,
5557 SelectionDAG &DAG) const {
5557 MachineFunction &MF) const {
55585558 if (this->PPCSubTarget.isPPC64()) {
55595559 return MVT::i64;
55605560 } else {
356356 /// non-scalar-integer type, e.g. empty string source, constant, or loaded
357357 /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
358358 /// constant so it does not need to be loaded.
359 /// It returns EVT::Other if SelectionDAG should be responsible for
360 /// determining the type.
359 /// It returns EVT::Other if the type should be determined using generic
360 /// target-independent logic.
361361 virtual EVT
362362 getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign,
363363 bool NonScalarIntSafe, bool MemcpyStrSrc,
364 SelectionDAG &DAG) const;
364 MachineFunction &MF) const;
365365
366366 /// getFunctionAlignment - Return the Log2 alignment of this function.
367367 virtual unsigned getFunctionAlignment(const Function *F) const;
10781078 /// non-scalar-integer type, e.g. empty string source, constant, or loaded
10791079 /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
10801080 /// constant so it does not need to be loaded.
1081 /// It returns EVT::Other if SelectionDAG should be responsible for
1082 /// determining the type.
1081 /// It returns EVT::Other if the type should be determined using generic
1082 /// target-independent logic.
10831083 EVT
10841084 X86TargetLowering::getOptimalMemOpType(uint64_t Size,
10851085 unsigned DstAlign, unsigned SrcAlign,
10861086 bool NonScalarIntSafe,
10871087 bool MemcpyStrSrc,
1088 SelectionDAG &DAG) const {
1088 MachineFunction &MF) const {
10891089 // FIXME: This turns off use of xmm stores for memset/memcpy on targets like
10901090 // linux. This is because the stack realignment code can't handle certain
10911091 // cases like PR2962. This should be removed when PR2962 is fixed.
1092 const Function *F = DAG.getMachineFunction().getFunction();
1092 const Function *F = MF.getFunction();
10931093 if (NonScalarIntSafe &&
10941094 !F->hasFnAttr(Attribute::NoImplicitFloat)) {
10951095 if (Size >= 16 &&
425425 /// non-scalar-integer type, e.g. empty string source, constant, or loaded
426426 /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
427427 /// constant so it does not need to be loaded.
428 /// It returns EVT::Other if SelectionDAG should be responsible for
429 /// determining the type.
428 /// It returns EVT::Other if the type should be determined using generic
429 /// target-independent logic.
430430 virtual EVT
431431 getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign,
432432 bool NonScalarIntSafe, bool MemcpyStrSrc,
433 SelectionDAG &DAG) const;
433 MachineFunction &MF) const;
434434
435435 /// allowsUnalignedMemoryAccesses - Returns true if the target allows
436436 /// unaligned memory accesses. of the specified type.