39 #include "LLVMAliasAnalyzer.hh"
45 #include <llvm/CodeGen/MachineInstr.h>
46 #include "tce_config.h"
47 #include <llvm/IR/Value.h>
48 #include <llvm/CodeGen/MachineMemOperand.h>
50 #include <llvm/Analysis/AliasAnalysis.h>
63 #define MayAlias llvm::AliasResult::Kind::MayAlias
64 #define PartialAlias llvm::AliasResult::Kind::PartialAlias
65 #define MustAlias llvm::AliasResult::Kind::MustAlias
66 #define NoAlias llvm::AliasResult::Kind::NoAlias
80 if (instr && !instr->memoperands_empty()) {
103 return ALIAS_UNKNOWN;
106 if (!isAddressTraceable(ddg, pop1) ||
107 !isAddressTraceable(ddg, pop2) ||
109 return ALIAS_UNKNOWN;
115 llvm::MachineInstr::mmo_iterator begin1 =
116 instr1->memoperands_begin();
120 while (begin1 != instr1->memoperands_end()) {
121 const llvm::Value* val1 = (*begin1)->getValue();
122 uint64_t size1 = (*begin1)->getSize();
123 llvm::MachineInstr::mmo_iterator begin2 =
124 instr2->memoperands_begin();
126 while (begin2 != instr2->memoperands_end()) {
127 const llvm::Value* val2 = (*begin2)->getValue();
128 uint64_t size2 = (*begin2)->getSize();
132 AA_->alias(val1, size1, val2, size2);
135 result = ALIAS_UNKNOWN;
141 result = ALIAS_FALSE;
144 result = ALIAS_UNKNOWN;