Cleaned up debug variants of libclcore.bc

Bug: 38418449
Bug: 62028512
Bug: 37955136

Two major changes:
(More motivation/explanation/discussion are in the tagged bugs.)

1) Added the fourth variant of libclcore.bc, libclcore_debug_g.bc,
which both gets compiled with -g -O0 and provides runtime range
checking. This is needed for debug context related CTS tests to pass
when they are compiled with flags -g -O0.

2) Removed Element setters and getters defined under RS_G_RUNTIME.
The removed code is neither necessary or correct. After the
RS_G_RUNTIME specific setter/getter implementation was removed,
a bug in the default setter/getter implementation showed up with -O0
compilation as described in Bug 38418449, which caused segfaults
due to mismatch argument type between callers and callees of
rsSetElementAtImpl_<T>() and __rsAllocationVStoreImpl_<T>().
To fix it, I adjusted argument type in rsSetElementAtImpl_<T>() and
__rsAllocationVStoreXImpl_<T> defined in
frameworks/rs/driver/runtime/ll64/allocation.ll to match clang-
generated code from frameworks/rs/driver/runtime/rs_allocation.c.
E.g., char4 was <4 x i8> in ll64/allocation.ll, but was i32 in code
generated by clang. This caused segfaults on calls to the affected
functions in the final arm64-v8a code. short2 and half2 also have the
issue and fix.

Test: CTS on Angler and X86_64:
Test: With tests compiled using -g -O0 and system property
      debug.rs.debug set to 1;
Test: With tests compiled using -g -O0;
Test: With tests compiled using the default flags;
Test: With tests compiled using the default flags and system property
      debug.rs.debug set to 1.

Test: LLDB tests on X86_64 with no additional failures than those are
      known to fail.

Change-Id: I23bd9ab6c7648d2762a77977f08ad3f20e31941c
5 files changed
tree: 22a16b9c7cd6c78553f33e9b13bda5fa01516006
  1. cpp/
  2. cpu_ref/
  3. driver/
  4. rsov/
  5. script_api/
  6. support/
  7. tests/
  8. Android.bp
  9. Android.mk
  10. build_rs.py
  11. CleanSpec.mk
  12. libRS.map
  13. OWNERS
  14. rs.h
  15. rs.spec
  16. rs_compat.spec
  17. rs_hal.h
  18. rsAllocation.cpp
  19. rsAllocation.h
  20. rsAnimation.cpp
  21. rsAnimation.h
  22. rsApiAllocation.cpp
  23. rsApiContext.cpp
  24. rsApiDevice.cpp
  25. rsApiElement.cpp
  26. rsApiFileA3D.cpp
  27. rsApiMesh.cpp
  28. rsApiStubs.cpp
  29. rsApiStubs.h
  30. rsApiType.cpp
  31. rsClosure.cpp
  32. rsClosure.h
  33. rsCompatibilityLib.h
  34. rsComponent.cpp
  35. rsComponent.h
  36. rsContext.cpp
  37. rsContext.h
  38. rsCppUtils.cpp
  39. rsCppUtils.h
  40. rsDebugHelper.h
  41. rsDefines.h
  42. rsDevice.cpp
  43. rsDevice.h
  44. rsDriverLoader.cpp
  45. rsElement.cpp
  46. rsElement.h
  47. rsEnv.h
  48. rsFallbackAdaptation.cpp
  49. rsFallbackAdaptation.h
  50. rsFBOCache.cpp
  51. rsFBOCache.h
  52. rsFifo.h
  53. rsFifoSocket.cpp
  54. rsFifoSocket.h
  55. rsFileA3D.cpp
  56. rsFileA3D.h
  57. rsFont.cpp
  58. rsFont.h
  59. rsg.spec
  60. rsg_generator.c
  61. rsgApi.cpp_rsg
  62. rsgApiFuncDecl.h_rsg
  63. rsgApiReplay.cpp_rsg
  64. rsgApiStructs.h_rsg
  65. rsGrallocConsumer.cpp
  66. rsGrallocConsumer.h
  67. rsHidlAdaptation.cpp
  68. rsHidlAdaptation.h
  69. rsInternalDefines.h
  70. rsList.h
  71. rsMap.h
  72. rsMatrix2x2.cpp
  73. rsMatrix2x2.h
  74. rsMatrix3x3.cpp
  75. rsMatrix3x3.h
  76. rsMatrix4x4.cpp
  77. rsMatrix4x4.h
  78. rsMesh.cpp
  79. rsMesh.h
  80. rsMutex.cpp
  81. rsMutex.h
  82. rsObjectBase.cpp
  83. rsObjectBase.h
  84. rsProgram.cpp
  85. rsProgram.h
  86. rsProgramBase.h
  87. rsProgramFragment.cpp
  88. rsProgramFragment.h
  89. rsProgramRaster.cpp
  90. rsProgramRaster.h
  91. rsProgramStore.cpp
  92. rsProgramStore.h
  93. rsProgramVertex.cpp
  94. rsProgramVertex.h
  95. rsRuntime.h
  96. rsSampler.cpp
  97. rsSampler.h
  98. rsScript.cpp
  99. rsScript.h
  100. rsScriptC.cpp
  101. rsScriptC.h
  102. rsScriptC_Lib.cpp
  103. rsScriptC_LibGL.cpp
  104. rsScriptGroup.cpp
  105. rsScriptGroup.h
  106. rsScriptGroup2.cpp
  107. rsScriptGroup2.h
  108. rsScriptGroupBase.h
  109. rsScriptIntrinsic.cpp
  110. rsScriptIntrinsic.h
  111. rsSignal.cpp
  112. rsSignal.h
  113. rsStream.cpp
  114. rsStream.h
  115. rsThreadIO.cpp
  116. rsThreadIO.h
  117. rsType.cpp
  118. rsType.h
  119. rsUtils.h
  120. run_rs_cts.sh
  121. spec.h
  122. spec.l
  123. support.bp
  124. update-prebuilts.py
  125. update_rs_prebuilts.sh