functions = []
lines = input_file.readlines()
+ deprecated = None
idx = 0
while idx < len(lines) - 1:
line = lines[idx].rstrip()
idx += 1
+ if deprecated is None:
+ deprecated = re.search(r'LLVM_ATTRIBUTE_DEPRECATED', line)
+
#match = re.search(r'\*Create', line)
match = re.search(r'[\*\s]Create(\w*)\(', line)
if match is not None:
#print('Line: %s' % match.group(1))
+ # Skip function if LLVM_ATTRIBUTE_DEPRECATED found before
+ if deprecated is not None:
+ deprecated = None
+ continue
+
if re.search(r'^\s*Create', line) is not None:
func_sig = lines[idx-2].rstrip() + line
else:
func_name == 'CreateMaskedLoad' or
func_name == 'CreateStore' or
func_name == 'CreateMaskedStore' or
+ func_name == 'CreateFCmpHelper' or
func_name == 'CreateElementUnorderedAtomicMemCpy'):
ignore = True
/// @param pVecPassthru - SIMD wide vector of values to load when lane is inactive
Value* Builder::GATHER_PTR(Value* pVecSrcPtr, Value* pVecMask, Value* pVecPassthru)
{
- return MASKED_GATHER(pVecSrcPtr, 4, pVecMask, pVecPassthru);
+ return MASKED_GATHER(pVecSrcPtr, AlignType(4), pVecMask, pVecPassthru);
}
void Builder::SCATTER_PTR(Value* pVecDstPtr, Value* pVecSrc, Value* pVecMask)
{
- MASKED_SCATTER(pVecSrc, pVecDstPtr, 4, pVecMask);
+ MASKED_SCATTER(pVecSrc, pVecDstPtr, AlignType(4), pVecMask);
}
void Builder::Gather4(const SWR_FORMAT format,
Type* Ty = nullptr,
MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
{
- return IRB()->CreateMaskedLoad(Ptr, Align, Mask, PassThru, Name);
+ return IRB()->CreateMaskedLoad(Ptr, AlignType(Align), Mask, PassThru, Name);
}
virtual StoreInst* STORE(Value *Val, Value *Ptr, bool isVolatile = false, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
virtual CallInst* MASKED_STORE(Value *Val, Value *Ptr, unsigned Align, Value *Mask, Type* Ty = nullptr, MEM_CLIENT usage = MEM_CLIENT::MEM_CLIENT_INTERNAL)
{
- return IRB()->CreateMaskedStore(Val, Ptr, Align, Mask);
+ return IRB()->CreateMaskedStore(Val, Ptr, AlignType(Align), Mask);
}
LoadInst* LOADV(Value* BasePtr, const std::initializer_list<Value*>& offset, const llvm::Twine& name = "");
******************************************************************************/
#pragma once
+#if LLVM_VERSION_MAJOR > 10
+ typedef llvm::Align AlignType;
+#else
+ typedef unsigned AlignType;
+#endif
+
Constant* C(bool i);
Constant* C(char i);
Constant* C(uint8_t i);
{
using namespace llvm;
+#if LLVM_VERSION_MAJOR > 10
+ typedef unsigned IntrinsicID;
+#else
+ typedef Intrinsic::ID IntrinsicID;
+#endif
+
enum TargetArch
{
AVX = 0,
struct X86Intrinsic
{
- Intrinsic::ID intrin[NUM_WIDTHS];
+ IntrinsicID intrin[NUM_WIDTHS];
EmuFunc emuFunc;
};
// Map of intrinsics that haven't been moved to the new mechanism yet. If used, these get the
// previous behavior of mapping directly to avx/avx2 intrinsics.
- static std::map<std::string, Intrinsic::ID> intrinsicMap = {
+ static std::map<std::string, IntrinsicID> intrinsicMap = {
{"meta.intrinsic.BEXTR_32", Intrinsic::x86_bmi_bextr_32},
{"meta.intrinsic.VPSHUFB", Intrinsic::x86_avx2_pshuf_b},
{"meta.intrinsic.VCVTPS2PH", Intrinsic::x86_vcvtps2ph_256},
Function* pFunc = pCallInst->getCalledFunction();
assert(pFunc);
- auto& intrinsic = intrinsicMap2[mTarget][pFunc->getName()];
+ auto& intrinsic = intrinsicMap2[mTarget][pFunc->getName().str()];
TargetWidth vecWidth;
Type* pElemTy;
GetRequestedWidthAndType(pCallInst, pFunc->getName(), &vecWidth, &pElemTy);
// Check if there is a native intrinsic for this instruction
- Intrinsic::ID id = intrinsic.intrin[vecWidth];
+ IntrinsicID id = intrinsic.intrin[vecWidth];
if (id == DOUBLE)
{
// Double pump the next smaller SIMD intrinsic
assert(pFunc);
// Forward to the advanced support if found
- if (intrinsicMap2[mTarget].find(pFunc->getName()) != intrinsicMap2[mTarget].end())
+ if (intrinsicMap2[mTarget].find(pFunc->getName().str()) != intrinsicMap2[mTarget].end())
{
return ProcessIntrinsicAdvanced(pCallInst);
}
- SWR_ASSERT(intrinsicMap.find(pFunc->getName()) != intrinsicMap.end(),
+ SWR_ASSERT(intrinsicMap.find(pFunc->getName().str()) != intrinsicMap.end(),
"Unimplemented intrinsic %s.",
- pFunc->getName());
+ pFunc->getName().str());
- Intrinsic::ID x86Intrinsic = intrinsicMap[pFunc->getName()];
+ Intrinsic::ID x86Intrinsic = intrinsicMap[pFunc->getName().str()];
Function* pX86IntrinFunc =
Intrinsic::getDeclaration(B->JM()->mpCurrentModule, x86Intrinsic);