Index: lib/Target/PowerPC/PPCInstr64Bit.td =================================================================== --- lib/Target/PowerPC/PPCInstr64Bit.td +++ lib/Target/PowerPC/PPCInstr64Bit.td @@ -972,13 +972,15 @@ // Support for medium and large code model. let hasSideEffects = 0 in { +let isReMaterializable = 1 in { def ADDIStocHA: Pseudo<(outs g8rc:$rD), (ins g8rc_nox0:$reg, tocentry:$disp), "#ADDIStocHA", []>, isPPC64; +def ADDItocL: Pseudo<(outs g8rc:$rD), (ins g8rc_nox0:$reg, tocentry:$disp), + "#ADDItocL", []>, isPPC64; +} let mayLoad = 1 in def LDtocL: Pseudo<(outs g8rc:$rD), (ins tocentry:$disp, g8rc_nox0:$reg), "#LDtocL", []>, isPPC64; -def ADDItocL: Pseudo<(outs g8rc:$rD), (ins g8rc_nox0:$reg, tocentry:$disp), - "#ADDItocL", []>, isPPC64; } // Support for thread-local storage. Index: lib/Target/PowerPC/PPCInstrInfo.h =================================================================== --- lib/Target/PowerPC/PPCInstrInfo.h +++ lib/Target/PowerPC/PPCInstrInfo.h @@ -162,6 +162,8 @@ unsigned &SubIdx) const override; unsigned isLoadFromStackSlot(const MachineInstr &MI, int &FrameIndex) const override; + bool isReallyTriviallyReMaterializable(const MachineInstr &MI, + AliasAnalysis *AA) const override; unsigned isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const override; Index: lib/Target/PowerPC/PPCInstrInfo.cpp =================================================================== --- lib/Target/PowerPC/PPCInstrInfo.cpp +++ lib/Target/PowerPC/PPCInstrInfo.cpp @@ -292,6 +292,25 @@ return 0; } +bool PPCInstrInfo::isReallyTriviallyReMaterializable(const MachineInstr &MI, + AliasAnalysis *AA) const { + switch (MI.getOpcode()) { + default: + llvm_unreachable("Can not confirm opcode is really rematerializable"); + break; + case PPC::LI: + case PPC::LI8: + case PPC::LIS: + case PPC::LIS8: + case PPC::QVGPCI: + case PPC::ADDIStocHA: + case PPC::ADDItocL: + case PPC::LOAD_STACK_GUARD: + return true; + } + return false; +} + unsigned PPCInstrInfo::isStoreToStackSlot(const MachineInstr &MI, int &FrameIndex) const { // Note: This list must be kept consistent with StoreRegToStackSlot. Index: test/CodeGen/PowerPC/licm-remat.ll =================================================================== --- /dev/null +++ test/CodeGen/PowerPC/licm-remat.ll @@ -0,0 +1,201 @@ +; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-linux-gnu < %s | FileCheck %s + +; Test case is reduced from the snappy benchmark. +; Verify MachineLICM will always hoist trivially rematerializable instructions even when register pressure is high. + +%"class.snappy::internal::WorkingMemory.0.198.440.462.506.528.550.594.660.682.704.726.748.770.792.858.880.924.968.1034.1056.1100.1122.1144.1188.1386.1452.1540.1892.2002.2200.2486.2860.2926.3168.5918.5940.6204.6468.6754.7260.7392.7458.7700" = type { [1024 x i16], i16* } +%"class.snappy::SnappyDecompressor.2.200.442.464.508.530.552.596.662.684.706.728.750.772.794.860.882.926.970.1036.1058.1102.1124.1146.1190.1388.1454.1542.1894.2004.2202.2488.2862.2928.3170.5920.5942.6206.6470.6756.7262.7394.7460.7702" = type <{ %"class.snappy::Source.1.199.441.463.507.529.551.595.661.683.705.727.749.771.793.859.881.925.969.1035.1057.1101.1123.1145.1189.1387.1453.1541.1893.2003.2201.2487.2861.2927.3169.5919.5941.6205.6469.6755.7261.7393.7459.7701"*, i8*, i8*, i32, i8, [5 x i8], [6 x i8] }> +%"class.snappy::Source.1.199.441.463.507.529.551.595.661.683.705.727.749.771.793.859.881.925.969.1035.1057.1101.1123.1145.1189.1387.1453.1541.1893.2003.2201.2487.2861.2927.3169.5919.5941.6205.6469.6755.7261.7393.7459.7701" = type { i32 (...)** } +%"class.snappy::Sink.3.201.443.465.509.531.553.597.663.685.707.729.751.773.795.861.883.927.971.1037.1059.1103.1125.1147.1191.1389.1455.1543.1895.2005.2203.2489.2863.2929.3171.5921.5943.6207.6471.6757.7263.7395.7461.7703" = type { i32 (...)** } +%"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704" = type { i8*, i64 } +%"class.snappy::ByteArraySource.5.203.445.467.511.533.555.599.665.687.709.731.753.775.797.863.885.929.973.1039.1061.1105.1127.1149.1193.1391.1457.1545.1897.2007.2205.2491.2865.2931.3173.5923.5945.6209.6473.6759.7265.7397.7463.7705" = type { %"class.snappy::Source.1.199.441.463.507.529.551.595.661.683.705.727.749.771.793.859.881.925.969.1035.1057.1101.1123.1145.1189.1387.1453.1541.1893.2003.2201.2487.2861.2927.3169.5919.5941.6205.6469.6755.7261.7393.7459.7701", i8*, i64 } +%"class.std::__cxx11::basic_string.8.206.448.470.514.536.558.602.668.690.712.734.756.778.800.866.888.932.976.1042.1064.1108.1130.1152.1196.1394.1460.1548.1900.2010.2208.2494.2868.2934.3176.5926.5948.6212.6476.6762.7268.7400.7466.7708" = type { %"struct.std::__cxx11::basic_string, std::allocator >::_Alloc_hider.6.204.446.468.512.534.556.600.666.688.710.732.754.776.798.864.886.930.974.1040.1062.1106.1128.1150.1194.1392.1458.1546.1898.2008.2206.2492.2866.2932.3174.5924.5946.6210.6474.6760.7266.7398.7464.7706", i64, %union.anon.7.205.447.469.513.535.557.601.667.689.711.733.755.777.799.865.887.931.975.1041.1063.1107.1129.1151.1195.1393.1459.1547.1899.2009.2207.2493.2867.2933.3175.5925.5947.6211.6475.6761.7267.7399.7465.7707 } +%"struct.std::__cxx11::basic_string, std::allocator >::_Alloc_hider.6.204.446.468.512.534.556.600.666.688.710.732.754.776.798.864.886.930.974.1040.1062.1106.1128.1150.1194.1392.1458.1546.1898.2008.2206.2492.2866.2932.3174.5924.5946.6210.6474.6760.7266.7398.7464.7706" = type { i8* } +%union.anon.7.205.447.469.513.535.557.601.667.689.711.733.755.777.799.865.887.931.975.1041.1063.1107.1129.1151.1195.1393.1459.1547.1899.2009.2207.2493.2867.2933.3175.5925.5947.6211.6475.6761.7267.7399.7465.7707 = type { i64, [8 x i8] } +%"class.snappy::SnappyDecompressionValidator.9.207.449.471.515.537.559.603.669.691.713.735.757.779.801.867.889.933.977.1043.1065.1109.1131.1153.1197.1395.1461.1549.1901.2011.2209.2495.2869.2935.3177.5927.5949.6213.6477.6763.7269.7401.7467.7709" = type { i64, i64 } +%"class.snappy::UncheckedByteArraySink.10.208.450.472.516.538.560.604.670.692.714.736.758.780.802.868.890.934.978.1044.1066.1110.1132.1154.1198.1396.1462.1550.1902.2012.2210.2496.2870.2936.3178.5928.5950.6214.6478.6764.7270.7402.7468.7710" = type { %"class.snappy::Sink.3.201.443.465.509.531.553.597.663.685.707.729.751.773.795.861.883.927.971.1037.1059.1103.1125.1147.1191.1389.1455.1543.1895.2005.2203.2489.2863.2929.3171.5921.5943.6207.6471.6757.7263.7395.7461.7703", i8* } +%"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711" = type { %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"*, i64, i64, i64, i64, i64 } +%"class.snappy::SnappyArrayWriter.12.210.452.474.518.540.562.606.672.694.716.738.760.782.804.870.892.936.980.1046.1068.1112.1134.1156.1200.1398.1464.1552.1904.2014.2212.2498.2872.2938.3180.5930.5952.6216.6480.6766.7272.7404.7470.7712" = type { i8*, i8*, i8* } +%"class.snappy::SnappyScatteredWriter.21.219.461.483.527.549.571.615.681.703.725.747.769.791.813.879.901.945.989.1055.1077.1121.1143.1165.1209.1407.1473.1561.1913.2023.2221.2507.2881.2947.3189.5939.5961.6225.6489.6775.7281.7413.7479.7721" = type { %"class.snappy::SnappySinkAllocator.17.215.457.479.523.545.567.611.677.699.721.743.765.787.809.875.897.941.985.1051.1073.1117.1139.1161.1205.1403.1469.1557.1909.2019.2217.2503.2877.2943.3185.5935.5957.6221.6485.6771.7277.7409.7475.7717", %"class.std::vector.3.20.218.460.482.526.548.570.614.680.702.724.746.768.790.812.878.900.944.988.1054.1076.1120.1142.1164.1208.1406.1472.1560.1912.2022.2220.2506.2880.2946.3188.5938.5960.6224.6488.6774.7280.7412.7478.7720", i64, i64, i8*, i8*, i8* } +%"class.snappy::SnappySinkAllocator.17.215.457.479.523.545.567.611.677.699.721.743.765.787.809.875.897.941.985.1051.1073.1117.1139.1161.1205.1403.1469.1557.1909.2019.2217.2503.2877.2943.3185.5935.5957.6221.6485.6771.7277.7409.7475.7717" = type { %"class.snappy::Sink.3.201.443.465.509.531.553.597.663.685.707.729.751.773.795.861.883.927.971.1037.1059.1103.1125.1147.1191.1389.1455.1543.1895.2005.2203.2489.2863.2929.3171.5921.5943.6207.6471.6757.7263.7395.7461.7703"*, %"class.std::vector.16.214.456.478.522.544.566.610.676.698.720.742.764.786.808.874.896.940.984.1050.1072.1116.1138.1160.1204.1402.1468.1556.1908.2018.2216.2502.2876.2942.3184.5934.5956.6220.6484.6770.7276.7408.7474.7716" } +%"class.std::vector.16.214.456.478.522.544.566.610.676.698.720.742.764.786.808.874.896.940.984.1050.1072.1116.1138.1160.1204.1402.1468.1556.1908.2018.2216.2502.2876.2942.3184.5934.5956.6220.6484.6770.7276.7408.7474.7716" = type { %"struct.std::_Vector_base.15.213.455.477.521.543.565.609.675.697.719.741.763.785.807.873.895.939.983.1049.1071.1115.1137.1159.1203.1401.1467.1555.1907.2017.2215.2501.2875.2941.3183.5933.5955.6219.6483.6769.7275.7407.7473.7715" } +%"struct.std::_Vector_base.15.213.455.477.521.543.565.609.675.697.719.741.763.785.807.873.895.939.983.1049.1071.1115.1137.1159.1203.1401.1467.1555.1907.2017.2215.2501.2875.2941.3183.5933.5955.6219.6483.6769.7275.7407.7473.7715" = type { %"struct.std::_Vector_base >::_Vector_impl.14.212.454.476.520.542.564.608.674.696.718.740.762.784.806.872.894.938.982.1048.1070.1114.1136.1158.1202.1400.1466.1554.1906.2016.2214.2500.2874.2940.3182.5932.5954.6218.6482.6768.7274.7406.7472.7714" } +%"struct.std::_Vector_base >::_Vector_impl.14.212.454.476.520.542.564.608.674.696.718.740.762.784.806.872.894.938.982.1048.1070.1114.1136.1158.1202.1400.1466.1554.1906.2016.2214.2500.2874.2940.3182.5932.5954.6218.6482.6768.7274.7406.7472.7714" = type { %"struct.snappy::SnappySinkAllocator::Datablock.13.211.453.475.519.541.563.607.673.695.717.739.761.783.805.871.893.937.981.1047.1069.1113.1135.1157.1201.1399.1465.1553.1905.2015.2213.2499.2873.2939.3181.5931.5953.6217.6481.6767.7273.7405.7471.7713"*, %"struct.snappy::SnappySinkAllocator::Datablock.13.211.453.475.519.541.563.607.673.695.717.739.761.783.805.871.893.937.981.1047.1069.1113.1135.1157.1201.1399.1465.1553.1905.2015.2213.2499.2873.2939.3181.5931.5953.6217.6481.6767.7273.7405.7471.7713"*, %"struct.snappy::SnappySinkAllocator::Datablock.13.211.453.475.519.541.563.607.673.695.717.739.761.783.805.871.893.937.981.1047.1069.1113.1135.1157.1201.1399.1465.1553.1905.2015.2213.2499.2873.2939.3181.5931.5953.6217.6481.6767.7273.7405.7471.7713"* } +%"struct.snappy::SnappySinkAllocator::Datablock.13.211.453.475.519.541.563.607.673.695.717.739.761.783.805.871.893.937.981.1047.1069.1113.1135.1157.1201.1399.1465.1553.1905.2015.2213.2499.2873.2939.3181.5931.5953.6217.6481.6767.7273.7405.7471.7713" = type { i8*, i64 } +%"class.std::vector.3.20.218.460.482.526.548.570.614.680.702.724.746.768.790.812.878.900.944.988.1054.1076.1120.1142.1164.1208.1406.1472.1560.1912.2022.2220.2506.2880.2946.3188.5938.5960.6224.6488.6774.7280.7412.7478.7720" = type { %"struct.std::_Vector_base.4.19.217.459.481.525.547.569.613.679.701.723.745.767.789.811.877.899.943.987.1053.1075.1119.1141.1163.1207.1405.1471.1559.1911.2021.2219.2505.2879.2945.3187.5937.5959.6223.6487.6773.7279.7411.7477.7719" } +%"struct.std::_Vector_base.4.19.217.459.481.525.547.569.613.679.701.723.745.767.789.811.877.899.943.987.1053.1075.1119.1141.1163.1207.1405.1471.1559.1911.2021.2219.2505.2879.2945.3187.5937.5959.6223.6487.6773.7279.7411.7477.7719" = type { %"struct.std::_Vector_base >::_Vector_impl.18.216.458.480.524.546.568.612.678.700.722.744.766.788.810.876.898.942.986.1052.1074.1118.1140.1162.1206.1404.1470.1558.1910.2020.2218.2504.2878.2944.3186.5936.5958.6222.6486.6772.7278.7410.7476.7718" } +%"struct.std::_Vector_base >::_Vector_impl.18.216.458.480.524.546.568.612.678.700.722.744.766.788.810.876.898.942.986.1052.1074.1118.1140.1162.1206.1404.1470.1558.1910.2020.2218.2504.2878.2944.3186.5936.5958.6222.6486.6772.7278.7410.7476.7718" = type { i8**, i8**, i8** } + +$_ZN6snappy18SnappyDecompressor17DecompressAllTagsINS_17SnappyIOVecWriterEEEvPT_ = comdat any + +@_ZN6snappy8internalL10char_tableE = internal unnamed_addr constant [256 x i16] [i16 1, i16 2052, i16 4097, i16 8193, i16 2, i16 2053, i16 4098, i16 8194, i16 3, i16 2054, i16 4099, i16 8195, i16 4, i16 2055, i16 4100, i16 8196, i16 5, i16 2056, i16 4101, i16 8197, i16 6, i16 2057, i16 4102, i16 8198, i16 7, i16 2058, i16 4103, i16 8199, i16 8, i16 2059, i16 4104, i16 8200, i16 9, i16 2308, i16 4105, i16 8201, i16 10, i16 2309, i16 4106, i16 8202, i16 11, i16 2310, i16 4107, i16 8203, i16 12, i16 2311, i16 4108, i16 8204, i16 13, i16 2312, i16 4109, i16 8205, i16 14, i16 2313, i16 4110, i16 8206, i16 15, i16 2314, i16 4111, i16 8207, i16 16, i16 2315, i16 4112, i16 8208, i16 17, i16 2564, i16 4113, i16 8209, i16 18, i16 2565, i16 4114, i16 8210, i16 19, i16 2566, i16 4115, i16 8211, i16 20, i16 2567, i16 4116, i16 8212, i16 21, i16 2568, i16 4117, i16 8213, i16 22, i16 2569, i16 4118, i16 8214, i16 23, i16 2570, i16 4119, i16 8215, i16 24, i16 2571, i16 4120, i16 8216, i16 25, i16 2820, i16 4121, i16 8217, i16 26, i16 2821, i16 4122, i16 8218, i16 27, i16 2822, i16 4123, i16 8219, i16 28, i16 2823, i16 4124, i16 8220, i16 29, i16 2824, i16 4125, i16 8221, i16 30, i16 2825, i16 4126, i16 8222, i16 31, i16 2826, i16 4127, i16 8223, i16 32, i16 2827, i16 4128, i16 8224, i16 33, i16 3076, i16 4129, i16 8225, i16 34, i16 3077, i16 4130, i16 8226, i16 35, i16 3078, i16 4131, i16 8227, i16 36, i16 3079, i16 4132, i16 8228, i16 37, i16 3080, i16 4133, i16 8229, i16 38, i16 3081, i16 4134, i16 8230, i16 39, i16 3082, i16 4135, i16 8231, i16 40, i16 3083, i16 4136, i16 8232, i16 41, i16 3332, i16 4137, i16 8233, i16 42, i16 3333, i16 4138, i16 8234, i16 43, i16 3334, i16 4139, i16 8235, i16 44, i16 3335, i16 4140, i16 8236, i16 45, i16 3336, i16 4141, i16 8237, i16 46, i16 3337, i16 4142, i16 8238, i16 47, i16 3338, i16 4143, i16 8239, i16 48, i16 3339, i16 4144, i16 8240, i16 49, i16 3588, i16 4145, i16 8241, i16 50, i16 3589, i16 4146, i16 8242, i16 51, i16 3590, i16 4147, i16 8243, i16 52, i16 3591, i16 4148, i16 8244, i16 53, i16 3592, i16 4149, i16 8245, i16 54, i16 3593, i16 4150, i16 8246, i16 55, i16 3594, i16 4151, i16 8247, i16 56, i16 3595, i16 4152, i16 8248, i16 57, i16 3844, i16 4153, i16 8249, i16 58, i16 3845, i16 4154, i16 8250, i16 59, i16 3846, i16 4155, i16 8251, i16 60, i16 3847, i16 4156, i16 8252, i16 2049, i16 3848, i16 4157, i16 8253, i16 4097, i16 3849, i16 4158, i16 8254, i16 6145, i16 3850, i16 4159, i16 8255, i16 8193, i16 3851, i16 4160, i16 8256], align 2 + +@_ZN6snappy8internalL8wordmaskE = internal unnamed_addr constant [5 x i32] [i32 0, i32 255, i32 65535, i32 16777215, i32 -1], align 4 + +; Function Attrs: argmemonly nounwind +declare void @llvm.memmove.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #2 + +; Function Attrs: argmemonly nounwind +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #2 + +define linkonce_odr void @_ZN6snappy18SnappyDecompressor17DecompressAllTagsINS_17SnappyIOVecWriterEEEvPT_(%"class.snappy::SnappyDecompressor.2.200.442.464.508.530.552.596.662.684.706.728.750.772.794.860.882.926.970.1036.1058.1102.1124.1146.1190.1388.1454.1542.1894.2004.2202.2488.2862.2928.3170.5920.5942.6206.6470.6756.7262.7394.7460.7702"* %this, %"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711"* %writer) local_unnamed_addr #3 comdat align 2 { +; CHECK-LABEL: _ZN6snappy18SnappyDecompressor17DecompressAllTagsINS_17SnappyIOVecWriterEEEvPT_: +; CHECK: # BB#0: # %entry +; CHECK: addis 3, 2, _ZN6snappy8internalL8wordmaskE@toc@ha +; CHECK-DIAG: addis 4, 2, _ZN6snappy8internalL10char_tableE@toc@ha +; CHECK-DIAG: addi 25, 3, _ZN6snappy8internalL8wordmaskE@toc@l +; CHECK-DIAG: addi 24, 4, _ZN6snappy8internalL10char_tableE@toc@l +; CHECK: b .LBB0_2 +; CHECK: .LBB0_2: # %for.cond +; CHECK-NOT: addis {{[0-9]+}}, 2, _ZN6snappy8internalL8wordmaskE@toc@ha +; CHECK-NOT: addis {{[0-9]+}}, 2, _ZN6snappy8internalL10char_tableE@toc@ha +; CHECK: bctrl +entry: + %ip_limit_ = getelementptr inbounds %"class.snappy::SnappyDecompressor.2.200.442.464.508.530.552.596.662.684.706.728.750.772.794.860.882.926.970.1036.1058.1102.1124.1146.1190.1388.1454.1542.1894.2004.2202.2488.2862.2928.3170.5920.5942.6206.6470.6756.7262.7394.7460.7702", %"class.snappy::SnappyDecompressor.2.200.442.464.508.530.552.596.662.684.706.728.750.772.794.860.882.926.970.1036.1058.1102.1124.1146.1190.1388.1454.1542.1894.2004.2202.2488.2862.2928.3170.5920.5942.6206.6470.6756.7262.7394.7460.7702"* %this, i64 0, i32 2 + %0 = bitcast i8** %ip_limit_ to i64* + %curr_iov_index_.i = getelementptr inbounds %"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711", %"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711"* %writer, i64 0, i32 2 + %curr_iov_written_.i = getelementptr inbounds %"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711", %"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711"* %writer, i64 0, i32 3 + %1 = bitcast i64* %curr_iov_written_.i to <2 x i64>* + br label %for.cond + +for.cond: ; preds = %if.end82, %if.then56, %if.end49, %entry + %ip.0 = phi i8* [ null, %entry ], [ %add.ptr50, %if.end49 ], [ null, %if.then56 ], [ undef, %if.end82 ] + %incdec.ptr = getelementptr inbounds i8, i8* %ip.0, i64 1 + %2 = load i8, i8* %ip.0, align 1 + %conv = zext i8 %2 to i32 + br i1 undef, label %if.then7, label %if.else + +if.then7: ; preds = %for.cond + %3 = lshr i32 %conv, 2 + %add = add nuw nsw i32 %3, 1 + %conv9 = zext i32 %add to i64 + %4 = load i64, i64* %0, align 8 + %sub.ptr.sub13 = sub i64 %4, 0 + %5 = load i64, i64* undef, align 8 + %6 = load i64, i64* null, align 8 + %sub.i = sub i64 %5, %6 + %cmp.i = icmp ult i32 %add, 17 + %cmp2.i = icmp ugt i64 %sub.ptr.sub13, 20 + %or.cond.i = and i1 %cmp.i, %cmp2.i + %cmp4.i = icmp ugt i64 %sub.i, 15 + %or.cond13.i = and i1 %or.cond.i, %cmp4.i + br i1 %or.cond13.i, label %land.lhs.true5.i, label %if.end17 + +land.lhs.true5.i: ; preds = %if.then7 + %7 = load %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"*, %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"** undef, align 8 + %8 = load i64, i64* %curr_iov_index_.i, align 8 + %9 = load i64, i64* %curr_iov_written_.i, align 8 + %sub6.i = sub i64 0, %9 + %cmp7.i = icmp ugt i64 %sub6.i, 15 + br i1 %cmp7.i, label %cleanup102, label %if.end17 + +if.end17: ; preds = %land.lhs.true5.i, %if.then7 + %sub = add nsw i64 %conv9, -60 + %10 = load i32, i32* undef, align 4 + %arrayidx = getelementptr inbounds [5 x i32], [5 x i32]* @_ZN6snappy8internalL8wordmaskE, i64 0, i64 %sub + %11 = load i32, i32* %arrayidx, align 4 + %and21 = and i32 %11, %10 + %add22 = add i32 %and21, 1 + %conv23 = zext i32 %add22 to i64 + %add.ptr24 = getelementptr inbounds i8, i8* %incdec.ptr, i64 %sub + br label %if.end25 + +if.end25: ; preds = %if.end17 + %sub.ptr.rhs.cast28 = ptrtoint i8* %add.ptr24 to i64 + %cmp30233 = icmp ugt i64 %conv23, 0 + br i1 %cmp30233, label %while.body.preheader, label %while.end + +while.body.preheader: ; preds = %if.end25 + %add.i158256 = add i64 %6, 0 + %cmp.i160257 = icmp ugt i64 %add.i158256, %5 + br i1 %cmp.i160257, label %cleanup105, label %while.cond.preheader.i + +while.cond.preheader.i: ; preds = %while.body.preheader + %call39 = call i8* undef(%"class.snappy::Source.1.199.441.463.507.529.551.595.661.683.705.727.749.771.793.859.881.925.969.1035.1057.1101.1123.1145.1189.1387.1453.1541.1893.2003.2201.2487.2861.2927.3169.5919.5941.6205.6469.6755.7261.7393.7459.7701"* undef, i64* nonnull undef) + unreachable + +while.end: ; preds = %if.end25 + br label %while.cond.preheader.i176 + +while.cond.preheader.i176: ; preds = %while.end + br i1 undef, label %if.end49, label %while.body.lr.ph.i182 + +while.body.lr.ph.i182: ; preds = %while.cond.preheader.i176 + %.pre.i181 = load i64, i64* %curr_iov_written_.i, align 8 + %12 = load %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"*, %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"** undef, align 8 + %13 = load i64, i64* %curr_iov_index_.i, align 8 + %iov_len.i185 = getelementptr inbounds %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704", %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"* %12, i64 %13, i32 1 + %14 = load i64, i64* %iov_len.i185, align 8 + br label %cond.end.i190 + +cond.end.i190: ; preds = %while.body.lr.ph.i182 + br i1 undef, label %if.end18.i207, label %if.then10.i193 + +if.then10.i193: ; preds = %cond.end.i190 + %add12.i191 = add i64 %13, 1 + %iov_len22.phi.trans.insert.i194 = getelementptr inbounds %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704", %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"* %12, i64 %add12.i191, i32 1 + %.pre48.i195 = load i64, i64* %iov_len22.phi.trans.insert.i194, align 8 + br label %if.end18.i207 + +if.end18.i207: ; preds = %if.then10.i193, %cond.end.i190 + %15 = phi i64 [ %.pre.i181, %cond.end.i190 ], [ 0, %if.then10.i193 ] + %16 = phi i64 [ %14, %cond.end.i190 ], [ %.pre48.i195, %if.then10.i193 ] + %17 = phi i64 [ %13, %cond.end.i190 ], [ %add12.i191, %if.then10.i193 ] + %sub.i197 = sub i64 %16, %15 + %cmp.i.i198 = icmp ult i64 %sub.i197, %conv23 + %.sroa.speculated.i199 = select i1 %cmp.i.i198, i64 %sub.i197, i64 %conv23 + %iov_base.i.i200 = getelementptr inbounds %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704", %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"* %12, i64 %17, i32 0 + %18 = load i8*, i8** %iov_base.i.i200, align 8 + %add.ptr.i.i201 = getelementptr inbounds i8, i8* %18, i64 %15 + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %add.ptr.i.i201, i8* %add.ptr24, i64 %.sroa.speculated.i199, i32 1, i1 false) #12 + %add30.i203 = add i64 0, %.sroa.speculated.i199 + store i64 %add30.i203, i64* null, align 8 + %.pre245 = load i64, i64* %0, align 8 + br label %if.end49 + +if.end49: ; preds = %if.end18.i207, %while.cond.preheader.i176 + %19 = phi i64 [ %.pre245, %if.end18.i207 ], [ %4, %while.cond.preheader.i176 ] + %add.ptr50 = getelementptr inbounds i8, i8* %add.ptr24, i64 %conv23 + %sub.ptr.sub54 = sub i64 %19, 0 + %cmp55 = icmp slt i64 %sub.ptr.sub54, 5 + br i1 %cmp55, label %if.then56, label %for.cond + +if.then56: ; preds = %if.end49 + br label %for.cond + +if.else: ; preds = %for.cond + %idxprom = zext i8 %2 to i64 + %arrayidx68 = getelementptr inbounds [256 x i16], [256 x i16]* @_ZN6snappy8internalL10char_tableE, i64 0, i64 %idxprom + %20 = load i16, i16* %arrayidx68, align 2 + %conv69 = zext i16 %20 to i64 + %21 = load i32, i32* undef, align 4 + %shr71 = lshr i64 %conv69, 11 + %arrayidx72 = getelementptr inbounds [5 x i32], [5 x i32]* @_ZN6snappy8internalL8wordmaskE, i64 0, i64 %shr71 + %22 = load i32, i32* %arrayidx72, align 4 + %and73 = and i32 %22, %21 + %conv74 = zext i32 %and73 to i64 + %add79 = add nuw nsw i64 0, %conv74 + %call80 = call zeroext i1 @_ZN6snappy17SnappyIOVecWriter14AppendFromSelfEmm(%"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711"* %writer, i64 %add79, i64 undef) + br i1 %call80, label %if.end82, label %cleanup105 + +if.end82: ; preds = %if.else + br label %for.cond + +cleanup102: ; preds = %land.lhs.true5.i + %iov_base.i.i = getelementptr inbounds %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704", %"struct.snappy::iovec.4.202.444.466.510.532.554.598.664.686.708.730.752.774.796.862.884.928.972.1038.1060.1104.1126.1148.1192.1390.1456.1544.1896.2006.2204.2490.2864.2930.3172.5922.5944.6208.6472.6758.7264.7396.7462.7704"* %7, i64 %8, i32 0 + %23 = load i8*, i8** %iov_base.i.i, align 8 + %add.ptr.i.i = getelementptr inbounds i8, i8* %23, i64 %9 + call void @llvm.memmove.p0i8.p0i8.i64(i8* %add.ptr.i.i, i8* %incdec.ptr, i64 16, i32 1, i1 false) #12 + %24 = load <2 x i64>, <2 x i64>* %1, align 8 + %25 = insertelement <2 x i64> undef, i64 %conv9, i32 0 + %26 = shufflevector <2 x i64> %25, <2 x i64> undef, <2 x i32> zeroinitializer + %27 = add <2 x i64> %24, %26 + store <2 x i64> %27, <2 x i64>* undef, align 8 + unreachable + +cleanup105: ; preds = %if.else, %while.body.preheader + ret void +} + +; Function Attrs: inlinehint +declare zeroext i1 @_ZN6snappy17SnappyIOVecWriter14AppendFromSelfEmm(%"class.snappy::SnappyIOVecWriter.11.209.451.473.517.539.561.605.671.693.715.737.759.781.803.869.891.935.979.1045.1067.1111.1133.1155.1199.1397.1463.1551.1903.2013.2211.2497.2871.2937.3179.5929.5951.6215.6479.6765.7271.7403.7469.7711"*, i64, i64) local_unnamed_addr #10 align 2