diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-03-12 21:02:54 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2019-03-12 21:02:54 +0000 |
commit | caf1316f7100e1ba1e7e800eae6a5adf0d48bf90 (patch) | |
tree | 7b79b67ccf3ffe7fe9b56dee66444a586d7714d2 /llvm/lib/Bitcode/Reader | |
parent | 9df0754b8dbeeb597a22bb0418eb0ee04ce88b56 (diff) | |
download | bcm5719-llvm-caf1316f7100e1ba1e7e800eae6a5adf0d48bf90.tar.gz bcm5719-llvm-caf1316f7100e1ba1e7e800eae6a5adf0d48bf90.zip |
IR: Add immarg attribute
This indicates an intrinsic parameter is required to be a constant,
and should not be replaced with a non-constant value.
Add the attribute to all AMDGPU and generic intrinsics that comments
indicate it should apply to. I scanned other target intrinsics, but I
don't see any obvious comments indicating which arguments are intended
to be only immediates.
This breaks one questionable testcase for the autoupgrade. I'm unclear
on whether the autoupgrade is supposed to really handle declarations
which were never valid. The verifier fails because the attributes now
refer to a parameter past the end of the argument list.
llvm-svn: 355981
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index b94bb66a0d6..b9f93dc522f 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1188,6 +1188,8 @@ static uint64_t getRawAttributeMask(Attribute::AttrKind Val) { case Attribute::ShadowCallStack: return 1ULL << 59; case Attribute::SpeculativeLoadHardening: return 1ULL << 60; + case Attribute::ImmArg: + return 1ULL << 61; case Attribute::Dereferenceable: llvm_unreachable("dereferenceable attribute not supported in raw format"); break; @@ -1424,6 +1426,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) { return Attribute::WriteOnly; case bitc::ATTR_KIND_Z_EXT: return Attribute::ZExt; + case bitc::ATTR_KIND_IMMARG: + return Attribute::ImmArg; } } |