[PATCH] D72742: Don't assume promotable integers are zero/sign-extended already in x86-64 ABI.

Emilio Cobos Álvarez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 14 16:02:25 PST 2020


emilio created this revision.
Herald added a reviewer: jdoerfert.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

Sign-extension is not guaranteed by the ABI, and thus the callee cannot assume
it.

This fixes PR44228 and PR12207.

With these changes, there are still two tests that need updating:

- CodeGenObjC/optimized-setter.m fails with:

  clang: llvm/lib/IR/Instructions.cpp:400: void llvm::CallInst::init(llvm::FunctionType *, llvm::Value *, ArrayRef<llvm::Value *>, ArrayRef<llvm::OperandBundleDef>, const llvm::Twine &): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.



- OpenMP/parallel_for_simd_codegen.cpp fails with:

  clang: clang/lib/CodeGen/CGCall.cpp:3858: clang::CodeGen::RValue clang::CodeGen::CodeGenFunction::EmitCall(const clang::CodeGen::CGFunctionInfo &, const clang::CodeGen::CGCallee &, clang::CodeGen::ReturnValueSlot, const clang::CodeGen::CallArgList &, llvm::CallBase **, clang::SourceLocation): Assertion `IRFuncTy == TypeFromVal' failed.

These two are probably bad assumptions in some of the ObjC / OpenMP-specific
code, but I want to check this patch is on the right track before digging more.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D72742

Files:
  clang/lib/CodeGen/TargetInfo.cpp
  clang/test/CodeGen/2007-06-18-SextAttrAggregate.c
  clang/test/CodeGen/avx512-reduceMinMaxIntrin.c
  clang/test/CodeGen/catch-implicit-integer-sign-changes.c
  clang/test/CodeGen/function-attributes.c
  clang/test/CodeGen/regcall.c
  clang/test/CodeGen/x86_64-arguments-nacl.c
  clang/test/CodeGen/x86_64-arguments.c
  clang/test/CodeGenCXX/blocks.cpp
  clang/test/CodeGenCXX/const-init-cxx11.cpp
  clang/test/CodeGenCXX/cxx1z-initializer-aggregate.cpp
  clang/test/CodeGenCXX/exceptions.cpp
  clang/test/CodeGenCXX/forward-enum.cpp
  clang/test/CodeGenCXX/value-init.cpp
  clang/test/CodeGenCXX/virtual-bases.cpp
  clang/test/CodeGenObjC/arc-blocks.m
  clang/test/CodeGenObjC/arc-literals.m
  clang/test/CodeGenObjC/arc-property.m
  clang/test/CodeGenObjC/arc-ternary-op.m
  clang/test/CodeGenObjC/atomic-aggregate-property.m
  clang/test/CodeGenObjC/objc-literal-tests.m
  clang/test/CodeGenObjC/objc_copyStruct.m
  clang/test/CodeGenObjC/property-atomic-bool.m
  clang/test/CodeGenObjCXX/property-object-reference-1.mm
  llvm/test/CodeGen/X86/x86-64-arg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72742.238131.patch
Type: text/x-patch
Size: 31985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200115/48634caa/attachment-0001.bin>


More information about the cfe-commits mailing list