[OpaquePtr][ARM] Use elementtype on ldrex/ldaex/stlex/strex

Includes verifier changes checking the elementtype, clang codegen
changes to emit the elementtype, and ISel changes using the elementtype.

Basically the same as D120527.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D121847
This commit is contained in:
Arthur Eubanks
2022-03-16 11:21:27 -07:00
parent 65370702b8
commit 2371c5a0e0
16 changed files with 201 additions and 132 deletions

View File

@@ -52,6 +52,7 @@
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/IntrinsicsAArch64.h"
#include "llvm/IR/IntrinsicsARM.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
#include "llvm/IR/Module.h"
@@ -4144,11 +4145,23 @@ Error BitcodeReader::propagateAttributeTypes(CallBase *CB,
case Intrinsic::aarch64_ldaxr:
case Intrinsic::aarch64_ldxr:
case Intrinsic::aarch64_stlxr:
case Intrinsic::aarch64_stxr: {
unsigned ArgNo = CB->getIntrinsicID() == Intrinsic::aarch64_stlxr ||
CB->getIntrinsicID() == Intrinsic::aarch64_stxr
? 1
: 0;
case Intrinsic::aarch64_stxr:
case Intrinsic::arm_ldaex:
case Intrinsic::arm_ldrex:
case Intrinsic::arm_stlex:
case Intrinsic::arm_strex: {
unsigned ArgNo;
switch (CB->getIntrinsicID()) {
case Intrinsic::aarch64_stlxr:
case Intrinsic::aarch64_stxr:
case Intrinsic::arm_stlex:
case Intrinsic::arm_strex:
ArgNo = 1;
break;
default:
ArgNo = 0;
break;
}
if (!Attrs.getParamElementType(ArgNo)) {
Type *ElTy = getPtrElementTypeByID(ArgTyIDs[ArgNo]);
if (!ElTy)