Subzero: Run sandboxed cross tests, and do some cleanup.
Tests all cross tests in both sandboxed and unsandboxed modes. Unfortunately, crosstest run time is more than doubled because of LTO of the crosstest drivers. (We may want to add "full" and "lite" versions of cross tests.)
LLVM triple strings are removed where possible (from .ll files), and when generated, we use just i686 or i686-nacl.
"Fix" the integrated assembler to emit the lock prefix after the 16-bit operand prefix, to make the validator happy.
Don't add external symbol references to the ELF file for llvm.* intrinsic functions.
Make the ELF object writer honor the -externalize argument.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=4092
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/973823003
diff --git a/src/IceConverter.cpp b/src/IceConverter.cpp
index 111a52b..a078a67 100644
--- a/src/IceConverter.cpp
+++ b/src/IceConverter.cpp
@@ -555,19 +555,15 @@
if (const auto Target = dyn_cast<Ice::ConstantRelocatable>(CallTarget)) {
// Check if this direct call is to an Intrinsic (starts with "llvm.")
- static const char LLVMPrefix[] = "llvm.";
- const size_t LLVMPrefixLen = strlen(LLVMPrefix);
- Ice::IceString Name = Target->getName();
- if (Name.substr(0, LLVMPrefixLen) == LLVMPrefix) {
- Ice::IceString NameSuffix = Name.substr(LLVMPrefixLen);
- Info = Ctx->getIntrinsicsInfo().find(NameSuffix);
- if (!Info) {
- report_fatal_error(std::string("Invalid PNaCl intrinsic call: ") +
- LLVMObjectAsString(Inst));
- }
+ bool BadIntrinsic;
+ Info = Ctx->getIntrinsicsInfo().find(Target->getName(), BadIntrinsic);
+ if (BadIntrinsic) {
+ report_fatal_error(std::string("Invalid PNaCl intrinsic call: ") +
+ LLVMObjectAsString(Inst));
+ }
+ if (Info)
NewInst = Ice::InstIntrinsicCall::create(Func.get(), NumArgs, Dest,
CallTarget, Info->Info);
- }
}
// Not an intrinsic call.