diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-25 07:57:02 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-25 07:57:02 -0700 |
commit | d32f2f27e9bed303ce454ec48608204fba1e1194 (patch) | |
tree | bbcf1b66bea25bb80bebe741a3f5111ec92b4899 /tools | |
parent | 29faec27f780be4336e0f210e8dd96582c989d3a (diff) |
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
Diffstat (limited to 'tools')
-rw-r--r-- | tools/opt/opt.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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); |