[clang] [AIX] recognize vsr in inline asm for AIX (PR #68476)

Chen Zheng via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 10 18:48:56 PDT 2023


================
@@ -828,10 +829,7 @@ const TargetInfo::AddlRegName GCCAddlRegNames[] = {
 };
 
 ArrayRef<TargetInfo::AddlRegName> PPCTargetInfo::getGCCAddlRegNames() const {
-  if (ABI == "elfv2")
-    return llvm::ArrayRef(GCCAddlRegNames);
-  else
-    return TargetInfo::getGCCAddlRegNames();
+  return llvm::ArrayRef(GCCAddlRegNames);
----------------
chenzheng1030 wrote:

Accepting an non-exist(future defined) register in the asm clobber list should not cause any issue in the compiler side, I think. The register allocator can not allocate these future defined registers anyhow.

The more serious issue is that clang accepts vsx instructions in asm block even for targets that does not have VSX, see https://godbolt.org/z/rYnMbPPTE (gcc has same behavior.)

https://github.com/llvm/llvm-project/pull/68476


More information about the cfe-commits mailing list