From d32f2f27e9bed303ce454ec48608204fba1e1194 Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Tue, 25 Jun 2013 07:57:02 -0700 Subject: PNaCl ABI: Disallow various operations on the i1 type Disallow i1 on loads/stores and require the conversions to i8 to be explicit. Add a pass, PromoteI1Ops, that adds the conversions. (Load/store on i1 occur in practice in small_tests for some boolean globals.) Disallow i1 for most arithmetic/comparison operations since these aren't very useful and it's a nuisance for a code generator to have to support these. I haven't seen these occur in practice, but PromoteI1Ops nevertheless expands them. We still allow and/or/xor on i1 because these do occur in practice, and they're less of a nuisance to handle because they never overflow: no truncation to 1 bit is required, unlike with adds. Restrict the type of alloca's argument. Clang always uses i32 here. Disallow i1 in switch instructions. Clang doesn't generate i1 switches for booleans. Move CopyLoadOrStoreAttrs() helper into a header to reuse. BUG=https://code.google.com/p/nativeclient/issues/detail?id=3490 TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k Review URL: https://codereview.chromium.org/17356011 --- tools/opt/opt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'tools') diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index 804382fca7..56ac3ec9a7 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -620,6 +620,7 @@ int main(int argc, char **argv) { initializeInsertDivideCheckPass(Registry); initializePNaClABIVerifyFunctionsPass(Registry); initializePNaClABIVerifyModulePass(Registry); + initializePromoteI1OpsPass(Registry); initializePromoteIntegersPass(Registry); initializeReplacePtrsWithIntsPass(Registry); initializeResolveAliasesPass(Registry); -- cgit v1.2.3-18-g5258